Need some help with Routing. I do not understand how to make this work
I have 2 Devices configured. One of the devices(somebox1) is configured with 2 interfaces and the Routing table looks similar as below
[2018-08-24 00:29:14 root@somebox1: /home/admin ]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.4.1 0.0.0.0 UG 0 0 0 eth0
192.168.4.0 0.0.0.0 255.255.254.0 U 0 0 0 eth0
192.168.6.0 0.0.0.0 255.255.254.0 U 0 0 0 eth1
So on this box, For two of the interfaces, there are Routing Rules added for 192.168.4.x and 192.168.6.x. They are all part of CIDR /23
The default is via 192.168.4.1.
I have another device(somebox2) configured with single interface on subnet 192.168.6.x. Its Routing table looks as below
[2018-08-24 04:54:31 admin@somebox2: ~ ]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.6.1 0.0.0.0 UG 0 0 0 eth0
192.168.6.0 0.0.0.0 255.255.254.0 U 0 0 0 eth0
Now. I have a difficulty where, from somebox2, I am not able to ping the eth0 IP of somebox1.
[2018-08-25 04:55:47 root@somebox1: /home/admin ]# ping -I eth0 192.168.4.120
PING 172.29.4.120 (172.29.4.120) from 192.168.6.21 eth0: 56(84) bytes of data.
^C
--- 172.29.4.120 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 1999ms
But i can ping the default gateway of somebox1
[2018-08-25 04:55:32 root@somebox1: /home/admin ]# ping -I eth0 192.168.4.1
PING 172.29.4.1 (172.29.4.1) from 192.168.6.21 eth0: 56(84) bytes of data.
64 bytes from 192.168.4.1: icmp_seq=1 ttl=255 time=0.498 ms
64 bytes from 192.168.4.1: icmp_seq=2 ttl=255 time=0.701 ms
^C
--- 172.29.4.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1
And from somebox1, I am able to ping eth0 IP of somebox2 using eth1 interface
bash-4.2$ ping -I eth0 192.168.6.21
PING 192.168.6.21 (192.168.6.21) from 192.168.4.120 eth0: 56(84) bytes of data.
^C
--- 192.168.6.21 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 2999ms
bash-4.2$ ping -I eth1 192.168.6.21
PING 192.168.6.21 (192.168.6.21) from 192.168.6.44 eth1: 56(84) bytes of data.
64 bytes from 192.168.6.21: icmp_seq=1 ttl=64 time=1.64 ms
64 bytes from 192.168.6.21: icmp_seq=2 ttl=64 time=0.789 ms
64 bytes from 192.168.6.21: icmp_seq=3 ttl=64 time=0.635 ms
^C
--- 192.168.6.21 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 0.635/1.022/1.643/0.444 ms
if I have the Routing Table entry for 192.168.6.0 removed on somebox1 or I have the interface of eth1(192.168.6.x) completely removed, Then I am able to ping from somebox2 to somebox1 without any issues.
Also, I am able to see if somebox2 is configured with interfaces 192.168.4.x or 192.168.2.x or 192.168.12.x, I am able ping eth0 IP of somebox1 without any issues. It is that only when 192.168.6.x is configured on somebox2, that I am unable to ping eth0 IP of somebox1 But, I am able to ping eth1 IP of somebox1 which is on 192.168.6.x network without any issues
Question:
1. Is removing the Interface or Routing table for eth1 from somebox1 the only way i can ping from somebox2 to somebox1
2. Why is that with the same interface i am facing this hurdle of not able to ping. Is it to do with the Routing table configuration on somebox1