Networking

Re: Changing Default Gateway on the fly

 
SOLVED
Go to solution
Kevin Lamb
Frequent Advisor

Changing Default Gateway on the fly

Hi,

I need to change the default gateway on several servers, I have made the relevant changes in the netconf file; however, I am not too sure if I can issue a route add as people are accessing the servers using the present gateway.

Can the change be made on the fly or is it best to ensure that no-one is accessing the server or should this be done via single user/ or reboot.

Any help would be appreciated

Kev
8 REPLIES 8
Jeff Machols
Esteemed Contributor

Re: Changing Default Gateway on the fly

you can run the route add on the fly with no problems. When you add it, just include "default" after the destination. Once this is working, then do a route delete on the old one.
Jeff Machols
Esteemed Contributor

Re: Changing Default Gateway on the fly

Actually, You don't need the "default" in there, sorry about that.
Marco Paganini
Respected Contributor

Re: Changing Default Gateway on the fly

Hello Kevin

Just add the new route using the route add command and delete the old old using the route delete command. Make sure however that no established connections exist when you do that.

Regards,
Paga
Keeping alive, until I die.
Uday_S_Ankolekar
Honored Contributor

Re: Changing Default Gateway on the fly

Hi,

If you have already made configuration changes in /etc/rc.config.d/netconf file your next reboot would take care of this default gateway.

If you want to run it on the fly
route add default 1

-USA..


Good Luck..
Kevin Lamb
Frequent Advisor

Re: Changing Default Gateway on the fly

Jeff,

Thanx for the info, just to confirm, once I submit the new dflt gtwy and remove the other, this will be transparent to the active users????

Kev
Jeff Machols
Esteemed Contributor
Solution

Re: Changing Default Gateway on the fly

Should be. They may see a delay (slight) the first time they go through the gateway because it caches. just make sure you do a netstat -r to see the new gateway is in.
Kevin Lamb
Frequent Advisor

Re: Changing Default Gateway on the fly

All,

Thanks for all your help, I made the changes in the early hours of this morning without any interuption to the service.

Once again thanks to all who responded.

Kev
Anthony deRito
Respected Contributor

Re: Changing Default Gateway on the fly

Kevin, just a gentle reminder, don't forget to make your changes to /etc/rc.config.d/netconf file or the next reboot will restore the original route. (I've been there)

Tony