Have an issue where Proxmox, on boot, fails to set the default route. It is set in the config (file and UI), and changing the gateway and applying will set the default route, so something's getting mixed up here. So hopefully this fixes it.
Replace 172.17.25.1
with your gateway, and vlan25
with the correct interface.
file: /usr/local/bin/fix-default-route.sh
#!/bin/bash
ip route get 8.8.8.8 > /dev/null 2>&1
if [ $? -eq 2 ]; then
echo 'Default route not present! Adding!'
ip route add default via 172.17.25.1 dev vlan25
else
echo 'Default route already exists!'
fi
file: /etc/systemd/system/fix-default-route.service
[Unit]
Description=Fix missing default route on boot
After=network-online.target
Wants=network-online.target
[Install]
WantedBy=default.target
[Service]
ExecStart=/usr/local/bin/fix-default-route.sh
chmod +x /usr/local/bin/fix-default-route.sh
systemctl enable fix-default-route.service
systemctl start fix-default-route.service
systemctl status fix-default-route.service
Should see that it didn't update anything (assuming this is being added while things are working). Then, to verify it adds it...
ip route del default via 172.17.25.1 dev vlan25
systemctl start fix-default-route.service
systemctl status fix-default-route.service
And it should say it was missing and it added it back.