Chinaunix
标题:
关于 SUSE linux 11 的路由问题
[打印本页]
作者:
zhanshen8D
时间:
2012-02-03 17:25
标题:
关于 SUSE linux 11 的路由问题
最近碰到一个很怪的问题,不知哪位碰到过.
ifconfig的内容如下:
ifconfig –a
bond0 Link encap:Ethernet HWaddr 00:17:A4:77:00:10
inet addr:192.168.0.7 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:881005 errors:0 dropped:0 overruns:0 frame:0
TX packets:1403984 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:225685143 (215.2 Mb) TX bytes:201291440 (191.9 Mb)
eth0 Link encap:Ethernet HWaddr 00:17:A4:77:00:10
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:118140 errors:0 dropped:0 overruns:0 frame:0
TX packets:144261 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:25696195 (24.5 Mb) TX bytes:24606151 (23.4 Mb)
eth1 Link encap:Ethernet HWaddr 00:17:A4:77:00:10
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:762865 errors:0 dropped:0 overruns:0 frame:0
TX packets:1259723 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:199988948 (190.7 Mb) TX bytes:176685289 (168.5 Mb)
eth2 Link encap:Ethernet HWaddr 00:17:A4:77:00:14
inet addr:10.228.65.3 Bcast:10.228.65.15 Mask:255.255.255.240
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:118139 errors:0 dropped:0 overruns:0 frame:0
TX packets:144261 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:25696127 (24.5 Mb) TX bytes:24606151 (23.4 Mb)
eth3 Link encap:Ethernet HWaddr 00:17:A4:77:00:16
inet addr:10.228.65.19 Bcast:10.228.65.31 Mask:255.255.255.240
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:762872 errors:0 dropped:0 overruns:0 frame:0
TX packets:1259732 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:199989588 (190.7 Mb) TX bytes:176686176 (168.5 Mb)
eth4 Link encap:Ethernet HWaddr 00:17:A4:77:00:18
inet addr:192.168.1.5 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:118138 errors:0 dropped:0 overruns:0 frame:0
TX packets:144261 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:25696059 (24.5 Mb) TX bytes:24606151 (23.4 Mb)
eth5 Link encap:Ethernet HWaddr 00:17:A4:77:00:1A
inet addr:10.151.44.38 Bcast:10.151.44.63 Mask:255.255.255.224
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:762881 errors:0 dropped:0 overruns:0 frame:0
TX packets:1259748 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:199990878 (190.7 Mb) TX bytes:176687528 (168.5 Mb)
eth6 Link encap:Ethernet HWaddr 44:1E:A1:54:E6:FB
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
eth7 Link encap:Ethernet HWaddr 44:1E:A1:54:E6:FF
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
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:323585 errors:0 dropped:0 overruns:0 frame:0
TX packets:323585 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:55495456 (52.9 Mb) TX bytes:55495456 (52.9 Mb)
路由表的内容如下:
mps-gmpc2:/export/home/mpcadmin # route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.228.65.16 * 255.255.255.240 U 0 0 0 eth3
10.228.65.0 * 255.255.255.240 U 0 0 0 eth2
10.151.44.32 * 255.255.255.224 U 0 0 0 eth5
10.221.32.0 10.228.65.17 255.255.255.128 UG 0 0 0 eth3
10.221.32.0 10.228.65.1 255.255.255.128 UG 0 0 0 eth2
10.221.32.128 10.228.65.17 255.255.255.128 UG 0 0 0 eth3
10.221.32.128 10.228.65.1 255.255.255.128 UG 0 0 0 eth2
10.225.64.0 10.228.65.17 255.255.255.128 UG 0 0 0 eth3
10.225.64.0 10.228.65.1 255.255.255.128 UG 0 0 0 eth2
10.225.64.128 10.228.65.17 255.255.255.128 UG 0 0 0 eth3
10.225.64.128 10.228.65.1 255.255.255.128 UG 0 0 0 eth2
192.168.1.0 * 255.255.255.0 U 0 0 0 eth4
192.168.0.0 * 255.255.255.0 U 0 0 0 bond0
link-local * 255.255.0.0 U 0 0 0 eth2
loopback * 255.0.0.0 U 0 0 0 lo
default 10.151.44.35 0.0.0.0 UG 0 0 0 eth5
当我从eth3接口ping 10.221.32.45时可以ping通.
ping 10.221.32.45 -I eth3
PING 10.221.32.45 (10.221.32.45) from 10.228.65.19 eth3: 56(84) bytes of data.
64 bytes from 10.221.32.45: icmp_seq=1 ttl=62 time=2.66 ms
64 bytes from 10.221.32.45: icmp_seq=2 ttl=62 time=0.310 ms
--- 10.221.32.45 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.310/1.488/2.667/1.179 ms
但当我从eth2接口ping 10.221.32.45时就ping不通了.
PING 10.221.32.45 (10.221.32.45) from 10.228.65.3 eth2: 56(84) bytes of data.
--- 10.221.32.45 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1001ms
用tcpdump抓包看, 两次ping过程中都完整地收到了"echo reply", 但就是从eth2 ping显示不通.
然后我把路由表改成如下:
mps-gmpc2:/export/home/mpcadmin # route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.228.65.16 * 255.255.255.240 U 0 0 0 eth3
10.228.65.0 * 255.255.255.240 U 0 0 0 eth2
10.151.44.32 * 255.255.255.224 U 0 0 0 eth5
10.221.32.0 10.228.65.1 255.255.255.128 UG 0 0 0 eth2
10.221.32.0 10.228.65.17 255.255.255.128 UG 0 0 0 eth3
10.221.32.128 10.228.65.1 255.255.255.128 UG 0 0 0 eth2
10.221.32.128 10.228.65.17 255.255.255.128 UG 0 0 0 eth3
10.225.64.0 10.228.65.1 255.255.255.128 UG 0 0 0 eth2
10.225.64.0 10.228.65.17 255.255.255.128 UG 0 0 0 eth3
10.225.64.128 10.228.65.1 255.255.255.128 UG 0 0 0 eth2
10.225.64.128 10.228.65.17 255.255.255.128 UG 0 0 0 eth3
192.168.1.0 * 255.255.255.0 U 0 0 0 eth4
192.168.0.0 * 255.255.255.0 U 0 0 0 bond0
link-local * 255.255.0.0 U 0 0 0 eth2
loopback * 255.0.0.0 U 0 0 0 lo
default 10.151.44.35 0.0.0.0 UG 0 0 0 eth5
这下结果刚好相反, 从eth2 ping能够成功, 而从eth3 ping显示失败.
从tcpdump看, 两次也都能完整地收到"echo reply".
感觉和路由的先后顺序相关, 但既然收到"echo reply", 为什么会显示失败呢?
请指教.
作者:
chenyx
时间:
2012-02-03 17:37
楼主的2和3网卡属于同一个网段,论坛讨论过,很容易出问题的
作者:
zhanshen8D
时间:
2012-02-03 17:48
多谢回复. 但是根据子网掩码, eth2和eth3应该处于不同子网的, 这会有问题吗?
不知是哪篇帖子讨论过这个问题?
谢谢.
作者:
chenyx
时间:
2012-02-03 19:17
10.221.32.0 10.228.65.1 255.255.255.128 UG 0 0 0 eth2
10.221.32.0 10.228.65.17 255.255.255.128 UG 0 0 0 eth3
复制代码
这样的情况下,路由匹配第一个就不会再往下匹配了
不知道你的网关的路由情况是怎么配置的路由
作者:
zhanshen8D
时间:
2012-02-03 19:28
从tcpdump看, 从eth3 ping的时候, 确实是发往10.228.65.17的.
最令人疑惑的是, echo reply也已经收到, 但ping命令却说ping failed.
谢谢.
作者:
chenyx
时间:
2012-02-03 19:37
很可能回包是从2口进来的,然后显示failed,你要是有条件同时坚持2,3口看看
作者:
zhanshen8D
时间:
2012-02-06 15:28
我看过的, 从MAC地址看, echo reply包都是回到发出echo request的端口上的.
真是太奇怪了.
欢迎光临 Chinaunix (http://bbs.chinaunix.net/)
Powered by Discuz! X3.2