Trying to configure eth0 and eth1 but Failed to bring up eth1
224,943
Solution 1
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.
- Shut down all interfaces:
ifconfig eth0 down; ifconfig eth1 down; ifconfig eth2 down; ifconfig eth3 down
- Configure eth0:
ifconfig eth0 172.19.20.186 netmask 255.255.255.252 up
- Configure eth1:
ifconfig eth1 172.18.182.55 netmask 255.255.254.0 up
- Set up default gateway:
route add default gw 172.18.182.1
- Set up first static route:
route add -net 172.19.26.0/23 gw 172.19.20.185 dev eth0
- Set up second static route:
route add -net 172.19.24.0/23 gw 172.19.20.185 dev eth0
Solution 2
Sometimes flushing the interface before bringing it up works:
ip addr flush dev enp2s0
Author by
Test1234
Updated on September 18, 2022Comments
-
Test1234 over 1 year
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
andifup eth1
giving above error.Can anyone help how to resolve this?
-
Test1234 almost 11 yearsThanks 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 almost 11 yearsYes 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 almost 11 yearsifup 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 almost 11 years1.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 almost 11 yearsExcellent...tried to connect the ip address and it is working, problem got solved...thanks a bunch, you steps helped in solving the problem
-
SkyRaT about 7 yearsSince I was messing with routes, it possibly hung somewhere and this one-liner solved the thing entirelly. Thanks.
-
Will almost 5 yearsGenius! Once I ensured that I had only ONE gateway line in /etc/network/interfaces, my second NIC came up and down just fine using ifup and ifdown.