How to address 'ping -I <interface>' failure
Background:
2 wan interfaces - call them 12.14.16.18 on eth0 (not the issue) and 98.100.102.105 on eth1 (both /29),
'ping -I 98.100.102.105 google.com' works but 'ping -I eth1 google.com' returns 'From 98.100.102.105 icmp_seq=1 Destination Host Unreachable'
'cat /etc/iproute2/rt_tables' shows (leaving out commented lines)
255 local
254 main
253 default
0 unspec
1 fbr
3 dslip rule shows (leaving out default and ipsec)
10000: from all fwmark 0x1/0xff lookup fbr
10002: from all fwmark 0x3/0xff lookup dsl
20000: from 12.14.16.18 lookup fbr
20000: from 98.100.102.105 lookup dslip route show table dsl has (leaving out OpenVPN and other local non-Internet interfaces)
default via 98.100.102.108 dev eth1 src 98.100.102.105
98.100.102.104/29 dev eth1 proto kernel scope link src 98.100.102.105
98.100.102.108 dev eth1 scope link src 98.100.102.105I'm just beginning to learn about multiple routing tables so I tried the following suspecting it wouldn't work (and it didn't): 'ip rule add from eth1 table dsl' and got 'Error: ??? prefix is expected rather than "eth1" '
What do I need to do to get 'ping -I eth1 google.com' to work? Thanks for your help.
Thank you for responding, I appreciate it. That is most interesting and would explain what I'm seeing, is this "little specific thing" documented somewhere? How did you find this out?
----- Original Message -----
From: "Anton Danilov" <[email protected]>
To: "Leroy Tennison" <[email protected]>
Cc: "lartc" <[email protected]>
Sent: Wednesday, February 14, 2018 1:58:20 AM
Subject: Re: How to address 'ping -I <interface>' failure
Hello.
There is a little specific thing with "-I <iface>" usage in the ping tool.
When you specify an interface name in the -I option, the ping tool work as if the destinated host is in directly-connected segment. If you run the tcpdump, you will see the arp requests to resolve the destinated ip address.
So, use the -I option with interface names only to ping directly attached host or if you have proxy-arp enabled gateway.
On 22 January 2018 at 19:55, Leroy Tennison < [ mailto:[email protected] | [email protected] ] > wrote:
Background:
2 wan interfaces - call them 12.14.16.18 on eth0 (not the issue) and 98.100.102.105 on eth1 (both /29),
'ping -I 98.100.102.105 [ http://google.com/ | google.com ] ' works but 'ping -I eth1 [ http://google.com/ | google.com ] ' returns 'From 98.100.102.105 icmp_seq=1 Destination Host Unreachable'
'cat /etc/iproute2/rt_tables' shows (leaving out commented lines)
255 local
254 main
253 default
0 unspec
1 fbr
3 dsl
ip rule shows (leaving out default and ipsec)
10000: from all fwmark 0x1/0xff lookup fbr
10002: from all fwmark 0x3/0xff lookup dsl
20000: from 12.14.16.18 lookup fbr
20000: from 98.100.102.105 lookup dsl
ip route show table dsl has (leaving out OpenVPN and other local non-Internet interfaces)
default via 98.100.102.108 dev eth1 src 98.100.102.105
[ http://98.100.102.104/29 | 98.100.102.104/29 ] dev eth1 proto kernel scope link src 98.100.102.105 98.100.102.108 dev eth1 scope link src 98.100.102.105
I'm just beginning to learn about multiple routing tables so I tried the following suspecting it wouldn't work (and it didn't): 'ip rule add from eth1 table dsl' and got 'Error: ??? prefix is expected rather than "eth1" '
What do I need to do to get 'ping -I eth1 [ http://google.com/ | google.com ] ' to work? Thanks for your help.
Signature · 11 lines
To unsubscribe from this list: send the line "unsubscribe lartc" in the body of a message to [ mailto:[email protected] | [email protected] ] More majordomo info at [ http://vger.kernel.org/majordomo-info.html | http://vger.kernel.org/majordomo-info.html ] -- Anton.
Quoted 1 line · Leroy Tennison
I'm just beginning to learn about multiple routing tables so I tried the following suspecting it wouldn't work (and it didn't): 'ip rule add from eth1 table dsl' and got 'Error: ??? prefix is expected rather than "eth1"'
Now my brain is starting to wonder about the pros and cons of:
- Policy Based Routing (PBR) (what you're doing)
- Network Namespaces
- Virtual Routing and Forwarding (a.k.a. L3MDEV)
Though, based on Anton's comment, I don't know that "ping -I" would have worked as desired.
That being said, it would be possible to have the NNS based gateways with proxy-arp enabled. Thus you could probably do something like this:
ping -I dsl google.com
ping -I fbr google.com
Where dsl and fbr are vEth links into the respective NNSs w/ proxy-arp enabled.
I don't have enough experience with VRF (L3MDEV) to know how it would play different. But I do think that VRF avoids some of the need for ip rules (PBR) to specify source IP or interface as it handles (some of?) that for you.
Signature · 2 lines
Grant. . . . unix || die