Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I need to set static route in HP-UX. I edited /etc/rc.config.d/netconf file and added new entry for my route:

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]=""

But after rebooting HP-UX I don't have this route in routing table (checked with netstat -rn). What am I doing wrong?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

From the documented /etc/rc.config.d/netconf:

# 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.

I Don't have a HPUX that I can play with right now, but based on this documentation you could try:

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]=""

or

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]=""

or

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]=""
share|improve this answer
    
Thanks. ROUTE_DESTINATION[1]="net 10.105.2.0" works for me. I should be more careful. –  Smasher Aug 24 '11 at 12:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.