I have a PetaLinux machine (Embedded Linux on a Xilinx Zynq device, debian fork, kernel 4.19). If the two NICs are on different subnets, then I can disconnect one NIC, and the other will continue working. But if they are on the same subnet, then disconnecting eth0 will render both unreachable. (Disconnecting eth1 is fine.) Also, if the addresses are acquired by DHCP, then disconnecting the plug for eth0 is also fine.
Now, I understand that by default, Linux has a weak policy for choosing a NIC to respond through for any message, and this is something I dealt with a few years ago, in another article.
Unfortunately, this solution doesn't seem to be working on the version of Linux we have here. Is there something new we have to do with more recent kernels?
Thanks in advance.
Update
"ip route" while both cables are plugged in:
default via 192.168.1.1 dev eth0
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.195
192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.196
"ip route" when eth0 is unplugged (failure case):
default via 192.168.1.1 dev eth0 linkdown
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.195 linkdown
192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.196
"ip route" when eth1 is unplugged (works fine):
default via 192.168.1.1 dev eth0
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.195
192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.196 linkdown
To reiterate, we are unable to ping 192.168.1.196 when the NIC for 192.168.1.195 is unplugged.
0 Answers