Operating System - HP-UX
1834022 Members
2400 Online
110063 Solutions
New Discussion

Re: Trying to Add a Route

 
SOLVED
Go to solution
KPS
Super Advisor

Trying to Add a Route

Hi,

I've been just asked to add a route to my system.

I've been given an
- IP to a Router
- A new Subne
- A Gateway for the route


I've made my edits in the /etc/rc.config.d/netconf file, but I'm unfamiliar with what I need to do at the command line for syntax to add the above route.

Can someone help?
7 REPLIES 7
Sanjay_6
Honored Contributor

Re: Trying to Add a Route

Hi Ken,

check this link from itrc,

http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000074886373

The itrc doc id is HONCIKKBRC00000016.

Hope this helps.

Regds
John Dvorchak
Honored Contributor
Solution

Re: Trying to Add a Route

Adding a route on the fly you would use the route command. Lets say that they that your IP address is 192.168.0.10 and your new router is 192.168.0.25 then you would:

> route add 192.168.0.25 1

Man route for all of the options and don't forget the trailing 1 on the command I listed above. That means that the router is NOT local or on this maching but a router on the LAN. If you must also use the netmask they gave you then use:

> route add 192.168.0.25 netmask 255.255.xxx.xxx 1

Still not forgeting the trailing 1 .

Good luck,
John
If it has wheels or a skirt, you can't afford it.
twang
Honored Contributor

Re: Trying to Add a Route

route add net 15.43.9.0 15.32.7.1 1
We are saying we want anything to the 15.43.9 subnet to use gateway 15.32.7.1

This command statement is only good until the next reboot.
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
Trond Haugen
Honored Contributor

Re: Trying to Add a Route

As others have mentioned you can add it from the command line too.
But I would also reccomend doing a reboot to verify that what you have put in /etc/rc.config.d/netconf is correct. I have too often seen such changes forgotten when the system is remooted several months later.

Regards,
Trond
Regards,
Trond Haugen
LinkedIn
Ravi_8
Honored Contributor

Re: Trying to Add a Route

Hi

route add net mask

or an enrty in /etc/rc.config.d/netconf
ROUTE_DESTINATION[1]="net "
ROUTE_MASK[1]=""
ROUTE_GATEWAY[1]=
ROUTE_COUNT[1]=1

#/sbin/init.d/net stop
#/sbin/init.d/net start

will do
never give up
Bharat Katkar
Honored Contributor

Re: Trying to Add a Route

Hi,
Adding route and modifying netconf is rightly explained above. Points to take care of are :

1. As twang has rightly suggested do not keep copy/backup of netconf file under /etc directory.

2. Reboot the server to confirm about the correctness of netconf file.

3. Don't forget to put "1" at the end of route add command. This is commonly done mistake.

All the best.
Regards,
You need to know a lot to actually know how little you know
Jan Sladky
Trusted Contributor

Re: Trying to Add a Route

Hi Ken,

for temporary purposes you can add new route from command line:


route add net 10.32.127.0 netmask 255.255.255.0 10.32.113.177 1

where
net=10.32.127.0
netmask=255.255.255.0
router=10.32.113.177
metric/route count =1

for permanent solution use
/etc/rc.config.d/netconf

reboot machine and check the setting

rgds Jan
GSM, Intelligent Networks, UNIX