Linuxシステムでルーティング失敗の問題を解決するには?

Linuxシステムでルーティング失敗の問題を解決するには?

このメッセージを公開するホームネットワーク192.168.0.xがあり、このネットワークにはネットワーク用のDNSサーバーを実行しているCentOS7ホスト192.168.0.3があります。

ssh192.168.0.3に移動してnslookupリモートコンピュータのIPアドレスを取得できますが、ルータにpingを送信できません。

[root@san ~]# ping -c3 192.168.0.1
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.

--- 192.168.0.1 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 1999ms

以下はarpレポートの内容です

[root@san ~]# arp
Address                  HWtype  HWaddress           Flags Mask            Iface
192.168.0.8              ether   b8:8d:12:20:36:6c   C                     eno1
192.168.0.13             ether   c0:3f:d5:63:4e:1a   C                     eno1
192.168.0.10             ether   c0:3f:d5:63:52:06   C                     eno1
192.168.0.11             ether   c0:3f:d5:61:e8:54   C                     eno1
192.168.0.7              ether   00:50:56:61:2b:75   C                     eno1
192.168.0.12             ether   c0:3f:d5:63:19:71   C                     eno1
192.168.0.1              ether   c0:a0:bb:f8:1f:d4   C                     eno1

ネットワーク上の他のコンピュータにpingを送信できます。

[root@san ~]# ping -c3 192.168.0.13
PING 192.168.0.13 (192.168.0.13) 56(84) bytes of data.
64 bytes from 192.168.0.13: icmp_seq=1 ttl=64 time=0.248 ms
64 bytes from 192.168.0.13: icmp_seq=2 ttl=64 time=0.377 ms
64 bytes from 192.168.0.13: icmp_seq=3 ttl=64 time=0.366 ms

--- 192.168.0.13 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.248/0.330/0.377/0.060 ms

route印刷された内容です。

[root@san ~]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.0.1     0.0.0.0         UG    1024   0        0 eno1
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eno1
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 enp0s20u4

これがifconfig出力です

[root@san ~]# ifconfig
eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.3  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::c23f:d5ff:fe63:d1dd  prefixlen 64  scopeid 0x20<link>
        ether c0:3f:d5:63:d1:dd  txqueuelen 1000  (Ethernet)
        RX packets 6513  bytes 1321730 (1.2 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 15991  bytes 18326750 (17.4 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 20  memory 0xf7c00000-f7c20000  

enp0s20u4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.4  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::224:9bff:fe0b:ddf2  prefixlen 64  scopeid 0x20<link>
        ether 00:24:9b:0b:dd:f2  txqueuelen 1000  (Ethernet)
        RX packets 469  bytes 36166 (35.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 21  bytes 4155 (4.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 0  (Local Loopback)
        RX packets 2122  bytes 642922 (627.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2122  bytes 642922 (627.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

名前解決が機能しても google.com への ping 試行は失敗します。

[root@san ~]# ping -c3 google.com
PING google.com (74.125.226.134) 56(84) bytes of data.

--- google.com ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 1999ms

ルータはネットワーク上の他のコンピュータからpingを送信できます。以下の出力は私のMac Book Pro 192.168.0.8からのものです。

ping -c3 192.168.0.1
PING 192.168.0.1 (192.168.0.1): 56 data bytes
64 bytes from 192.168.0.1: icmp_seq=0 ttl=64 time=1.794 ms
64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=2.000 ms
64 bytes from 192.168.0.1: icmp_seq=2 ttl=64 time=1.986 ms

--- 192.168.0.1 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 1.794/1.927/2.000/0.094 ms

私のネットワークのルーターはD-Link DIR-850Lで、192.168.0.xネットワークのDNSサーバーとして192.168.0.3を指すように設定しました。また、Google DNSサーバー8.8.8.8に転送するように192.168.0.3のDNSサーバーを構成しました。

192.168.0.3が192.168.0.3を介してネットワーク上のどこからでもDNSを検索できるようにする私のMac 192.168.0.8でこの質問を投稿するために使用するネイティブDNSサーバーであるにもかかわらず、なぜ192.168.0.3から192.168.0できませんが、192.168.0.3にログインすると、192.168.0.1でpingできず、インターネットのどこにもアクセスできませんか?

ベストアンサー1

10.132.168.0.3のルーティングテーブルについて質問があります。

default         192.168.0.1     0.0.0.0         UG    1024   0        0 eno1
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eno1
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 enp0s20u4

ホストがルータでない場合は、ルーティングテーブルに次の順序で2行しかないことをお勧めします。

192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eno1
default         192.168.0.1     0.0.0.0         UG    1024   0        0 eno1

既存のルートを削除して新しいルートを作成します。

おすすめ記事