
Brauche Hilfe beim Routing. Ich verstehe nicht, wie das funktioniert
Ich habe 2 Geräte konfiguriert. Eines der Geräte (irgendeinbox1) ist mit 2 Schnittstellen konfiguriert und die Routing-Tabelle sieht ungefähr so aus wie unten
[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
Auf dieser Box wurden für zwei der Schnittstellen Routing-Regeln für 192.168.4.x und 192.168.6.x hinzugefügt. Sie sind alle Teil von CIDR /23
Die Standardeinstellung ist 192.168.4.1.
Ich habe ein anderes Gerät(irgendeinbox2) konfiguriert mit einer einzigen Schnittstelle im Subnetz 192.168.6.x. Die Routing-Tabelle sieht wie folgt aus
[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
Jetzt habe ich ein Problem, da ich von somebox2 aus die eth0-IP von somebox1 nicht anpingen kann.
[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
Aber ich kann das Standard-Gateway von somebox1 anpingen
[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
Und von somebox1 aus kann ich die eth0-IP von somebox2 über die eth1-Schnittstelle anpingen
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
Wenn ich den Routing-Tabelleneintrag für 192.168.6.0 auf somebox1 entfernt habe oder die Schnittstelle von eth1 (192.168.6.x) vollständig entfernt habe, kann ich ohne Probleme von somebox2 zu somebox1 pingen.
Außerdem kann ich sehen, ob somebox2 mit den Schnittstellen 192.168.4.x oder 192.168.2.x oder 192.168.12.x konfiguriert ist. Ich kann die eth0-IP von somebox1 ohne Probleme anpingen. Nur wenn 192.168.6.x auf somebox2 konfiguriert ist, kann ich die eth0-IP von somebox1 nicht anpingen. Ich kann jedoch die eth1-IP von somebox1, die sich im Netzwerk 192.168.6.x befindet, ohne Probleme anpingen.
Frage:
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