由安装两块网卡的linux系统中引起网络不通想到的
作者:李晨光
一天,小王突然急匆匆的来找我,他说:“我在机子上刚装的redhat怎么老也ping不通服务器,我网卡的驱动都安装了,ping 自己的两块网卡的IP都能通,可就时访问不了服务器。我输入http://172.31.0.101就提示‘当试图与172.31.0.101联系时,连接被拒绝’”
我来到小王的机器前查看了一下网络配置。
引用:
[root@rhas root]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 000:B7:C6:8F:1D
inet addr:172.31.0.200 Bcast:172.31.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16 errors:0 dropped:0 overruns:0 frame:0
TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1306 (1.2 Kb) TX bytes:210 (210.0 b)
Interrupt:10 Base address:0xe800 Memory:d9100000-d9100038
eth1 Link encap:Ethernet HWaddr 00:01:03:40:A4:15
inet addr:172.31.0.201 Bcast:172.31.0.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:32 errors:0 dropped:0 overruns:0 carrier:32
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:1920 (1.8 Kb)
Interrupt:11 Base address:0xec00
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:1430 errors:0 dropped:0 overruns:0 frame:0
TX packets:1430 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:143776 (140.4 Kb) TX bytes:143776 (140.4 Kb)
[root@rhas root]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.31.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
172.31.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 172.31.0.254 0.0.0.0 UG 0 0 0 eth1