how to change the default gateway (Hetzner failover)

Started by nbari, March 08, 2025, 10:32:28 PM

Previous topic - Next topic
Hello I have a proxmox cluster and OPNsense in a VM, when I migrate  (move the VM from node1 to node2), I need to update the gateway in OPNSense.

I tried adding all the nodes as extra gateways but for some reason is not working as expected.

Then I tried using the API saving output of /api/routing/settings/get, then modifying the gateway value and setting it with back with:

curl -u user:pass -d @current_gateway.json \
    -X POST -k -s https://<opnsense>/api/routing/settings/set -v

that returned {"result":"saved"} and they tried to reconfigure:

-d "" \
    -X POST -k -s https://<opnsense>/api/routing/settings/reconfigure

returned {"status":"ok"} but gateway did not change

then via SSH I tried route add default X.X.X.X but I get add net default: gateway X.X.X.X fib 0: Invalid argument, also trying with setfib.

Any ideas about how could I change the gateway via API or SSH, I want to automate this process so that when the VM moves the gateway could be updated.