randomly lose connection to pfsense router
-
Hi all,
I've been trying to figure this problem out for the last week but no luck. I have a pfsense router and a mac connect to it using ethernet port. If I leave the ethernet cable in over night then the next day the mac will lose connection to the router (so I guess it's not really randomly losing connection). Weirdly enough If I disconnect the mac then the next day I will have connection to the router after plugging it back in.Pinging the router will not work (getting sendto no route to host error) because I have no connection, and the arp command shows that the 192.168.1.1 entry is either missing or incomplete (which is an indication of no connection if I remember correctly)
On the router side, it can still ping other hosts so I believe it can still access internet.
Most of the solutions that came up during my research does not really apply to me. There was one interesting post that suggests the problem can be solved with deleting and readding the default route. This did not work for me and ideally I prefer the mac does not lose connection at all.
Any help is appreciated
-
uhm to be sure of what happen in that time we would need a packet capture. my 2 cent is that the mac does not renew his lease when it expire
...
maybe try for a day to set a static ip -
What is the lease time have set? But guessing would have something to do with the dhcp lease.
-
@johnpoz The default lease time and maximum lease time options under Service -> DHCP Server have not been set so I assume pfsense is using initial values. I still see expired leases in the past. Can something like this happen: DHCP is trying to lease 192.168.1.100 to the mac but sees it expired and do nothing? Sorry I'm not too knowledgeable in Networking.
-
it's more like the mac does not accept the new lease
-
@kiokoman thanks for the suggestion. I'm going to try set a static ip for my mac and see how it goes. Is it possible for my mac to request a dhcp lease renew if it can't ping my router?
-
if it is without a valid ip it can't ping your router but it can listen to a dhcp solicit message.
or you can press this button when internet is not workingtake in mind that i'm only speculating here because we still don't know what it's happening
anyway it's worth a try until someone else come in with a better idea -
well the default is 7200 seconds, but that is only for clients that don't request a specific value... So look on your client what is the lease time..
But yeah a client could ask for, and get an offer for renewal - but then not actually use the renew, until expire and then not send out a discover..
As mentioned this is just all speculation - but something that disconnects on a time frame, does make dhcp a possible suspect.
What does your dhcpd log say on pfsense - is it flooded with renewal requests? As a client gets closer and closer to expire it will ask more and more often.. Until its pretty much screaming hey can I get a renewal..
-
@johnpoz Unfortunately pfsense only shows maximum of 50 logs so after rebooting the router I think the old ones got flushed out. I also found this post regarding dhcp not renewing https://forum.netgate.com/topic/115832/solved-wan-dhcp-not-renewing/3. I can't find the Option modifiers but I assume it got moved to Service -> DHCP server -> Other Options -> Default lease time. Thanks again for the inputs and I'll report back tomorrow to see if problem is resolved.
-
Change your log length, I have mine set to 2000..
Wan dhcp not renewing would have ZERO to do with your client..
Your rebooting pfsense? And not this client?
-
@johnpoz I rebooted pfsense. After changing log size I see a lot of DHCPREQUEST on em0 to 255.255.255.255 port 67 but no RENEW message after the request it seems.
-
My gut tells me you have a bad Ethernet cable.
-
After changing some dhcp server options, it seems to fix the problem today. I'll have to do to more tests to be completely sure though.
-
What option(s)?
-
I don't know which one of these are relevant so I'm just gonna list them all
- extended range from 192.168.1.100 - 192.168.1.199 to 192.168.1.100 - 192.168.1.254
- set default lease time to 86340 and maximum lease time to 86400
- enabled DNS resolver
- set idle timeout to 1320 minutes on CP
- set hard timeout to 1325 minutes, shorter than lease time.
Again my networking knowledge is limited so I'm not sure which one of those options (or a combination of those) matters, or if any of them matter at all.
One interesting observation though, yesterday after my mac lost connection, I tried to connect another device to the router but that device also does not have connection. It seems to me that if we are right about our speculation then the dhcp server just stopped working for whatever reason.
-
Why are you running a captive portal on a wired network? Curious..
-
I was assigned to customize a CP for our business, but my boss doesn't want to install a wifi card on the router. I think eventually the device will wirelessly connect to a switch and that switch will be wired to the router.
-
Ah ok - that makes sense ;)
right about our speculation then the dhcp server just stopped working for whatever reason
So did it stop, simple enough to see if its running on the router..
-
Currently everything is working right now, I'll have to try to reproduce the error since it's kind of inconsistent, I'll update this post again if anything happens. Thanks again for everyone's inputs, they really helped.
-
@ssattannae said in randomly lose connection to pfsense router:
I was assigned to customize a CP for our business, but my boss doesn't want to install a wifi card on the router. I think eventually the device will wirelessly connect to a switch and that switch will be wired to the router.
That's not how it works...
You add wireless access points around your building or campus, wire those access points into the switch(es), and then the switch(es) is/are wired into pfsense/router.
Jeff