0

I have a instance/VM having 3 interfaces as below

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9000
        inet 10.34.154.3x  netmask 255.255.254.0  broadcast 10.34.155.255
        inet6 fe80::f816:3eff:feaa:7ced  prefixlen 64  scopeid 0x20<link>
        ether fa:16:3e:aa:7c:ed  txqueuelen 1000  (Ethernet)
        RX packets 33670  bytes 22184129 (21.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 30600  bytes 6280478 (5.9 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9000
        inet 10.34.148.5x  netmask 255.255.254.0  broadcast 10.34.149.255
        inet6 fe80::f816:3eff:feb8:83ac  prefixlen 64  scopeid 0x20<link>
        ether fa:16:3e:b8:83:ac  txqueuelen 1000  (Ethernet)
        RX packets 1712  bytes 106586 (104.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 86  bytes 6172 (6.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9000
        inet 10.34.150.1x  netmask 255.255.254.0  broadcast 10.34.151.255
        inet6 fe80::f816:3eff:fee2:5a68  prefixlen 64  scopeid 0x20<link>
        ether fa:16:3e:e2:5a:68  txqueuelen 1000  (Ethernet)
        RX packets 131  bytes 9929 (9.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 74  bytes 5432 (5.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

My routing Table is created as below

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.34.154.1     0.0.0.0         UG    0      0        0 eth0
10.34.148.0     0.0.0.0         255.255.254.0   U     0      0        0 eth1
10.34.148.59    10.34.148.1     255.255.255.255 UGH   0      0        0 eth1
10.34.150.0     0.0.0.0         255.255.254.0   U     0      0        0 eth2
10.34.154.0     0.0.0.0         255.255.254.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1003   0        0 eth1
169.254.0.0     0.0.0.0         255.255.0.0     U     1004   0        0 eth2

My problem here is I am able to ping the Gateway IP from the configured interface only like, 1. I can ping the gateway IP 10.34.148.1 from eth1 but not from eth0 or eth2 2. I can ping the gateway IP 10.34.150.1 from eth2 but not from eth0 or eth1

Also I am able to reach only the eth0 IP (10.34.154.3x) from Outside network, but cannot reach eth1 and eth2 IP

On asking the Network Administrator, he is of the opinion that the issue is because of the Routing table above. And the Routing table should not have an entry like below

10.34.148.59    10.34.148.1     255.255.255.255 UGH   0      0        0 eth1

as, we should not reach a local interface using a Gateway.

For a workaround he suggested to create/define a new routing table entry as below

cat /etc/iproute2/rt_tables
#
# reserved values
#
255     local
254     main
253     default
0       unspec
#
# local
#
#1      inr.ruhep
200       dnstraf
201 rt1  //creating new definition

Creating a new Rule

cat rule-eth1
from 10.34.148.157 table rt1

And add this line in /etc/sysctl.conf for arp

net.ipv4.conf.all.arp_filter = 1
net.ipv4.conf.default.arp_filter = 1

So the new Routing table should look like

ip route show table rt1
default via 10.34.148.1 dev eth1
10.34.148.0/23 dev eth1 scope link

With this changes, the ping started working fine.

So my question is, what is wrong with my Routing Table? Is the workaround suggested the proper way to tackle issue? or is there something in the OS which I should be aware of?

0

If you have a local interface (IP address) in a subnet you're trying to PING, then this is used. If you specify an interface as source to ping a gateway in a different subnet, then the routers need to be able to reach each other. If they don't, then they forward your request to their (the router's) default gateway until the TTL of the PING is reached and dropped. If the gateway/routing instance is on a firewall system, policy might be blocking/dropping ICMP (PING). One of those reasons might be the cause for you to be unable to PING the gateways.

Also the routing table is missing entries. Each interface should have an entry with 255.255.255.255 net mask/genmask (this entry binds the local interface to the corresponding IP). This makes it hard to really understand what is wrong in your configuration.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.