Chinaunix首页 | 论坛 | 博客
  • 博客访问: 15174956
  • 博文数量: 7460
  • 博客积分: 10434
  • 博客等级: 上将
  • 技术积分: 78178
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-02 22:54
文章分类

全部博文(7460)

文章存档

2011年(1)

2009年(669)

2008年(6790)

分类:

2008-05-11 22:09:55

这是以前的一个工作邮件记录。

问题描述:服务器的网口改了VLAN,造成重启后出现了双网关,公司内部有些网段的机器无法访问此机。为审慎起见,不建议使用odmdelete。

实验记录及结论:刚刚在myaix上实验了一下,chdev可行。

myaix#/> odmget CuAt |grep -p inet0
CuAt:
        name = "inet0"
        attribute = "hostname"
        value = "myaix"
        type = "R"
        generic = "DU"
        rep = "s"
        nls_index = 24

CuAt:
        name = "inet0"
        attribute = "route"
        value = "net,-hopcount,0,,0,9.181.168.254"
        type = "R"
        generic = "DU"
        rep = "s"
        nls_index = 0

myaix#/> chdev -l inet0 -a route=net,,0,9.181.183.254
inet0 changed
myaix#/> odmget CuAt |grep -p inet0
CuAt:
        name = "inet0"
        attribute = "hostname"
        value = "myaix"
        type = "R"
        generic = "DU"
        rep = "s"
        nls_index = 24

CuAt:
        name = "inet0"
        attribute = "route"
        value = "net,-hopcount,0,,0,9.181.168.254"
        type = "R"
        generic = "DU"
        rep = "s"
        nls_index = 0

CuAt:
        name = "inet0"
        attribute = "route"
        value = "net,,0,9.181.183.254"
        type = "R"
        generic = "DU"
        rep = "s"
        nls_index = 0

myaix#/> lsatrr -El inet0
ksh: lsatrr:  not found.
myaix#/> lsattr -El inet0
authm         65536                            Authentication Methods              True
bootup_option no                               Use BSD-style Network Configuration True
gateway                                        Gateway                             True
hostname      myaix                          Host Name                           True
rout6                                          IPv6 Route                          True
route         net,,0,9.181.183.254             Route                               True
route         net,-hopcount,0,,0,9.181.168.254 Route                               True
myaix#/> chdev -l inet0 -a delroute=net,,0,9.181.183.254
inet0 changed
myaix#/> r lsatt
lsattr -El inet0
authm         65536                            Authentication Methods              True
bootup_option no                               Use BSD-style Network Configuration True
gateway                                        Gateway                             True
hostname      myaix                          Host Name                           True
rout6                                          IPv6 Route                          True
route         net,-hopcount,0,,0,9.181.168.254 Route                               True
myaix#/> chdev -l inet0 -a route=net,-hopcount,0,,0,9.181.183.254
inet0 changed
myaix#/> r lsattr
lsattr -El inet0
authm         65536                            Authentication Methods              True
bootup_option no                               Use BSD-style Network Configuration True
gateway                                        Gateway                             True
hostname      myaix                          Host Name                           True
rout6                                          IPv6 Route                          True
route         net,-hopcount,0,,0,9.181.183.254 Route                               True
route         net,-hopcount,0,,0,9.181.168.254 Route                               True
myaix#/> odmget CuAt |grep -p inet0
CuAt:
        name = "inet0"
        attribute = "hostname"
        value = "myaix"
        type = "R"
        generic = "DU"
        rep = "s"
        nls_index = 24

CuAt:
        name = "inet0"
        attribute = "route"
        value = "net,-hopcount,0,,0,9.181.168.254"
        type = "R"
        generic = "DU"
        rep = "s"
        nls_index = 0

CuAt:
        name = "inet0"
        attribute = "route"
        value = "net,-hopcount,0,,0,9.181.183.254"
        type = "R"
        generic = "DU"
        rep = "s"
        nls_index = 0

myaix#/> chdev -l inet0 -a delroute=net,,0,9.181.183.254
inet0 changed
myaix#/> r odm
odmget CuAt |grep -p inet0
CuAt:
        name = "inet0"
        attribute = "hostname"
        value = "myaix"
        type = "R"
        generic = "DU"
        rep = "s"
        nls_index = 24

CuAt:
        name = "inet0"
        attribute = "route"
        value = "net,-hopcount,0,,0,9.181.168.254"
        type = "R"
        generic = "DU"
        rep = "s"
        nls_index = 0

myaix#/> netstat -nr
Routing tables
Destination      Gateway           Flags   Refs     Use  If   PMTU Exp Groups

Route Tree for Protocol Family 2 (Internet):
default          9.181.168.254     UGc       0        0  en0     -   -      -  
9.181.168.0      9.181.168.85      UHSb      0        0  en0     -   -      -   =>
9.181.168/24     9.181.168.85      U        16     3979  en0     -   -      -  
9.181.168.85     127.0.0.1         UGHS      0     2033  lo0     -   -      -  
9.181.168.255    9.181.168.85      UHSb      0        0  en0     -   -      -  
127/8            127.0.0.1         U         0       30  lo0     -   -      -  
192.168.1.0      192.168.1.1       UHSb      0        0  en1     -   -      -   =>
192.168.1/24     192.168.1.1       U         0     1914  en1     -   -      -  
192.168.1.1      127.0.0.1         UGHS      0       12  lo0     -   -      -  
192.168.1.255    192.168.1.1       UHSb      0        0  en1     -   -      -  
192.168.68.0     192.168.68.3      UHSb      0        0  en0     -   -      -   =>
192.168.68/24    192.168.68.3      U         0        0  en0     -   -      -  
192.168.68.3     127.0.0.1         UGHS      0        0  lo0     -   -      -  
192.168.68.255   192.168.68.3      UHSb      0        0  en0     -   -      -  

Route Tree for Protocol Family 24 (Internet v6):
::1              ::1               UH        0        0  lo0 16896   -      -  
myaix#/> chdev -l inet0 -a route=net,-hopcount,0,,0,9.181.183.254
inet0 changed
myaix#/> netstat -nr
Routing tables
Destination      Gateway           Flags   Refs     Use  If   PMTU Exp Groups

Route Tree for Protocol Family 2 (Internet):
default          9.181.168.254     UGc       0        0  en0     -   -      -   =>
default          9.181.183.254     UGc       0        0  en0     -   -      -  
9.181.168.0      9.181.168.85      UHSb      0        0  en0     -   -      -   =>
9.181.168/24     9.181.168.85      U        17     3979  en0     -   -      -  
9.181.168.85     127.0.0.1         UGHS      0     2033  lo0     -   -      -  
9.181.168.255    9.181.168.85      UHSb      0        0  en0     -   -      -  
127/8            127.0.0.1         U         0       30  lo0     -   -      -  
192.168.1.0      192.168.1.1       UHSb      0        0  en1     -   -      -   =>
192.168.1/24     192.168.1.1       U         0     1914  en1     -   -      -  
192.168.1.1      127.0.0.1         UGHS      0       12  lo0     -   -      -  
192.168.1.255    192.168.1.1       UHSb      0        0  en1     -   -      -  
192.168.68.0     192.168.68.3      UHSb      0        0  en0     -   -      -   =>
192.168.68/24    192.168.68.3      U         0        0  en0     -   -      -  
192.168.68.3     127.0.0.1         UGHS      0        0  lo0     -   -      -  
192.168.68.255   192.168.68.3      UHSb      0        0  en0     -   -      -  

Route Tree for Protocol Family 24 (Internet v6):
::1              ::1               UH        0        0  lo0 16896   -      -  
myaix#/> r odm
odmget CuAt |grep -p inet0
CuAt:
        name = "inet0"
        attribute = "hostname"
        value = "myaix"
        type = "R"
        generic = "DU"
        rep = "s"
        nls_index = 24

CuAt:
        name = "inet0"
        attribute = "route"
        value = "net,-hopcount,0,,0,9.181.168.254"
        type = "R"
        generic = "DU"
        rep = "s"
        nls_index = 0

CuAt:
        name = "inet0"
        attribute = "route"
        value = "net,-hopcount,0,,0,9.181.183.254"
        type = "R"
        generic = "DU"
        rep = "s"
        nls_index = 0

myaix#/> r lsattr
lsattr -El inet0
authm         65536                            Authentication Methods              True
bootup_option no                               Use BSD-style Network Configuration True
gateway                                        Gateway                             True
hostname      myaix                          Host Name                           True
rout6                                          IPv6 Route                          True
route         net,-hopcount,0,,0,9.181.183.254 Route                               True
route         net,-hopcount,0,,0,9.181.168.254 Route                               True
myaix#/> chdev -l inet0 -a delroute=net,,0,9.181.183.254
inet0 changed
myaix#/> netstat -nr
Routing tables
Destination      Gateway           Flags   Refs     Use  If   PMTU Exp Groups

Route Tree for Protocol Family 2 (Internet):
default          9.181.168.254     UGc       0        0  en0     -   -      -  
9.181.168.0      9.181.168.85      UHSb      0        0  en0     -   -      -   =>
9.181.168/24     9.181.168.85      U        17     3979  en0     -   -      -  
9.181.168.85     127.0.0.1         UGHS      0     2033  lo0     -   -      -  
9.181.168.255    9.181.168.85      UHSb      0        0  en0     -   -      -  
127/8            127.0.0.1         U         0       30  lo0     -   -      -  
192.168.1.0      192.168.1.1       UHSb      0        0  en1     -   -      -   =>
192.168.1/24     192.168.1.1       U         0     1914  en1     -   -      -  
192.168.1.1      127.0.0.1         UGHS      0       12  lo0     -   -      -  
192.168.1.255    192.168.1.1       UHSb      0        0  en1     -   -      -  
192.168.68.0     192.168.68.3      UHSb      0        0  en0     -   -      -   =>
192.168.68/24    192.168.68.3      U         0        0  en0     -   -      -  
192.168.68.3     127.0.0.1         UGHS      0        0  lo0     -   -      -  
192.168.68.255   192.168.68.3      UHSb      0        0  en0     -   -      -  

Route Tree for Protocol Family 24 (Internet v6):
::1              ::1               UH        0        0  lo0 16896   -      -  
myaix#/> chdev -l inet0 -a delroute=net,,0,9.181.183.254 (此处说明,多次执行chdev不会造成负面影响)
Method error (/usr/lib/methods/chginet):
        0514-009 Cannot delete an object from the device
                 configuration database.
0821-216 chginet: Cannot delete route (net,0,9.181.183.254) from CuAt.

myaix#/>

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