aix 如何设置系统网关

aix 如何设置系统网关,第1张

摘抄自smallmiao的帖子,看着比较靠谱,你试试

查看当前的默认网关

netstat -rn

会看到有多条的default.

如果用route命令(或smitty route)去删除,下次重启后,又会回来;所以要从ODM里删除。

2.查看ODM信息

# lsattr -El inet0

authm 65536 Authentication Methods True

bootup_option no Use BSD-style Network Configuration True

gateway Gateway True

hostname appserv1 Host Name True

rout6 IPv6 Route True

route net,-hopcount,0,,0,192.111.10.251 Route True

route net,-hopcount,0,,0,192.110.9.63 Route True

route net,-hopcount,0,,0,192.111.11.251 Route True

route net,-hopcount,0,,0,192.110.9.251 Route True

# odmget -q "name=inet0" CuAt

CuAt:

name = "inet0"

attribute = "hostname"

value = "host1"

type = "R"

generic = "DU"

rep = "s"

nls_index = 24

CuAt:

name = "inet0"

attribute = "route"

value = "net,-hopcount,0,,0,192.111.11.251"

type = "R"

generic = "DU"

rep = "s"

nls_index = 0

CuAt:

name = "inet0"

attribute = "route"

value = "net,-hopcount,0,,0,192.111.10.251"

type = "R"

generic = "DU"

rep = "s"

nls_index = 0

CuAt:

name = "inet0"

attribute = "route"

value = "net,-hopcount,0,,0,192.110.9.251"

type = "R"

generic = "DU"

rep = "s"

nls_index = 0

CuAt:

name = "inet0"

attribute = "route"

value = "net,-hopcount,0,,0,192.110.9.63"

type = "R"

generic = "DU"

rep = "s"

nls_index = 0

其中正确的应是192.110.9.63,其它都是多余的。

3.逐条删除没用的默认路由

# chdev -l inet0 -a delroute="net,-hopcount,0,,0,192.111.11.251"

Method error (/usr/lib/methods/chginet):

0514-068 Cause not known.

0821-279 writing to routing socket: The process does not exist.

0821-103 : The command /usr/sbin/route delete -net -hopcount 0 0 192.111.11.251 failed.

###删除其它(略)###

出现上面的报错信息,应该是AIX5.3的“误报”(至少在5300-08-01上是这样,AIX6不会)可以不用理会。

4.确认生效

# lsattr -El inet0

authm 65536 Authentication Methods True

bootup_option no Use BSD-style Network Configuration True

gateway Gateway True

hostname appserv1 Host Name True

rout6 IPv6 Route True

route net,-hopcount,0,,0,192.110.9.63 Route True

# odmget -q "name=inet0" CuAt

CuAt:

name = "inet0"

attribute = "hostname"

value = "appserv1"

type = "R"

generic = "DU"

rep = "s"

nls_index = 24

CuAt:

name = "inet0"

attribute = "route"

value = "net,-hopcount,0,,0,192.110.9.63"

type = "R"

generic = "DU"

rep = "s"

nls_index = 0

# netstat -rn

Routing tables

Destination Gateway Flags Refs Use If Exp Groups

Route Tree for Protocol Family 2 (Internet):

default 192.110.9.63 UG 1 286227 en0 - -

127/8 127.0.0.1 U 9 337 lo0 - -

192.110.9.0 192.110.9.21 UHSb 0 0 en0 - - =>

192.110.9/24 192.110.9.21 U 22 1151844 en0 - -

192.110.9.21 127.0.0.1 UGHS 2 5510 lo0 - -

192.110.9.255 192.110.9.21 UHSb 0 4 en0 - -

Route Tree for Protocol Family 24 (Internet v6):

1,临时路由设置route

add

192.100.201.7

192.100.13.7(主机路由)route

add

-net

192.100.201.0

192.100.13.7(网段路由)route

add

0

192.100.13.7(默认网关)2,永久路由设置a,smitty

route添加路由b,修改/etc/rc.net文件

在#

/usr/sbin/route

add

192.9.201.0

gateway后加入上面的临时路由行(示例如下):route

add

default

192.168.3.254;


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/bake/11220498.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-14
下一篇 2023-05-14

发表评论

登录后才能评论

评论列表(0条)

保存