≡ Menu

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

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

Tweet itFacebook itGoogle+ itPDF itFound an error/typo on this page?

{ 4 comments… add one }

  • pradeep July 11, 2007, 12:01 pm

    How to configure router command in linux

  • bob August 22, 2007, 2:43 am

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

  • soundar March 3, 2009, 1:33 pm

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

  • Anuj April 13, 2012, 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