aix重复路由导致丢包问题解决
# netstat -rn
Routing tables
Destination Gateway Flags Refs Use If Exp Groups
Route Tree for Protocol Family 2 (Internet):
default 192.168.128.254 UG 0 980 en1 - - =>
default *.*.2.254 UGS 3 160261 en0 - -
*.*.2.0 *.*.2.21 UHSb 0 0 en0 - - =>
*.*.2.0 *.*.2.23 UHSb 0 0 en6 - - =>
*.*.2/24 *.*.2.21 U 2 6040225 en0 - - =>
*.*.2/24 *.*.2.23 U 0 5964988 en6 - -
*.*.2.21 127.0.0.1 UGHS 2 2965333 lo0 - -
*.*.2.23 127.0.0.1 UGHS 2 56987242 lo0 - -
*.*.2.255 *.*.2.21 UHSb 0 4 en0 - - =>
*.*.2.255 *.*.2.23 UHSb 0 0 en6 - -
127/8 127.0.0.1 U 5 40545 lo0 - -
172.16.1.0 172.16.1.10 UHSb 0 0 en0 - - =>
172.16.1/24 172.16.1.10 U 0 51979 en0 - -
172.16.1.10 127.0.0.1 UGHS 0 7254 lo0 - -
172.16.1.255 172.16.1.10 UHSb 0 28 en0 - -
172.16.2.0 172.16.2.10 UHSb 0 0 en6 - - =>
172.16.2/24 172.16.2.10 U 2 49507 en6 - -
172.16.2.10 127.0.0.1 UGHS 1 15813 lo0 - -
172.16.2.255 172.16.2.10 UHSb 2 169 en6 - -
192.168.128.0 192.168.128.20 UHSb 0 0 en1 - - =>
192.168.128/24 192.168.128.20 U 0 3075 en1 - -
192.168.128.20 127.0.0.1 UGHS 0 67 lo0 - -
192.168.128.255 192.168.128.20 UHSb 0 4 en1 - -
# route delete -if en1 default 192.168.128.254
192.168.128.254 net default: gateway 192.168.128.254
下面再ping就ok了
参考下面的文档:
如何删除重复的默认路由?
问题描述:
客户经常碰到产生两条默认路由,并且两条路由的IP地址完全一样只有最后的接口不一样。下文将介绍如何删除多余的默认路由。
netstat –rn
Routing tables
Destination Gateway Flags Refs Use If PMTU Exp Groups
Route Tree for Protocol Family 2 (Internet):
default 172.16.18.1 UGc 0 0 en2 - - - =>
default 172.16.18.1 UGc 0 0 en1 - - -
9/8 172.16.18.1 UGc 0 0 en2 - - -
9.181.49.76 172.16.18.1 UGHW 1 772 en2 1500 - -
9.181.49.136 172.16.18.1 UGHW 1 272 en2 1500 - -
9.181.49.146 172.16.18.1 UGHW 1 49 en2 1500 - -
9.181.50.88 172.16.18.1 UGHW 2 489 en2 1500 - -
9.181.50.89 172.16.18.1 UGHW 3 59144 en2 1500 - -
9.181.50.92 172.16.18.1 UGHW 1 234 en2 1500 - -
.......
HA_node2:/etc>lsattr -El inet0
authm 65536 Authentication Methods True
bootup_option no Use BSD-style Network Configuration True
gateway Gateway True
hostname HA_node2 Host Name True
rout6 IPv6 Route True
route net,-hopcount,0,,-if,en1,,0,172.16.18.1 Route True
route net,-hopcount,0,,-if,en2,,0,172.16.18.1 Route True
上面重复的两条默认路由除了可以通过Flush Route Table
的方法删除之外,还可以用如下方法删除。
1.通过route delete删除kernel 中的route 信息:
HA_node2:/>route delete -if en1 default 172.16.18.1
172.16.18.1 net default: gateway 172.16.18.1
HA_node2:/>netstat -rn
Routing tables
Destination Gateway Flags Refs Use If PMTU Exp Groups
Route Tree for Protocol Family 2 (Internet):
default 172.16.18.1 UGc 0 0 en2 - - -
9/8 172.16.18.1 UGc 0 0 en2 - - -
9.181.49.76 172.16.18.1 UGHW 1 772 en2 1500 - -
9.181.49.136 172.16.18.1 UGHW 1 272 en2 1500 - -
9.181.49.146 172.16.18.1 UGHW 1 49 en2 1500 - -
9.181.50.88 172.16.18.1 UGHW 2 489 en2 1500 - -
9.181.50.89 172.16.18.1 UGHW 3 59144 en2 1500 - -
9.181.50.92 172.16.18.1 UGHW 1 234 en2 1500 - -
……
从上的结果可以看出,kernel中的重复default route已经被删除。
但是从下面的结果可以看到,odm中的default route仍然存在。
HA_node2:/etc>lsattr -El inet0
authm 65536 Authentication Methods True
bootup_option no Use BSD-style Network Configuration True
gateway Gateway True
hostname HA_node2 Host Name True
rout6 IPv6 Route True
route net,-hopcount,0,,-if,en1,,0,172.16.18.1 Route True
route net,-hopcount,0,,-if,en2,,0,172.16.18.1 Route True
2.通过chdev删除odm中的route信息:
HA_node2:/>chdev -l inet0 -a delroute=net,-hopcount,0,,-if,en1,,0,172.16.18.1
inet0 changed
HA_node2:/etc>lsattr -El inet0
authm 65536 Authentication Methods True
bootup_option no Use BSD-style Network Configuration True
gateway Gateway True
hostname HA_node2 Host Name True
rout6 IPv6 Route True
route net,-hopcount,0,,-if,en2,,0,172.16.18.1 Route True
HA_node2:/>netstat –rn
Routing tables
Destination Gateway Flags Refs Use If PMTU Exp Groups
Route Tree for Protocol Family 2 (Internet):
default 172.16.18.1 UGc 0 0 en2 - - -
9/8 172.16.18.1 UGc 0 0 en2 - - -
9.181.49.76 172.16.18.1 UGHW 1 772 en2 1500 - -
9.181.49.136 172.16.18.1 UGHW 1 272 en2 1500 - -
9.181.49.146 172.16.18.1 UGHW 1 49 en2 1500 - -
9.181.50.88 172.16.18.1 UGHW 2 489 en2 1500 - -
9.181.50.89 172.16.18.1 UGHW 3 59144 en2 1500 - -
9.181.50.92 172.16.18.1 UGHW 1 234 en2 1500 - -
......
执行chdev 删除默认路由之后,odm库和kernel中的多余默认路由都被删除。