Check for valid IPV4 Address on WAN and force renewal if not valid
-
I have ATT Fiber, but I've found that if I get a power outage, my PFSense box will come up well before the ATT Fiber gets relinked. For whatever reason, PFSense will just sit there all day with no valid IP on the WAN interface, until I come home and force a renewal via the GUI or simply restart PFSense.
I have my ATT box setup for IP Passthru, so the PFSense gets my true external IP, instead of a private 192 address, which works great, as long as PFSense comes up after the ATT fiber is up.
Basically, I've been out of town and had a minor power flash cause my entire network to be inaccessible until I return home, as the PFSense box fails to ever ask again for a valid address on the WAN.
Is there a simple way to schedule some sort of hourly DHCP renewal, without affecting traffic if all is well, but something that will get PFSense to eventually get a valid IP from the ATT Fiber after it is eventually online?
I figured that issuing a dhclient bge0 would do it, but I simply get the message that dhclient already running, pid: 11362 exiting - Now, I tried this after it actually already has a valid IP, so maybe that's why, but since I've seen PFSense sit for hours, or even days, without a valid IP, until I restart or force a renewal via the GUI, I don't think scheduling a dhclient bge0 hourly will fix the issue when it occurs, since if it's running when it's got a valid address, wouldn't it also be running when it's got no valid address, too? And I don't want to add a -r, since I figure this will disrupt internet traffic momentarily, as it drops the current valid IP and request another.
Can I force a DHCP without first dropping the existing IP on the WAN?
I'm tired of minor power outages rendering my home LAN out of reach if I am away from home due to this situation.
Any suggestions?
-
The first thing you want to do, and what is really the best solution, is to buy a UPS (Uninterruptible Power Suppy) and put your pfSense box and your AT&T equipment on the UPS. Then short power blips will not matter at all.
What should normally happen is that the
dpinger
daemon running as part of the gateway monitoring should detect that it can no longer communicate with your gateway. That starts a "gateway down alarm" response from the gateway monitoring system. That should result in cycling of the interface.However, your real solution is the UPS. Even a $50 UPS should be able to power your pfSense box and the AT&T equipment for thirty minutes or even more.
-
UPS is really a must have these days to be honest.. My whole network, even my poe APs are up for 20 minutes easy and prob could go 30.. But almost never have that long of outage anyway.. If it down for 20+ minutes it prob going to be down hour or so + etc..
So after 20 I just have everything shut down.
But little brownouts, little blips, etc.. never even notice..
Money spent on usp is money well spent for sure.. You don't have to drop all that much money - depends on how much your stuff draws.. But modems. switches, router appliance (my sg4860) draw almost nothing... The only thing that keeps me from being up much longer is the PC and NAS..
Could prob be up for hours with wifi, if shutdown pc and nas earlier..
edit: Yeah just did some quick math.. If I just left up the modem, switch (sg300-28), sg4860 and 1 AP I could go over 2 hours easy..
-
One thing I did years ago, when I had an intermittent problem with my ISP is I wrote a script that would periodically ping my ISP's gateway and log failures. You could have it restart DHCP instead.
Here's my script:
#! /bin/sh
while [ 1 ]
do
ping <address> -4 -c 1 || date >> ~/log;sleep 50
done