HP-UX: How Do I configure routing or add route?

by on October 29, 2005 · 4 comments· LAST UPDATED October 24, 2007

in , ,

You can use route command to configure routing. Syntax is as follows:
route add net {network-address} netmask {subnet} {router-address}

Let us assume your router address is and network ID is, then you can type route command as follows:
# route add net netmask


To add a default route:
# route add default

Verify that (display) routing table is updated (display routing table):
# netstat -nr

Test it i.e. try to ping or send nslookup request:
# ping mycorp.com

To flush all routing entries use command [quite handy to clean your gordian knot ;)] :
# route -f

However if I reboot HPUX box then above routing entries gets removed. To pick up your setting upon each reboot your need to configure Routes in HPUX networking configuration file - /etc/rc.config.d/netconf. To add default router/gateway
# vi /etc/rc.config.d/netconf

Add or modify following entries


Reboot HP-UX system/server to take effect
# shutdown -ry 0

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 4 comments… read them below or add one }

1 pradeep July 11, 2007 at 12:01 pm

How to configure router command in linux


2 bob August 22, 2007 at 2:43 am

i like to subnet i am really good at it!!


3 soundar March 3, 2009 at 1:33 pm

hi will it work on sco unix as well, i tried but no luck, thank you for assisting on this.


4 Anuj April 13, 2012 at 7:57 am

In the command
# route add net netmask
you havent mentioned the count 1 , while in the netconf entry you have.



Leave a Comment

Tagged as: , , , , , , , ,

Previous post:

Next post: