0

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
  • I don't undestand `2 devices route`. Can you show all ip routes and ip addresses? – Mikhail Khirgiy Jun 20 '17 at 05:21
  • I mean that dev ppp0 it is one device and 192.168.200.1 it is another device (eth0). While route mean as i know always one device specified to send packets from to destined network. –  Jun 20 '17 at 05:33
  • No. You can have two or .more same route rules which have different outgoing interfaces and different priority. – Mikhail Khirgiy Jun 20 '17 at 05:38
  • But here is one rule contain 2 outgoing interfaces. P.S. i have update question with my route table. –  Jun 20 '17 at 05:42

1 Answers1

0

You have only one IP network which has two route rules:

169.254.0.0/16 dev eth1  scope link  metric 1002
169.254.0.0/16 dev eth0  scope link  metric 1004

169.254.0.0/16 is the special IP block for link-local addressing. See a documentation at Zero-configuration networking

To disable link-local (zeroconf) on Debian-like Linux set AVAHI_DAEMON_DETECT_LOCAL=0 in /etc/default/avahi-daemon configuration file.

To disable link-local (zeroconf) on RedHat-like Linux set NOZEROCONF=yes in /etc/sysconfig/network configuration file.

Reboot will apply new configuration (or restart network or avahi services).

Mikhail Khirgiy
  • 2,073
  • 11
  • 7
  • No you dont understand me. Please re read question. I mean route `172.30.0.0/16 via 117.158.54.60 dev ppp0 src 192.168.200.1` it tell that packets should be send from dev `ppp0` right? Ok but at the end src tell that packets send from `192.168.200.1` which belong to `eth0` interface. How it can be? –  Jun 20 '17 at 18:00
  • I think you use `iproute2`. Then show output of command `ip route show table all`. – Mikhail Khirgiy Jun 21 '17 at 04:27
  • It is not matter, `ip route show table all` shows the same route. –  Jun 21 '17 at 10:11
  • I think you still don't understand. "How in one route rule can be 2 output devices: ppp0 and eth0?" –  Jun 21 '17 at 10:15
  • Enyone have idea more? –  Jun 24 '17 at 03:37
  • If this route isn't assigned statically it come dynamically from your provider via ppp connection. – Mikhail Khirgiy Jun 24 '17 at 03:49
  • Are you sure that understand my question? How this route come is known. From ipsec service. Question is another. How in one route rule can be 2 output devices: ppp0 and eth0? –  Jun 24 '17 at 06:30