Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

default gateway way

Status
Not open for further replies.

unixfreak

ISP
Oct 4, 2003
632
GB

Quick question hopefully.
What's the command for changing the default gateway? chginet only adds a second one.

Cheers
 
I usually flush the route table and then install default GW:

route -f
chdev -l inet0 -a route=0,<ip-addr-of-def-gw>

but

route delete 0
chdev -l inet0 -a route=0,<ip-addr-of-def-gw>

seems to work also


HTH,

p5wizard
 
remember that smitty route will allow you to change things AND the changes will remain in place after reboot.

changing the route with the commands at the command line works, but the changes don't remain after the next reboot.
 

CrystalWizard: Smitty is just a front end. The command will do exactly the same thing.
The thing is Smitty doesn't have a change route feature. If it did the I would be able to look up the command.

Cheers
 
Changes gone after reboot? Not with chdev - this command changes attributes of 'devices' in the ODM database - pretty solid...
The chdev/route command is exactly what smit(ty) does - that's where I got it in the first place, except you first have to clean up with route -f or route delete, because if a route is already in place, then the chdev command above will complain about it or will just install a parallel default GW...





HTH,

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top