Had something similar in my lab, but more often and wrote a nagios check, which then updates the device.
(https://github.com/leinadred/CP_updatedynip_gw)
Line which should be interesting for you might be:
str_set_newip = "echo -e 'modify network_objects "+args.hostobjectname+" ipaddr "+str(resp_dnsip)+"\n-q\n' | dbedit -local"
So when changing IP of interoperable device named "test" to 1.2.3.7 it would look like:
[Expert@fwm:0]# dbedit -local
Please enter a command, -h for help or -q to quit:
dbedit> modify network_objects test ipaddr 1.2.3.7
dbedit> quit -update_all
network_objects::test Updated Successfully
[Expert@fwm:0]#
Changing the remote IP address does not create impacts right?
- it will, at least for a short period (sometimes it takes longer or needs a manual session deletion on both sites), until VPN is reestablished with the new IP. Thats what maintenance windows are made for 🙂
Disclaimer:
- I used this some time ago, so before doing this in production, test it. I know, it´s not pretty 😄