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.

Trying to do below on Ubuntu 12.04.

Trying to configure eth0 and eth1, eth0 works fine, but failed to bring eth1.

Below is the settings /etc/network/interfaces:

auto eth0 eth1

iface eth0 inet static
address 172.19.20.186
netmask 255.255.255.252
network 172.19.20.184
broadcast 172.19.20.187
gateway 172.19.20.185

iface eth1 inet static
address 172.18.182.55
netmask 255.255.254.0
gateway 172.18.182.1

up route add -net 172.19.26.0/23 gw 172.19.20.185 dev eth0
up route add -net 172.19.24.0/23  gw 172.19.20.185 dev eth0
up route add default  gw 172.18.182.1 dev eth1

When /etc/init.d/networking restart is done, giving below error:

$ /etc/init.d/networking restart
RTNETLINK answers: File exists
Failed to bring up eth1

Even ifdown eth1 and ifup eth1 giving above error.

Can anyone help how to resolve this?

share|improve this question
add comment

1 Answer 1

up vote 4 down vote accepted

I think you only need one default gateway. You have set up 3: gateway 172.19.20.185, gateway 172.18.182.1 and up route add default gw 172.18.182.1 dev eth1.

Try the following interfaces file:

auto eth0 eth1

iface eth0 inet static
  address 172.19.20.186
  netmask 255.255.255.252

iface eth1 inet static
  address 172.18.182.55
  netmask 255.255.254.0
  gateway 172.18.182.1
  up route add -net 172.19.26.0/23 gw 172.19.20.185 dev eth0
  up route add -net 172.19.24.0/23 gw 172.19.20.185 dev eth0

EDIT: Try this to manually configure the interfaces, so we can see where is the error.

  1. Shut down all interfaces: ifconfig eth0 down; ifconfig eth1 down; ifconfig eth2 down; ifconfig eth3 down
  2. Configure eth0: ifconfig eth0 172.19.20.186 netmask 255.255.255.252 up
  3. Configure eth1: ifconfig eth1 172.18.182.55 netmask 255.255.254.0 up
  4. Set up default gateway: route add default gw 172.18.182.1
  5. Set up first static route: route add -net 172.19.26.0/23 gw 172.19.20.185 dev eth0
  6. Set up second static route: route add -net 172.19.24.0/23 gw 172.19.20.185 dev eth0
share|improve this answer
    
Thanks for you response back. Tried the option that you provided, but still it is giving the same error. Is there any drivers need to be installed for eth1 –  Test1234 Jun 6 '13 at 18:01
    
Yes eth1 is there and also eth2 and eth3 is also there. If trying to configure eth2 and eth3 instead of eth1 it is giving the same error. Below is the snapshot for ifconfig -a eth1 eth1 Link encap:Ethernet HWaddr 6c:3b:e5:b1:40:4d inet addr:172.18.182.55 Bcast:172.18.183.255 Mask:255.255.254.0 inet6 addr: fe80::6e3b:e5ff:feb1:404d/64 Scope:Link –  Test1234 Jun 6 '13 at 18:31
    
ifup and ifdown is showing the same error......ipconfig -a for eth2 and eth3 is below....eth2 Link encap:Ethernet HWaddr 6c:3b:e5:b1:40:4e BROADCAST MULTICAST MTU:1500 Metric:1...... eth3 Link encap:Ethernet HWaddr 6c:3b:e5:b1:40:4f BROADCAST MULTICAST MTU:1500 Metric:1 ........Resart the sever but still same issue –  Test1234 Jun 6 '13 at 19:10
1  
1.Shut down all interfaces: ifdown eth0 eth1 eth2 eth3 For this step it is giving below error...... ifdown: interface eth1 not configured ifdown: interface eth2 not configured ifdown: interface eth3 notconfigured ......for other step 2 to step 6 it is not giving any error –  Test1234 Jun 6 '13 at 19:46
    
Excellent...tried to connect the ip address and it is working, problem got solved...thanks a bunch, you steps helped in solving the problem –  Test1234 Jun 6 '13 at 20:04
add comment

Your Answer

 
discard

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.