OPNsense Forum

Archive => 17.1 Legacy Series => Topic started by: phoenix on June 23, 2017, 01:46:30 pm

Title: apinger: a (possibly) silly question
Post by: phoenix on June 23, 2017, 01:46:30 pm
I'm guessing that apinger is supposed to restart a WAN NIC if it's seen to be down, is that correct? When the WAN connection  goes down (and obviously the WAN gateway is also not reachable) apinger also fails, I'm guessing that's not the intended behaviour?  :) When the WAN NIC is restarted then apinger also restarts, see the log below:

Code: [Select]
Jun 23 13:10:59 apinger: Starting Alarm Pinger, apinger(9350)
Jun 23 13:10:59 apinger: Exiting on signal 15.
Jun 23 13:10:56 apinger: Starting Alarm Pinger, apinger(17669)
Jun 23 13:10:11 apinger: No usable targets found, exiting
Jun 23 13:10:11 apinger: Starting Alarm Pinger, apinger(40580)
Jun 23 13:10:11 apinger: Exiting on signal 15.
Jun 23 13:08:34 apinger: ALARM: WAN_DHCP(82.246.46.254) *** down ***
Jun 22 17:45:50 apinger: Starting Alarm Pinger, apinger(5713)
Jun 22 12:31:34 apinger: Starting Alarm Pinger, apinger(18635)

I'm having a continuing problem with my WAN connection going down (infrequent but unpredictable) and I can't find anything in any of the logs to give me any clue as to what's happened, is there any possible method of debugging this problem?

As I have been having this problem for a while I was think about creating a script to restart the WAN connection if it goes down, where in freebsd are users scripts normally located?

Title: Re: apinger: a (possibly) silly question
Post by: Droppie391 on June 23, 2017, 02:18:57 pm
well, why not use the cron option under system -> settings? we use it to force the 24h disconnect by our isp to be at night time so even if the line drops at midday and the isp would restart the link at midday the next day, we force it to restart at 0500. simply use the "reset interface" cron option and "wan" as parameter.
Title: Re: apinger: a (possibly) silly question
Post by: phoenix on June 23, 2017, 03:13:47 pm
well, why not use the cron option under system -> settings? we use it to force the 24h disconnect by our isp to be at night time so even if the line drops at midday and the isp would restart the link at midday the next day, we force it to restart at 0500. simply use the "reset interface" cron option and "wan" as parameter.
Yes, I could do that and I did have that running for a while when I was away but when it goes down is unpredictable (sometime hours, sometime days or weeks) and I'd rather not leave it down for a possibly long period of time when I'm away. I thought it would be more useful to run a cron job every minute that checked for connection then reset the NIC when it fails and email a nbotification), that would seem more useful until I can find a way to debug this annoying problem. FWIW, I've only recently started having this problem and I think it's unlikely to be my ISP although it could be possible.

Do you know where the best place would be to place a user script?