Operating System - HP-UX
1835307 Members
3067 Online
110078 Solutions
New Discussion

Re: help with 'route' command

 
SOLVED
Go to solution
Shar Hunter
Frequent Advisor

help with 'route' command

Hello all,

I have a branch that access's our server via a vpn. Well the route has to be entered on the unix server.

I added the route with the route command:

route add 192.0.3.0 192.0.1.111 1

OK, that works fine. Until I re-boot the server. Then I lose that route? And have to manually enter it again.

I check that with the netstat command. netstat -rn

How do I set it up so the route command stays in the system even after a re-boot?

I have added route before that stayed in, but forgot how I did it. Plus I have posted a question about this before, and I do not know how to 'search' this forum, or find an old post?

Troy
I don't think I'm in Kansas anymore.
8 REPLIES 8
PIYUSH D. PATEL
Honored Contributor

Re: help with 'route' command

Hi,

Edit /etc/netconf file and put your entries in the file.

Or else go to SAM---Netwworking---Netwrok Interface cards - Gateway and then add the IP address.


# set_parms addln_netwrk

It will ask you for you default gateway and you can enter the parameters.


Piyush
Craig Rants
Honored Contributor
Solution

Re: help with 'route' command

Add that into the /etc/rc.config.d/netconf file
just add all the new info into a new section like this, make sure the [1] is unique and there you go..

GL,
C

ROUTE_DESTINATION[1]=""
ROUTE_MASK[1]=""
ROUTE_GATEWAY[1]=""
ROUTE_COUNT[1]=""
ROUTE_ARGS[1]=""
"In theory, there is no difference between theory and practice. But, in practice, there is. " Jan L.A. van de Snepscheut
Uday_S_Ankolekar
Honored Contributor

Re: help with 'route' command

Hi,

Anything you
want to have permanent must be hard coded in the /etc/rc.config.d/netconf
file.
Remember that you cannot back up the netconf file in the /etc/rc.config.d
directory. If you want to save a backup before modifying, move the backup
(netconf.old, .save, etc) to a different directory.

ROUTE_DESTINATION[0]=default
ROUTE_MASK[0]=""
ROUTE_GATEWAY[0]=15.32.7.1
ROUTE_COUNT[0]=1

ROUTE_DESTINATION[1]="net" 15.43.9
ROUTE_MASK[1]=""
ROUTE_GATEWAY[1]=15.32.7.1
ROUTE_COUNT[1]=1

Goodluck,
-USA..
Good Luck..
A. Clay Stephenson
Acclaimed Contributor

Re: help with 'route' command

look in the file /etc/rc.config.d/netconf. You will see a section that has variables like
ROUTE_DESTINATION[0],ROUTE_MASK[0], ...
you simply create another set of parallel array entries with the next higher subscript value.
If it ain't broke, I can fix that.
MANOJ SRIVASTAVA
Honored Contributor

Re: help with 'route' command

Hi Troy


You need to edit /etc/rc.config.d/netconf file to make it permanent , after editinfg it you will ahve to stop and star the network services .

you may also like to look at this documnet :

http://support1.itrc.hp.com/service/cki/docDisplay.do?docId=200000049791567


Manoj Srivastava
PIYUSH D. PATEL
Honored Contributor

Re: help with 'route' command

Hi,

Sorry /etc/rc.config.d/netconf file

# set_parms addl_network

Typing mistakes !!!!

Piyush


S.K. Chan
Honored Contributor

Re: help with 'route' command

The file you need to edit is /etc/rc.config/netconf and multiple route definition have to be entered in such manner ..

ROUTE_DESTINATION[0]=default
ROUTE_GATEWAY[0]=x.x.x.x
ROUTE_ARGS[0]=
ROUTE_MASK[0]=
ROUTE_COUNT[0]=1

ROUTE_DESTINATION[1]="net y.y.y"
ROUTE_GATEWAY[1]=y.y.y.y
ROUTE_ARGS[1]=
ROUTE_MASK[1]=
ROUTE_COUNT[1]=1

......

Just plug in the appropriate values and to test.. (but make sure the system is not being access while you do this)..

# route -f
==> flush routing table
# /sbin/init.d/net start
==> re-read netconf
# netstat -rn
==> check it.


Shar Hunter
Frequent Advisor

Re: help with 'route' command

OK, thanks. I got it now.

I appreciate the reminder that I have to stop, then start the service to use the edited netconf file.

The servier is live, so after the next re-boot it will use the new netconf file. I did this before but did not recall what file I had to edit.

Appreciate the help.

Troy
I don't think I'm in Kansas anymore.