
ルーティングについて助けが必要です。これをどうやって機能させるのか分かりません
2つのデバイスが設定されています。そのうちの1つ(サムボックス1) は 2 つのインターフェースで構成されており、ルーティング テーブルは以下のようになります。
[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
このボックスでは、2つのインターフェースに192.168.4.xと192.168.6.xのルーティングルールが追加されています。これらはすべてCIDR /23の一部です。
デフォルトは 192.168.4.1 経由です。
別のデバイスを持っています(サムボックス2)はサブネット192.168.6.x上の単一のインターフェースで構成されています。ルーティングテーブルは以下のようになります。
[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
現在、somebox2 から somebox1 の eth0 IP に ping できないという問題が発生しています。
[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
しかし、somebox1のデフォルトゲートウェイにpingを実行できます
[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
そしてsomebox1からeth1インターフェースを使ってsomebox2のeth0 IPにpingできる。
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
somebox1 で 192.168.6.0 のルーティング テーブル エントリを削除するか、eth1(192.168.6.x) のインターフェイスを完全に削除すると、somebox2 から somebox1 に問題なく ping を実行できるようになります。
また、somebox2 がインターフェース 192.168.4.x または 192.168.2.x または 192.168.12.x で構成されているかどうかを確認でき、somebox1 の eth0 IP に問題なく ping できます。somebox2 で 192.168.6.x が構成されている場合にのみ、somebox1 の eth0 IP に ping できません。ただし、192.168.6.x ネットワーク上にある somebox1 の eth1 IP には問題なく ping できます。
質問:
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