This is a continuation of my other thread.
I need to not have to type in ifup eth0
every time i boot to get an IP-address to access the internet. I've tried making a cronjob crontab -e
:
@reboot ifup eth0
But it seems the cronjob is not even running even though if i edit it to run the command every minute.
I've also tried creating a init.d script (and made it executable with chmod 755
) to run the command in /etc/init.d/ folder and made a symlink to the runlevel folder I'm running in.
Still, no internet access and no ip-address till i manually enter the command.
I also found out restarting the service with /etc/init.d/networking restart
also does the trick.
In the /etc/networking/interfaces
file, I have the usual:
...
auto eth0
iface eth0 inet dhcp
...
If i set a static IP address, i obviously have an IP-address as after booting, but ping google.com
returns "bad address".
So these are my questions:
- Why isn't my init script working?
- Why isn't my cronjob working?
- Why do even need to run the command in the first place, as the
etc/init.d/networking
is running theifup -a
command?
I don't really care how i get internet access at boot time right now, i just need it to work. No matter what solution i come upon, does absolutly nothing. Everything is run as root, so it can't be anything about permissions.