Configuring HP-UX routes

Add or delete a route to a specific host:

root@hp-ux:/ # route add host 192.168.1.1 192.168.0.1 1

root@hp-ux:/ # route delete host 192.168.1.1 192.168.0.1

Add or delete a route to a network

root@hp-ux:/ # route add net 192.168.1.0 netmask 255.255.255.0 192.168.1.1 1

root@hp-ux:/ # route delete net 192.168.1.0 netmask 255.255.255.0 192.168.1.1

Add or delete a default route

root@hp-ux:/ # route add default 192.168.0.1 1

root@hp-ux:/ # route delete default 192.168.0.1

Flush all gateway entries from the routing table

root@hp-ux:/ # route -f

Saving the IP Routing Configuration

root@hp-ux:/ # vi /etc/rc.config.d/netconf
ROUTE_DESTINATION[0]=”net 129.1.0.0″
ROUTE_MASK[0]=”255.255.0.0″
ROUTE_GATEWAY[0]=”128.1.0.1″
ROUTE_COUNT[0]=”1″
ROUTE_ARGS[0]=””
ROUTE_SOURCE[0]=””
ROUTE_DESTINATION[1]=”default”
ROUTE_MASK[1]=””
ROUTE_GATEWAY[1]=”128.1.0.1″
ROUTE_COUNT[1]=”1″
ROUTE_ARGS[1]=””
ROUTE_SOURCE[1]=””

Advertisement