This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to automate DHCP IP renew on the WAN interface

I have a problem with my SG125 WAN interface losing the DHCP IP provided by the ISP regularly overnight.

What I do so far is to login to the GUI and clicking on the RENEW button on the Interface page which solves the issue.

 

Unfortunately this does not work when I am not at home and therefore I am looking for a solution to automate this to happen at 4AM daily.

 

Any idea how I can achieve this? Cron Job?

 

Looking forward to any cool recommendations.

Urs



This thread was automatically locked due to age.
Parents
  • Hello Urs.

    I replied a thread yesterday and I think it could help you automate this by bringing the interface down and up. Just replace cc get_objects interface pppoe for cc get_objects interface ethernet to locate the ref of your WAN interface. I'm not sure if there's a cc command for just renewing the dhcp lease. Meybe someone more seasoned would know.

    That being said, I would try to figure out why your WAN device is not renewing the lease for your WAN interface. I would bet the issue lies on your WAN device. Can you share some of your dhcp logs from the moment the issue happens?

    Regards,

    Giovani

  • Hi Giovani,

    the issue is that my SG125 tries to renew DHCP from the ISP but to the wrong IP (10.100.192.1) which I find very strange. I am not using this subnet at all.

    once I klick on Renew   it gets an IP immediately and this every time it happens

    2017:04:06-05:47:06 gutec-fw dhclient: DHCPREQUEST on eth1 to 10.100.192.1 port 67
    2017:04:06-05:47:06 gutec-fw dhclient: send_packet: Network is unreachable
    2017:04:06-05:47:06 gutec-fw dhclient: send_packet: please consult README file regarding broadcast address.
    2017:04:06-05:47:06 gutec-fw dhclient: dhclient.c:2247: Failed to send 300 byte long packet over fallback interface.
    2017:04:06-05:47:26 gutec-fw dhclient: DHCPREQUEST on eth1 to 10.100.192.1 port 67
    2017:04:06-05:47:26 gutec-fw dhclient: send_packet: Network is unreachable
    2017:04:06-05:47:26 gutec-fw dhclient: send_packet: please consult README file regarding broadcast address.
    2017:04:06-05:47:26 gutec-fw dhclient: dhclient.c:2247: Failed to send 300 byte long packet over fallback interface.
    2017:04:06-05:47:34 gutec-fw dns-resolver[4465]: DNS server failed to contact!
    2017:04:06-05:47:44 gutec-fw dhclient: DHCPREQUEST on eth1 to 10.100.192.1 port 67
    2017:04:06-05:47:44 gutec-fw dhclient: send_packet: Network is unreachable
    2017:04:06-05:47:44 gutec-fw dhclient: send_packet: please consult README file regarding broadcast address.
    2017:04:06-05:47:44 gutec-fw dhclient: dhclient.c:2247: Failed to send 300 byte long packet over fallback interface.
    2017:04:06-05:47:58 gutec-fw dhclient: DHCPREQUEST on eth1 to 10.100.192.1 port 67
    2017:04:06-05:47:58 gutec-fw dhclient: send_packet: Network is unreachable
    2017:04:06-05:47:58 gutec-fw dhclient: send_packet: please consult README file regarding broadcast address.
    2017:04:06-05:47:58 gutec-fw dhclient: dhclient.c:2247: Failed to send 300 byte long packet over fallback interface.
    2017:04:06-05:48:11 gutec-fw dhclient: DHCPREQUEST on eth1 to 10.100.192.1 port 67
    2017:04:06-05:48:11 gutec-fw dhclient: send_packet: Network is unreachable
    2017:04:06-05:48:11 gutec-fw dhclient: send_packet: please consult README file regarding broadcast address.
    2017:04:06-05:48:11 gutec-fw dhclient: dhclient.c:2247: Failed to send 300 byte long packet over fallback interface.
    2017:04:06-05:48:17 gutec-fw dhclient: Killed old client process  -----here I clicked Renew on in the GUI for the WAN interface
    2017:04:06-05:48:19 gutec-fw dhclient: DHCPREQUEST on eth1 to 255.255.255.255 port 67
    2017:04:06-05:48:19 gutec-fw dhclient: DHCPACK from 62.2.31.72
    2017:04:06-05:48:20 gutec-fw dhclient: bound to 46.126.190.199 -- renewal in 21397 seconds.


Reply
  • Hi Giovani,

    the issue is that my SG125 tries to renew DHCP from the ISP but to the wrong IP (10.100.192.1) which I find very strange. I am not using this subnet at all.

    once I klick on Renew   it gets an IP immediately and this every time it happens

    2017:04:06-05:47:06 gutec-fw dhclient: DHCPREQUEST on eth1 to 10.100.192.1 port 67
    2017:04:06-05:47:06 gutec-fw dhclient: send_packet: Network is unreachable
    2017:04:06-05:47:06 gutec-fw dhclient: send_packet: please consult README file regarding broadcast address.
    2017:04:06-05:47:06 gutec-fw dhclient: dhclient.c:2247: Failed to send 300 byte long packet over fallback interface.
    2017:04:06-05:47:26 gutec-fw dhclient: DHCPREQUEST on eth1 to 10.100.192.1 port 67
    2017:04:06-05:47:26 gutec-fw dhclient: send_packet: Network is unreachable
    2017:04:06-05:47:26 gutec-fw dhclient: send_packet: please consult README file regarding broadcast address.
    2017:04:06-05:47:26 gutec-fw dhclient: dhclient.c:2247: Failed to send 300 byte long packet over fallback interface.
    2017:04:06-05:47:34 gutec-fw dns-resolver[4465]: DNS server failed to contact!
    2017:04:06-05:47:44 gutec-fw dhclient: DHCPREQUEST on eth1 to 10.100.192.1 port 67
    2017:04:06-05:47:44 gutec-fw dhclient: send_packet: Network is unreachable
    2017:04:06-05:47:44 gutec-fw dhclient: send_packet: please consult README file regarding broadcast address.
    2017:04:06-05:47:44 gutec-fw dhclient: dhclient.c:2247: Failed to send 300 byte long packet over fallback interface.
    2017:04:06-05:47:58 gutec-fw dhclient: DHCPREQUEST on eth1 to 10.100.192.1 port 67
    2017:04:06-05:47:58 gutec-fw dhclient: send_packet: Network is unreachable
    2017:04:06-05:47:58 gutec-fw dhclient: send_packet: please consult README file regarding broadcast address.
    2017:04:06-05:47:58 gutec-fw dhclient: dhclient.c:2247: Failed to send 300 byte long packet over fallback interface.
    2017:04:06-05:48:11 gutec-fw dhclient: DHCPREQUEST on eth1 to 10.100.192.1 port 67
    2017:04:06-05:48:11 gutec-fw dhclient: send_packet: Network is unreachable
    2017:04:06-05:48:11 gutec-fw dhclient: send_packet: please consult README file regarding broadcast address.
    2017:04:06-05:48:11 gutec-fw dhclient: dhclient.c:2247: Failed to send 300 byte long packet over fallback interface.
    2017:04:06-05:48:17 gutec-fw dhclient: Killed old client process  -----here I clicked Renew on in the GUI for the WAN interface
    2017:04:06-05:48:19 gutec-fw dhclient: DHCPREQUEST on eth1 to 255.255.255.255 port 67
    2017:04:06-05:48:19 gutec-fw dhclient: DHCPACK from 62.2.31.72
    2017:04:06-05:48:20 gutec-fw dhclient: bound to 46.126.190.199 -- renewal in 21397 seconds.


Children
  • If selecting the 'Daily reconnect' in the 'Advanced' section of the Interface definition doesn't do this, you can add a line like the following to /etc/crontab-static (using REF_IntPppsXXXXXX, as in Giovani's post):

    0 4 * * * root /usr/local/bin/confd-client.plx interface_dhcp_renew_lease REF_IntPppsXXXXXX

    I note that your logs are for almost 6AM, so you will want to check with your ISP to see what time they reset the connection.  I agree with Giovani that the cause of the problem seems to be in their device.

    Cheers - Bob

     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA
  • I have been experiencing the same issues, however this has only been since upgrading our modem. If I manually click renew, that single attempt corrects the down WAN.

    I don't see " Daily reconnect" in the 'Advanced' section of the Interface. Has this been removed? Seems like a logical solution if it were available. Looks like this is only part of a DSL connection per searching the firewall help docs.