Chinaunix首页 | 论坛 | 博客
  • 博客访问: 24853095
  • 博文数量: 271
  • 博客积分: 10025
  • 博客等级: 上将
  • 技术积分: 3358
  • 用 户 组: 普通用户
  • 注册时间: 2007-11-12 15:28
文章分类

全部博文(271)

文章存档

2010年(71)

2009年(164)

2008年(36)

我的朋友

分类:

2009-07-26 16:25:13

系统改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中的多余默认路由都被删除

阅读(1222) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~