localhostを除くすべてのホストをpingできます。何が問題なの?

localhostを除くすべてのホストをpingできます。何が問題なの?

サーバーに新しいRed Hatボックスをインストールしました。

IPとサーバー名を使用してネットワーク上の他のコンピュータにpingを送信できますが、localhost、127.0.0.1、または192.168.4.42(ローカルIP)は使用できません。

[root@comp2 ~]# ping comp1
PING vcas1 (192.168.4.41) 56(84) bytes of data.
64 bytes from vcas1 (192.168.4.41): icmp_seq=1 ttl=64 time=0.104 ms
64 bytes from vcas1 (192.168.4.41): icmp_seq=2 ttl=64 time=0.100 ms

--- comp1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.100/0.102/0.104/0.002 ms
[root@comp2 ~]# 

[root@comp2 ~]# ping 192.168.4.41
PING 192.168.4.41 (192.168.4.41) 56(84) bytes of data.
64 bytes from 192.168.4.41: icmp_seq=1 ttl=64 time=0.119 ms
64 bytes from 192.168.4.41: icmp_seq=2 ttl=64 time=0.105 ms

--- 192.168.4.41 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.105/0.112/0.119/0.007 ms

ただし、localhostやローカルIPアドレスをpingすることはできません。

[root@comp2 ~]# ping 192.168.4.42
PING 192.168.4.42 (192.168.4.42) 56(84) bytes of data.

--- 192.168.4.42 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 1999ms
PING comp2 (192.168.4.42) 56(84) bytes of data.

--- comp2 ping statistics ---
17 packets transmitted, 0 received, 100% packet loss, time 15999ms

[root@comp2 ~]# ping 192.168.4.42
PING 192.168.4.42 (192.168.4.42) 56(84) bytes of data.

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

[root@comp2 ~]# ping localhost
PING localhost.localdomain (127.0.0.1) 56(84) bytes of data.

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

これは私の/ etc / hostsです。

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6
192.168.4.41    comp1
192.168.4.42    comp2

最後に、これは私のifconfigです。

[root@comp2 ~]# /sbin/ifconfig
eth0      Link encap:Ethernet  HWaddr 00:26:55:D4:4E:81  
          inet addr:10.0.0.14  Bcast:10.127.255.255  Mask:255.128.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:271591 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3079 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:16571921 (15.8 MiB)  TX bytes:228424 (223.0 KiB)
          Memory:fbfa0000-fbfc0000 

eth1      Link encap:Ethernet  HWaddr 00:26:55:D4:4E:80  
          inet addr:192.168.4.42  Bcast:192.168.4.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:174349 errors:0 dropped:0 overruns:0 frame:0
          TX packets:34537 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:12202232 (11.6 MiB)  TX bytes:3230241 (3.0 MiB)
          Memory:fbfe0000-fc000000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:16398 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16398 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:829344 (809.9 KiB)  TX bytes:829344 (809.9 KiB)

どうなりますか?

編集する:

[root@comp2 ~]# /sbin/iptables -F
[root@comp2 ~]# /etc/init.d/iptables stop
Flushing firewall rules:                                   [  OK  ]
Setting chains to policy ACCEPT: filter                    [  OK  ]
Unloading iptables modules:                                [  OK  ]
[root@comp2 ~]# ping localhost
PING localhost.localdomain (127.0.0.1) 56(84) bytes of data.

--- localhost.localdomain ping statistics ---
6 packets transmitted, 0 received, 100% packet loss, time 4999ms

まだ何もありません。

[root@comp2 ~]#/sbin/ip route show
192.168.4.0/24 dev eth1  proto kernel  scope link  src 192.168.4.42 
169.254.0.0/16 dev eth1  scope link 
10.0.0.0/9 dev eth0  proto kernel  scope link  src 10.0.0.14 
default via 10.0.0.1 dev eth0 

[root@comp2 ~]# /sbin/route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.4.0     *               255.255.255.0   U     0      0        0 eth1
169.254.0.0     *               255.255.0.0     U     0      0        0 eth1
10.0.0.0        *               255.128.0.0     U     0      0        0 eth0
default         VideoGateway.Om 0.0.0.0         UG    0      0        0 eth0

新しい:

これを行う必要がありましたが、再度comp1サーバー(192.168.4.41)でcomp2(192.168.4.42)をpingできませんでした。

ベストアンサー1

必要なのはルーティングテーブルの再設定です。更新さGATEWAYれる変数です /etc/sysconfig/networking-scripts/ifcfg-ethX/etc/sysconfig/networking-scripts/route-ethXパス情報も更新する必要があります。正しいネットワーク設定でファイルを更新したら、再起動して新しいネットワーク設定がインターフェイスに適用されるようにしますnetwork/sbin/service network restart

おすすめ記事