1849824 Members
1882 Online
104044 Solutions
New Discussion

Re: route add

 
SOLVED
Go to solution
Norman_21
Honored Contributor

route add

I want to avoid using the route add command everytime I boot the system. what configuration files I should configure to enable the gateway without having to issue the route add command:
i.e) route add 0.0.0.0 192.168.x.x 1 where 192.168.x.x is the gateway router.
appreciate your support...
"Attitudes are contagious, is yours worth catching"/ My first point was given by SEP on January 31, 2003
8 REPLIES 8
someone_4
Honored Contributor

Re: route add

hi
what you need to modify is
/etc/rc.config.d/netconf

the netconf file is the file that contatins the routes that will be added upon reboot.


~ Richard
Craig Rants
Honored Contributor

Re: route add

The file you want is /etc/rc.config.d/netconf

It will look like this:
HOSTNAME="hostname"
OPERATING_SYSTEM=HP-UX
LOOPBACK_ADDRESS=127.0.0.1
GATED=0
GATED_ARGS=""
RDPD=0
RARP=0
ROUTE_GATEWAY[0]=10.1.1.1
ROUTE_COUNT[0]=1
ROUTE_DESTINATION[0]=default
IP_ADDRESS[0]=10.1.1.2
SUBNET_MASK[0]=255.255.252.0
INTERFACE_NAME[0]=lan0
BROADCAST_ADDRESS[0]=10.1.1.255
INTERFACE_STATE[0]=up
DHCP_ENABLE[0]=0

You want to set the route gateway, count, and default for the specific items your question addresses.

GL,
C
"In theory, there is no difference between theory and practice. But, in practice, there is. " Jan L.A. van de Snepscheut
Patrick Wallek
Honored Contributor

Re: route add

You need to look at /etc/rc.config.d/netconf file to have your default route info done when you boot the system.
Jeff Schussele
Honored Contributor
Solution

Re: route add

Hi Abdulatef,

You'll add it to the /etc/rc.config.d/netconf file as follows:

ROUTE_DESTINATION[1]="0.0.0.0"
ROUTE_MASK[1]=""
ROUTE_GATEWAY[1]="192.168.x.x"
ROUTE_COUNT[1]="1"

Note that the index # in brackets MUST be unique from all other route statements in the file & consistent for THIS route. If you need a subnet mask other than default - 255.255.255.0 - be sure to put that in the ROUTE_MASK field.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Norman_21
Honored Contributor

Re: route add

Thanks guys, perhaps Jeff hit the target, for I already know the file name but I was just not sure about the fields that has to be modified.
Once again, appreciate your quick reply.
"Attitudes are contagious, is yours worth catching"/ My first point was given by SEP on January 31, 2003
Norman_21
Honored Contributor

Re: route add

Hi guys,

I've modified the netconf with
the destination IP and gateway
could anyone tell me how can I
find out that is has been enabled after I reboot.

"Attitudes are contagious, is yours worth catching"/ My first point was given by SEP on January 31, 2003
Jeff Schussele
Honored Contributor

Re: route add

Hi (again) Abdulatef,

Just run
netstat -rn
You should see the route in the output.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Norman_21
Honored Contributor

Re: route add

Closed...
"Attitudes are contagious, is yours worth catching"/ My first point was given by SEP on January 31, 2003