For some odd reason the network stopped working on my home “server”. The server is an old Dell GX-240 is running as a server on it’s old days.
First I thought it was because of some iwconfig settings, but during my work, that was not the case. In stead it was the routing tables that was messed up for some reason.
I don’t know if what i hit was/is a bug, and/or if my solution is a suitable workaround, but it works for me at least.
This is what I did to get the server back online:
In /etc/network/interfaces:
# The primary network interface
auto wlan0
iface wlan0 inet static
address 192.168.0.175
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.89
# wireless-* options are implemented by the wireless-tools package
wireless-channel auto
wireless-mode Managed
wireless-key XXXXXXXXXXXXX
wireless-essid YYYYYYYYYYYYYY
# dns-* options are implemented by the resolvconf package, if installed
# Static routing
pre-down route del -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.0.89
post-up ip route add 192.168.0.0 via 192.168.0.89 dev wlan0
post-up ip route add default via 192.168.0.89 dev wlan0
What I have done is: Moved the part related to networking to the top of the section for the current network card (in my case wlan0 (a wireless USB card)).
Then – for some reason – I had to add two default gateways to the route.
But that’s not all
in rc.local I added the following code:
ip route del default via 192.168.0.89 dev wlan0
/etc/init.d/networking restart
# Starting VirtualBox
/etc/init.d/vboxdrv.dpkg-bak setup
# Starting VirtualBox
echo "Starting VirtualBox VM Windows Server"
/usr/bin/VBoxHeadless -startvm "WinServer" --vrdp on &
What this part does is:
First it deletes the default gateway, then it restarts the Network.
Then I am starting the VirtualBox part. For some reason I get a message saying that the header modules are not loaded, so that’s why I have to run the vboxdrv setup -command. (on my box it is renamed to vboxdrv.dpkg.bak, but I have also – after doing this – copied this so that I have a vboxdrv file in that directory)
When that part is done, I start the current server with –vrdp set to on. The & sign is there so that the VM is running in a separate “job”.
I hope this helps someone. If someone out there can explain why this might have happened, and how I can clean up the mess, don’t hesitate to leave a comment.
System info:
Linux ubuntu-server 2.6.31-16-generic-pae #53-Ubuntu SMP Tue Dec 8 05:20:21 UTC 2009 i686 GNU/Linux

