Trying to configure eth0 and eth1 but Failed to bring up eth1
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
Sometimes flushing the interface before bringing it up works:
ip addr flush dev enp2s0