首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >HP-UX中的静态路由

HP-UX中的静态路由
EN

Unix & Linux用户
提问于 2011-08-17 12:41:14
回答 1查看 4.4K关注 0票数 2

我需要在HP-UX中设置静态路径。我编辑了/etc/rc.config.d/netconf文件,并为我的路由添加了新条目:

代码语言:javascript
复制
ROUTE_DESTINATION[1]="10.105.2.0"
ROUTE_MASK[1]="255.255.255.0"
ROUTE_GATEWAY[1]="192.1.1.219"
ROUTE_COUNT[1]="1"
ROUTE_ARGS[1]=""

但是在重新启动HP-UX之后,我在路由表中没有这个路由(使用netstat -rn检查)。我做错了什么?

EN

回答 1

Unix & Linux用户

回答已采纳

发布于 2011-08-17 16:48:59

来自文档化的/etc/rc.config.d/netconf

代码语言:javascript
复制
# ROUTE_DESTINATION:  Destination host or network IP address in decimal-dot
#                     notation, or hostname (in /etc/hosts) or network name
#                     (in /etc/networks), preceded by the word "host" or "net";
#                     or simply the word "default".
#
# ROUTE_MASK:         Subnetwork mask in decimal-dot notation, or C language
#                     hexadecimal notation.  This is an optional field.
#                     An IP address/subnet mask pair uniquely identifies
#                     a subnet to be reached. If a subnet mask is not given,
#                     then the system will assign the longest subnet mask
#                     of the configured network interfaces to this route.
#                     If there is no matching subnet mask, then the system
#                     will assign the default network mask as the route's
#                     subnet mask.

我现在没有可以使用的HPUX,但是根据这些文档,您可以尝试:

代码语言:javascript
复制
ROUTE_DESTINATION[1]="net 10.105.2.0"
ROUTE_MASK[1]=""
ROUTE_GATEWAY[1]="192.1.1.219"
ROUTE_COUNT[1]="1"
ROUTE_ARGS[1]=""

代码语言:javascript
复制
ROUTE_DESTINATION[1]="net 10.105.2.0"
ROUTE_MASK[1]="255.255.255.0"
ROUTE_GATEWAY[1]="192.1.1.219"
ROUTE_COUNT[1]="1"
ROUTE_ARGS[1]=""

代码语言:javascript
复制
ROUTE_DESTINATION[1]="10.105.2.0/24"
ROUTE_MASK[1]=""
ROUTE_GATEWAY[1]="192.1.1.219"
ROUTE_COUNT[1]="1"
ROUTE_ARGS[1]=""
票数 1
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/18905

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档