AIX刪除多餘的默認網關

操做系統:AIX 5.3.8bash

案例分析:

   在AIX系統上有多個默認網關。app

經過smit和route delete刪除,系統在重啓後又回到原來的狀態!spa

解決方案:

一、查看當前默認網關

[root@aix230:/]# netstat -nr操作系統

Routing tables
Destination        Gateway           Flags   Refs     Use  If   Exp  Groups
Route tree for Protocol Family 2 (Internet):
default            192.168.8.1       UG        0         0 en0      -      -   
default            10.10.10.1            UG        0         0 en1      -      - 
default            10.10.10.1          UG        0         0 en1      -      - 
10.10.10.0         10.10.10.230      UHSb      0         0 en1      -      -   =>
10.10.10/24        10.10.10.230      U         0         1 en1      -      -   
10.10.10.230       127.0.0.1         UGHS      0         1 lo0      -      -   
10.10.10.255       10.10.10.230      UHSb      0         4 en1      -      -   
127/8              127.0.0.1         U        13       247 lo0      -      -   
192.168.8.0        192.168.8.230     UHSb      0         0 en0      -      -   =>
192.168.8/24       192.168.8.230     U         4        42 en0      -      -   
192.168.8.230      127.0.0.1         UGHS      0         1 lo0      -      -   
192.168.8.255      192.168.8.230     UHSb      0         4 en0      -      -   
Route tree for Protocol Family 24 (Internet v6):
::1                ::1               UH        0         0 lo0      -      -

二、查看ODM信息

root@rd_app2:/># lsattr -El inet0code

authm         65536                         Authentication Methods              True
bootup_option no                            Use BSD-style Network Configuration True
gateway                                     Gateway                             True
hostname      rd_app2                       Host Name                           True
rout6                                       IPv6 Route                          True
route         net,-hopcount,0,,0,10.3.1.254 Route                               True

root@rd_app2:/># odmget -q "name=inet0" CuAt 路由

CuAt:
        name = "inet0"
        attribute = "hostname"
        value = "aix230"
        type = "R"
        generic = "DU"
        rep = "s"
        nls_index = 24
CuAt:
        name = "inet0"
        attribute = "route"
        value = "net,-hopcount,0,,0,10.10.10.1"
        type = "R"
        generic = "DU"
        rep = "s"
        nls_index = 0
CuAt:
        name = "inet0"
        attribute = "route"
        value = "net,-hopcount,0,,0,192.168.8.1"
        type = "R"
        generic = "DU"
        rep = "s"
        nls_index = 0
CuAt:
        name = "inet0"
        attribute = "route"
        value = "net,-hopcount,2,,0,10.10.10.1"
        type = "R"
        generic = "DU"
        rep = "s"
        nls_index = 0

三、逐條刪除沒用的默認路由

[root@aix230:/]# chdev -l inet0 -a delroute="net,-hopcount,2,,0,10.10.10.1"get

inet0 changed

4.確認生效

[root@aix230:/]# odmget -q "name=inet0" CuAtit

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

[root@aix230:/]# netstat -nrio

Routing tables
Destination        Gateway           Flags   Refs     Use  If   Exp  Groups
Route tree for Protocol Family 2 (Internet):
default            192.168.8.1       UG        0         0 en0      -      -   
10.10.10.0         10.10.10.230      UHSb      0         0 en1      -      -   =>
10.10.10/24        10.10.10.230      U         0         1 en1      -      -   
10.10.10.230       127.0.0.1         UGHS      0         1 lo0      -      -   
10.10.10.255       10.10.10.230      UHSb      0         4 en1      -      -   
127/8              127.0.0.1         U        13       247 lo0      -      -   
192.168.8.0        192.168.8.230     UHSb      0         0 en0      -      -   =>
192.168.8/24       192.168.8.230     U         4        42 en0      -      -   
192.168.8.230      127.0.0.1         UGHS      0         1 lo0      -      -   
192.168.8.255      192.168.8.230     UHSb      0         4 en0      -      -   
Route tree for Protocol Family 24 (Internet v6):
::1                ::1               UH        0         0 lo0      -      -
相關文章
相關標籤/搜索