Operating System - HP-UX
1841987 Members
3978 Online
110185 Solutions
New Discussion

Re: Can you change the default route without a reboot?

 
SOLVED
Go to solution
Gino Castoldi_2
Honored Contributor

Can you change the default route without a reboot?

Hi,

Server: L2000 HP-UX 11.0

Can you change the default route without a reboot? Is there another way other than updating the '/etc/rc.config.d/netconf' file
and then rebooting the server?

(10 points to any good answer).
Thank you Gino.
5 REPLIES 5
Pete Randall
Outstanding Contributor
Solution

Re: Can you change the default route without a reboot?

Hi Gino,

Sure - do a route delete then a route add - man route for details.

Pete

Pete
Pete Randall
Outstanding Contributor

Re: Can you change the default route without a reboot?

Hi (again) Gino,

You can also check this link:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x234fa22831ebd5118ff40090279cd0f9,00.html

Search string was:
"route add" +default

Pete

Pete
Neil Wilson_1
Occasional Contributor

Re: Can you change the default route without a reboot?

**CAREFULL!**

This could end up terminating some client connections if your not careful (including your own connection if you are on a different subnet). Its a good idea to do this change at a quiet time, and to issue the command all in one go as in:

route add default 1 ; route delete default

This will add the new gateway before deleting the old one.

Don't forget to make the changes in netconf anyway.

HTH

Duncan
Think Of Yourself As A Customer
harry d brown jr
Honored Contributor

Re: Can you change the default route without a reboot?

With

route delete
route add

# netstat -rn
Routing tables
Destination Gateway Flags Refs Interface Pmtu
127.0.0.1 127.0.0.1 UH 0 lo0 4136
141.123.226.41 141.123.226.41 UH 0 lan0 4136
141.123.224.0 141.123.226.41 U 2 lan0 1500
127.0.0.0 127.0.0.1 U 0 lo0 0
default 141.123.224.1 UG 0 lan0 0
# route delete default 141.123.224.1
delete net default: gateway 141.123.224.1
# route add default 141.123.224.1 1
add net default: gateway 141.123.224.1
# netstat -rn
Routing tables
Destination Gateway Flags Refs Interface Pmtu
127.0.0.1 127.0.0.1 UH 0 lo0 4136
141.123.226.41 141.123.226.41 UH 0 lan0 4136
141.123.224.0 141.123.226.41 U 2 lan0 1500
127.0.0.0 127.0.0.1 U 0 lo0 0
default 141.123.224.1 UG 0 lan0 0
#

live free or die
harry
Live Free or Die
T G Manikandan
Honored Contributor

Re: Can you change the default route without a reboot?

#route add net default 1
#route delete net default 1

Here the last column is that is the gateway is a local machine then it is 0.If the gateway is a remote machine then it is 1.
default is 0.

Thanks
G Manikandan