bug: confconsole not saving the default route when configuring a static IP

jewok's picture

After installing the latest Turnkey MediaWiki on a virtual machine in VMware, I found that new system could not reach any other network. The routing table had a single entry for the host network ( for example) but there was no default route. Adding a route for corrected the problem and allowed the host to retreive updates.

I guess I'm not sure if the sparse routing table is there by design of if something is missing in the instal.


Liraz Siri's picture

By default the appliance is configured to setup the network connection using DHCP, which should be providing the default gateway.

I know vmware runs its own DHCP daemon on the virtual network interface. Could this be a problem with the configuration of VMware's DHCP daemon on your system? To find out we need a bit more information to go on

What happens when you run the udhcpc client manually?

udhcpc -i=eth0

What happens when you restart the network?

/etc/init.d/networking restart
jewok's picture

Thanks for the reply. The host can be reached from other networks when it is configured to use DHCP. I neglected to include a critical detail in the original post.

After the system boots, I selected the advanced settings from the TurnKey Linux Configuration Console and selected the StaticIP Configuration. The fields are set to:

IP Address
Default Gateway
Name Server

This configuration works until the host is restarted. After the restart, the host is reachable on it home network and unreachable from any other network. The routing table looks like this:

Destination Gateway Genmask Flags Metric Ref Use Iface * U 0 0 0 eth0

If I add a default route (below), the host becomes reachable from other networks. Below that is the resulting routing table.

route add -net netmask gw dev eth0

Destination Gateway Genmask Flags Metric Ref Use Iface * U 0 0 0 eth0
default UG 0 0 0 eth0

After a subsequent reboot, the default route is missing. When I go back into the TurnKey Linux Configuration Console, the Static IP Config shows correct settings for IP, netmask, and name server. However, the Default Gateway field is empty. If I add the default gateway, and select , the host is now reachable from other networks.

It appears that the issue is that the default route is not being preserved when a static IP is used. I can add a static default route in the /etc/network/interfaces file to correct the issue. I was wondering if that is something that the configuration console should do.
jewok's picture

I played with this a bit more and found that adding a gateway line to the eth0 interface definition in the /etc/network/interfaces file seems to correct the routing problem. I no longer need to add the default route manually.

auto eth0
iface eth0 inet static
=>>  gateway
Liraz Siri's picture

Thank you so much for reporting this. You found a bug in the configuration console's static IP configuration code. I just went through it and confirmed that the default gateway isn't being set in /etc/network/interfaces. I filed a bug report on launchpad.

The next batch of releases will include a fix to this and a couple of other bugs that have been reported.

Alon Swartz's picture

Thanks for reporting this issue Jewok!

The fix has been commited to the turnkeylinux code repository and package archive.
Version: confconsole_0.9.1+2+g5e40435

Refer to the bug report for more info:

Post new comment