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:
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: UdoB

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!