OPNsense Forum

Archive => 20.7 Legacy Series => Topic started by: SuperDOS on September 14, 2020, 11:37:25 pm

Title: Loss of internet access and access to OPNSense
Post by: SuperDOS on September 14, 2020, 11:37:25 pm
Ok, i've been struggling with opnsense issues ever since my ISP stopped offer static wan ip.
Now it's sends dhcp request every 30 min. This works ok for some time but suddenly I lose internet connection and can't reach my opnsense. Sometimes it will get back but become very unstable and come and go and a reboot of opnsense will make it stable for a while until it starts acting up again.

found this old thread that sounds like my problem but that fix should have been implemented right?
https://forum.opnsense.org/index.php?topic=4533.0

Not sure where to go from here.

Quote
2020-09-14T16:00:21   dhclient[7882]   bound to 85.XXX.XXX.XX -- renewal in 1800 seconds.
2020-09-14T16:00:21   dhclient[45307]   Creating resolv.conf
2020-09-14T16:00:21   dhclient[7882]   DHCPACK from 172.XX.XXX.1
2020-09-14T16:00:21   dhclient[7882]   DHCPREQUEST on re0 to 172.XX.XXX.1 port 67


running 20.7.2 on a qotom
Title: Re: Loss of internet access and access to OPNSense
Post by: dupsatou on October 21, 2020, 09:55:37 pm
I'm having the exact same issue.  This github issue seems to capture it exactly.  My logs for dhclient look exactly like this one.  In particular, it seems dhclient is already running so it bombs without getting the renewal handled and assigned.  It's very weird and very frustrating.

https://github.com/opnsense/core/issues/4017
Title: Re: Loss of internet access and access to OPNSense
Post by: dupsatou on November 02, 2020, 02:36:41 pm
This is still an issue, hoping someone else has come across this?
Title: Re: Loss of internet access and access to OPNSense
Post by: dupsatou on November 03, 2020, 12:44:34 am
So I am optimistic that I've solved this and I want to update here in case somebody else comes looking for answers.  If it doesn't work or still fails eventually I'll come back but based the behavior I'm seeing in my logs I'm feeling pretty good.

As I've done more digging around today and with a couple cut-outs from my connection I've started to identify more data points.  I was noticing that when issues were occurring it was after multiple attempts to renew the DHCP address directly with the gateway of my ISP.  This would keep going until it got to the point that the DHCP lease would expire and it would force dhclient to renew across the broadcast address instead of the gateway.  When this happened, it would usually renew and go about its business.  But there were occasions when it wouldn't renew seamlessly and an outage would appear.  Interesting side note, I've been noticing random dropouts in my connection while on VoIP calls for work for a while now and I suspect it was caused by this.  I discovered this because I started running a continuous ping in the background to 8.8.8.8  and saw random dropped packets and was able to correlate in the logs the DHCP lease expire.

So how do I think I fixed it?  I found this:  https://forum.netgate.com/topic/112869/dhclient-on-wan-occasionally-fails-to-renew-lease-with-cable-isp/3

The post is a little older and the custom compiling he did does not appear to be necessary.  I was able to add the recommended option modifier for the DHCP client on my WAN interface and so far my DHCP renewals have been seemless as confirmed in logs and a tcpdump.  Is this for sure fixed?  No, not yet.  But I have a high level of confidence that it is.

Very specifically, I went to Interface -> WAN -> Advanced (Under DHCP Client Config) -> and added the following to option modifiers at the bottom.  Do NOT include a ';' as it is not required and will bork it.  I found that out the hard way:

supersede dhcp-server-identifier 255.255.255.255

Hope this helps somebody else!  I'll certainly be back if its not resolved!

Title: Re: Loss of internet access and access to OPNSense
Post by: dupsatou on November 05, 2020, 04:02:05 pm
I am extremely optimistic that I have solved my problem so far.  At the very least this reduced a lot of noise in the general log with DHCP renewal failures due to the way it was handling it before.  It appears to be stable and definitely an improvement with the below.  Anybody coming here after if you don't see me back here saying its still broken this likely fixed it.  My ISP is Frontier FIOS in Texas in case somebody else is searching for this... Hope this helps somebody else! 
Title: Re: Loss of internet access and access to OPNSense
Post by: SuperDOS on December 17, 2020, 10:46:29 am
Thanks I will give this a try!