VIE
VIE

Reputation: 11

How to set up multiple network interfaces on ubuntu server. [RTNETLINK answers: File exists]

interface file

auto eth0
iface eth0 inet dhcp
        up route add 192.168.11.2 dev eth0
        up route add default gw 192.168.11.2 dev eth0

auto eth1
iface eth1 inet static
        address 10.95.163.14
        netmask 255.255.255.0
        up route add 172.16.0.0/16 via 10.95.163.1 dev eth1

problem

sudo /etc/init.d/networking restart 

RTNETLINK answers: File exists

Failed to bring up eth1.

usage

eth0 is used for internet access
eth1 is used for communicate within 2 internal networks

workaround Right now I need to add the route manually using

sudo ip route add 172.16.0.0/16 via 10.95.163.1 dev eth1

question

  1. Are there any problem with my configulation
  2. Are there any better solution

Upvotes: 1

Views: 3159

Answers (1)

Josip Rodin
Josip Rodin

Reputation: 809

You should restart each interface using something like:

ifdown -v ethX
ifup -v ethX

That way you will see the exact command that failed.

From a quick reading of your configuration, I could imagine a problem being that your DHCP server is sending you one of those routes, and then you try to add it again.

Upvotes: 1

Related Questions