adding non-default route in /etc/network/interfaces doesn't work

Bug #97058 reported by Tom Wood
2
Affects Status Importance Assigned to Milestone
network-manager (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: ifupdown

As I understand it, the proper way to introduce a non-default route at boot time is to add a "up route add -net ..." line to the network interface in question to the /etc/network/interfaces file in the interface stanza, like so:

iface eth0 inet static
        address 10.1.1.123
        netmask 255.255.255.0
        network 10.1.1.0
        broadcast 10.1.1.255
        gateway 10.1.1.1
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 192.168.1.50
        dns-search example.com
        up route add -net 192.168.1.0 netmask 255.255.255.0 gw 10.1.1.2

However, the "up route" line doesn't get executed.

As a separate but related issue, there's no way using System->Administration->Network to add a non-default route either. That would be a nice idea for an enhancement.

Revision history for this message
Tom Wood (woodts) wrote :

After booting, the "up route ..." line is not run, as evidenced by "netstat -r" not showing the route specified. However, running "/etc/init.d/networking stop" followed by "/etc/init.d/networking start" after boot runs the "up route ..." line. Race condition of some sort, perhaps, at boot time?

description: updated
Revision history for this message
Tom Wood (woodts) wrote :

Tracked the problem down to NetworkManager. Implementing the steps necessary to turn off NetworkManager as referenced in bug # 82335 alleviates the problem.

As stated in bug # 82335, NetworkManager really needs not to cause this conflict on a purely statically addressed machine.

Revision history for this message
Tom Wood (woodts) wrote :

Changed package to reflect actual source of the problem.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.