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 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
Want to stay up to date with the latest Linux tips, news and announcements? Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
You may also be interested in other helpful articles:
- How do I Drop or block attackers IP with null routes?
- Routing all mail to unknown users to a single mail account
- Quagga: Linux Dynamic Routing Software
- Configure static routes in Debian or Red Hat Linux systems
- Linux How to setup multi homing network
Discussion on This Article:
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: default router, hpux, netstat, networking configuration, route add, route gateway, route_command, routing table, shutdown_command



How to configure router command in linux
i like to subnet i am really good at it!!