I was confused by ip route list
output on linux box.
He is shows route:
172.30.0.0/16 via 117.158.54.60 dev ppp0 src 192.168.200.1
I read in manual
the source address to prefer when sending to the destinations covered by the route prefix.
Ok, but if packets will be sending from 192.168.200.1
ip it shouldn't sending from ppp0
via 117.158.54.60
ip.
Yes, dev ppp0
has 117.158.54.60
as next hop, BUT 192.168.200.1
it is an eth0
device ip. So actually which device will be preferred eth0
or ppp0
to send packets to 172.30.0.0/16
network? I am don't understand why ip
utility have accept this "2 devices route" command.
P.S. ppp0
it is isp connection, but isp twisted-pair connected to eth1
card.
Please help me with it.
My route table:
117.158.54.60 dev ppp0 proto kernel scope link src 117.158.54.31
57.182.238.104 dev ppp0 scope link src 117.158.54.31 mtu 1492
44.226.203.71 dev ppp0 scope link
192.168.200.0/24 dev eth0 proto kernel scope link src 192.168.200.1
172.20.41.0/24 via 5.5.0.1 dev tun0 metric 101
172.20.20.0/23 via 5.5.0.1 dev tun0 metric 101
172.20.30.0/23 via 5.5.0.1 dev tun0 metric 101
5.5.0.0/21 dev tun0 proto kernel scope link src 5.5.0.106
5.5.0.0/20 via 5.5.0.1 dev tun0 metric 101
172.30.0.0/16 via 117.158.54.60 dev ppp0 src 192.168.200.1
169.254.0.0/16 dev eth1 scope link metric 1002
169.254.0.0/16 dev eth0 scope link metric 1004
192.168.0.0/16 dev tun1 scope link
10.208.0.0/12 dev tun1 scope link
10.176.0.0/12 dev tun1 scope link
default dev ppp0 scope link