免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3454 | 回复: 6
打印 上一主题 下一主题

[网络管理] 关于 SUSE linux 11 的路由问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-02-03 17:25 |只看该作者 |倒序浏览
最近碰到一个很怪的问题,不知哪位碰到过.
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", 为什么会显示失败呢?
请指教.

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
2 [报告]
发表于 2012-02-03 17:37 |只看该作者
楼主的2和3网卡属于同一个网段,论坛讨论过,很容易出问题的

论坛徽章:
0
3 [报告]
发表于 2012-02-03 17:48 |只看该作者
多谢回复. 但是根据子网掩码, eth2和eth3应该处于不同子网的, 这会有问题吗?
不知是哪篇帖子讨论过这个问题?
谢谢.

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
4 [报告]
发表于 2012-02-03 19:17 |只看该作者
  1. 10.221.32.0     10.228.65.1     255.255.255.128 UG    0      0        0 eth2
  2. 10.221.32.0     10.228.65.17    255.255.255.128 UG    0      0        0 eth3
复制代码
这样的情况下,路由匹配第一个就不会再往下匹配了
不知道你的网关的路由情况是怎么配置的路由

论坛徽章:
0
5 [报告]
发表于 2012-02-03 19:28 |只看该作者
从tcpdump看, 从eth3 ping的时候, 确实是发往10.228.65.17的.
最令人疑惑的是, echo reply也已经收到, 但ping命令却说ping failed.
谢谢.

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
6 [报告]
发表于 2012-02-03 19:37 |只看该作者
很可能回包是从2口进来的,然后显示failed,你要是有条件同时坚持2,3口看看

论坛徽章:
0
7 [报告]
发表于 2012-02-06 15:28 |只看该作者
我看过的, 从MAC地址看, echo reply包都是回到发出echo request的端口上的.
真是太奇怪了.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP