Change Host default gateway without reboot

___jul

New Member
May 26, 2012
15
0
1
Hello,

A quick question, I use locally a proxmox host with various CT, default gateway is our IPS1, we have a new one and I want to update the gateway to use IPS2 for host and CT.
Can I just update /etc/networks/interface to change gateway ip and restart network service or should I use proxmox web interface and reboot the whole host.
I prefer to do a quick network restart.

Thank you
 
The easiest thing would be to just change the setting in /etc/network/interfaces (through a shell connection), then change the route yourself:
route del default gw X.X.X.X {bridge interface}
route add default gw X.X.X.X {bridge interface}

If/when you reboot, or trip over the power cable, when the system comes back up you'll have the gateway you're expecting - and you can have it now without rebooting!
 
I had to change my gateway. That part was not a problem - I changed it in the webgui under network. I also changed it by using nano /etc/network/interfaces

The route command is returning:

-bash: route: command not found

How does one put these changes into effect headless without rebooting when the route command isn't working? Is there a way?
 
Last edited:
-bash: route: command not found
"route" is deprecated. See man ip-route. For example "ip route add default via 192.0.2.254" or just "ip route show" to see the current state...

Good luck
 
Thanks, found it. For anyone else:

remove the old default gateway:

root@xxx:~# ip route del default via xxx.xxx.xxx.xxx

Then add the new one:

root@xxx:~# ip route add default via yyy.yyy.yyy.yyy
 
  • Like
Reactions: InforMedic and UdoB