Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have Ubuntu 13.10, Saucy Salamander x64 running as a guest in VirtualBox (with Windows 7 as a host).

I wrote this /etc/network/interfaces because I need to add a large number of permanent, manual static routes:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet dhcp
    up ip -force -b /etc/network/eth1-routes

eth1-routes contains several lines of the form:

route add via 172.x.x.x dev eth1

where 172.x.x.x is the gateway that VBox NAT gives me.

By running netstat -nr it appears that all of my manual routes have been successfully added, including routes to get to two DNS servers via 172.x.x.x.

However, network manager says that both devices are "not managed". If I set /etc/NetworkManager/NetworkManager.conf managed=true, network manager works again but my routes are lost. So my current compromise is to set managed=false and comment out the eth0 lines in /etc/network/interfaces.

Is there a way to have a device be managed and still do manual routes as above?

share|improve this question

1 Answer 1

Network Manager does not recognize the statements you wrote in /etc/network/interfaces.

So your can add your script eth1-routes as a dispatcher script for Network Manager in /etc/network/if-up.d/. It will be run every time an interface goes up. Maybe you have to write in your script an "if clause" to only add the routes if eth1 comes up. Like this:

if [ "$IFACE" == "eth1" ]; then
  route add ...
  route add ...
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.