dynamic public ip / default gateway offline

Started by cnu80, March 08, 2017, 09:43:19 PM

Previous topic - Next topic
Hi,

my WAN-Interface is configured to dhcp to get a public IP address from my provider. I use a LTE-moden in bridge mode. I think my provider change the address every 24hours and after the public IP has changed my internet connection is broken. Opnsense  switched the default gateway to offline because ping to 8.8.8.8 failed.

To get my internet connection online again I found two options:
* Reboot the complete system
* Start the script /usr/local/etc/rc.reload_interfaces

Is it possible to renew the IP address when the default GW is offline? Is there a existing function?

If not I will try to implement a script via cron.

like:
#!/bin/sh
/usr/bin/timeout 10 /sbin/ping -c4 google.com > /dev/null

if [ $? != 0 ]
then
  /usr/local/etc/rc.reload_interfaces
fi


thanks