WAN loss = package restart
-
Hi folks,
This evening my ISP ran some maintenance that briefly took out my internet connection. As it came back to life, the pfsense box reinitialised the interface, taking down and restarting all my installed packages…
I can see why package restart makes sense, but it seems quite a blunt tool to blindly force all packages down… (what actually bothered me was bringing telegraf down lost a couple of hours worth of buffered metrics; my influxdb service was down at the time).
So - q - is there any way to avoid the need to bring down all the packages as the interface comes back up after a connection loss (perhaps choosing which I do not want impacted)?
Cheers for any pointers.
-
Have had several WAN outages here, including a construction team which cuts my line by accident.
Never seen such a behavior at my pfSense.Regards
-
IIRC when the WAN link goes down (as opposed to stays up but packet loss) then rc.newwanip triggers, in case there's a new IP.
-
@steveits yep, that’s what the logs indicate… dynamic IP is unfortunately something I have to deal with (or pay more for static).
So…. There’s no way around a complete reinitialisation, short of (maybe) ensuring I have a static IP on the WAN side?
-
@tse-0 I haven't paid terribly much attention. You might look for past threads about it. Maybe putting a switch between pfSense and the ISP might help keep the link "up"?
-
Is that related to connection type?
I get my WAN IP from provider by DHCP and never had this issue.
Connection is a PPPoE type.Regards
-
@fsc830 Don't really know, honestly. Here's a thread talking about it, but the context in it was someone had a laptop plugged into an interface port and triggering the restarts.
-
@fsc830 Mine is also DHCP...
The message in the logs reads:
/rc.newwanip: Netgate pfSense Plus package system has detected an IP change or dynamic WAN reconnection - xxx.xxx.xxx.119 -> xxx.xxx.xxx.119 - Restarting packages
I'm wondering - why does pfsense need to trigger this package restart script if the WAN IP has not changed?
-
@steveits thx for the link... I think the key is in this comment (with which I agree):
Most installs don't see an interface go up/down except in a significant network event and it's safer for those to restart packages than to leave then potentially running with the wrong IP
However, it seems pfsense knows the pre-event IP address, and should be able to compare it to the (potentially new) post-event IP ... and not do a package restart if they match... however, I'm no expert ... there may be other reasons for this behaviour with which I am not aware...
It'd be nice to be able to configure which packages were subject to restart ... I think I'll follow the code a ways to see if I can work out how that might be achieved ...
Cheers!
-
@tse-0 hmm.. no time right now to examine further but the code does seem to validate old IP vs new:
if (!is_ipaddr($oldip) || ($curwanip != $oldip) || file_exists("{$g['tmp_path']}/{$interface}_upstart4") ||
(!is_ipaddrv4($config['interfaces'][$interface]['ipaddr']) && ($config['interfaces'][$interface]['ipaddr'] != 'dhcp'))) {
....
<package restart here>
...Could be one of the other conditions here I guess... Might hack in some debug code for the log so I can see what's going on ...