Sharing Knowledge | System Admin Articles

Route add in HP Unix



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

OR

To add a default route:
# route add default 192.168.1.254

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 192.168.1.254:


# vi /etc/rc.config.d/netconf

Add or modify following entries

ROUTE_DESTINATION[0]="default"
ROUTE_MASK[0]=""
ROUTE_GATEWAY[0]="192.168.1.254"
ROUTE_COUNT[0]="1"
ROUTE_ARGS[0]=""

Reboot HP-UX system/server to take effect


# shutdown -ry 0



Labels: HP-UX

My Profile PhotoAbout the Author

I'm Madesh, An UNIX System Admin by Profession. I'm having Expertise in HP-UX and Linux Administration. I have done lot of work on the infrastructure Mgmt side in UNIX system administration, Hardware, Storage (EMC/ HP EVA). I'm blogging since 2010.
Follow Me On Twitter or On Facebook

0 Comments for "Route add in HP Unix"

What do you think about this Article? Add your Opinion..!

Back To Top