andrewdmcleod / magpie-layer

testing
Apache License 2.0
0 stars 12 forks source link

incorrect primary interface detected #11

Closed marosg42 closed 5 years ago

marosg42 commented 5 years ago

This is what current code does

# ip route get 192.168.35
192.168.35.0 via 10.246.64.1 dev eth0 src 10.246.64.211 uid 0 
    cache 

Which detects eth0 as a primary interface for 192.168.35 network.

However bond0.2735 is the correct device.

# ip route 
default via 10.246.64.1 dev eth0 proto static 
10.246.64.0/21 dev eth0 proto kernel scope link src 10.246.64.211 
192.168.33.0/24 dev eth1.2696 proto kernel scope link src 192.168.33.138 
192.168.35.64/26 dev bond0.2735 proto kernel scope link src 192.168.35.72 
192.168.36.64/26 dev bond0.2736 proto kernel scope link src 192.168.36.72

This results in mtu mismatch

Looks like this is the correct way

# ip route show to match 192.168.36.72
default via 10.246.64.1 dev eth0 proto static 
192.168.36.64/26 dev bond0.2736 proto kernel scope link src 192.168.36.72

just grep -v via