OPNsense Forum

Archive => 15.1 Legacy Series => Topic started by: wepee on June 13, 2015, 05:46:49 am

Title: ADSL disconnection- How to reconnect automatically
Post by: wepee on June 13, 2015, 05:46:49 am
Hi All,

Great to see a fork of pfSense! :) Keep up the good work guys!!! :)
I am a windows user, so FreeBSD is something I am not familiar with.
I did manage to run pfSense on my PC as a firewall on my local network
for some time now, but 1 problem is always at the back of my mind, bugging
me to solve it.

I was wondering if any users are still using the old ADSL broadband connection.
I don't know if it is a good or bad line service in your respective country over in Europe.
But coming from a tropical country like mine, heavy raining can play havoc to our ADSL line quality.
That is to say, on a sunny day, the ADSL line will be stable and fine, DDNS service is working fine.
DNS service is also working fine.

However when the weather turns bad, and starts raining heavily, my ADSL line
will start to playing up!!! >:(

Meaning I will get line disconnection.... OR.... if it connection is established, a public IP
address is obtained and DNS servers are known, but somehow connection to my local ISP DNS
server is broken.

Having public DNS server, like Google's DNS server = 8.8.8.8 or 8.8.4.4
as the main DNS connection on my firewall does not help my problem at all.

Finally, I need to reboot the firewall PC and have everything working again.
This is quite frustrating if the firewall need to be rebooted on a remote site
on the weekends! :(

So in order to solve this problem, I googled a bit and found someone has a fix to this
problem of mine, just by using CRON job and some programming script( I think that is what it is called)

Here is the link: http://blog.martinshouse.com/2014/06/pfsense-auto-reboot-if-internet.html (http://blog.martinshouse.com/2014/06/pfsense-auto-reboot-if-internet.html)
Although this may solve the problem, it does give me another problem!!! :-[

What happen if the site's ADSL connection is completely down, after implementing this solution,
the firewall PC keeps on rebooting after a few minutes!!! :'(
It rebooted some many times, that pfSense running on the hard disk got corrupted.

See the picture attached below.
(http://i1132.photobucket.com/albums/m577/liukuohao/th_Hard_Corruption_after_rebooting_many_times_zps6etyg7o1.jpg) (http://s1132.photobucket.com/user/liukuohao/media/Hard_Corruption_after_rebooting_many_times_zps6etyg7o1.jpg.html)

Therefore, I would like to ask the forum, is there a way to "disconnect and reconnect "automatically
in OPNsense, when it detects the link to the DNS server is broken (no ping response), without having to
reboot the system repeatedly if the ADSL link is down completely?

Thank you.
Title: Re: ADSL disconnection- How to reconnect automatically
Post by: franco on June 15, 2015, 12:13:53 pm
I would try to avoid the reboot to avoid unwanted behaviour. Instead of reboot, you could hardcode a reboot of the PPPoE server and or the connection, but right now I am wondering why the box doesn't pick it up. Have you tried what happens with OPNsense in these scenarios? We've improved the backend handling and this error *may* be gone. I'm merely trying to avoid suggesting a workaround in case the behaviour differs from previous installations.

If the error persists we must certainly fix it in our code. All help to get a fix into the code is appreciated, especially testing. :)
Title: Re: ADSL disconnection- How to reconnect automatically
Post by: jstrebel on June 15, 2015, 12:46:55 pm
I had similar issues in the past with certain ADSL modems. In all cases the root cause was in the ADSL Modem. The modem was not able to recover from short interruption of the ADSL link. In most cases a Software update of the modem solved the problem. In monowall we had a nice feature which allowed to restart the PPPoE Link from the router with the CRON at a given time. This helped at least that the ADSL connection came back after the configured time window in cron. I am aware this is a very crude solution.
Title: Re: ADSL disconnection- How to reconnect automatically
Post by: wepee on June 16, 2015, 07:31:54 pm
@ franco,

So far I have not tested on OPNsense yet at the remote site, obviously the reason is to tested it out fully
before shifting it to the site, just to avoid the hassle of driving hundreds of KM, to rectify some teething problems.

Anyway, I am just letting your guys know the pesky problem I had coming from using pfSense experience but not from OPNsense. Please bear in mind.

If there is a fix, can there be a option of auto-reconnect itself, or you are thinking that software should auto reconnect rightfully by its own, as it is being designed that way?

@ jstrebel,

Hmmmm......you may be right here. Just a few weeks back, the remote site's ADSL modem finally was not
working reliable, the ADSL light cannot be remained stable, even on the sunny day.

And hence, replaced it with a new one, the line is stable. Everything is working fine.
So, it looks like it could be just HARDWARE failure somewhere in the modem.

At the end, my gut feeling is the old ADSL modem is causing such problem to occur.
I will keep monitoring.
Title: Re: ADSL disconnection- How to reconnect automatically
Post by: wepee on June 16, 2015, 07:45:13 pm
Ok, my question here is related to the FreeBSD file system used in OPNsense.....

I was thinking installing OPNsense in SSD, but worry that it won't last long, since SSD
cannot cope with the constant caching and logging, am I right? In other words, does
OPNsense support TRIM for SSD?

The reason of using SSD, is to avoid any file system corruption, when the user at the
remote site keeps on reboot the hardware (without proper shutdown) thinking that
it will solve the Internet connection? As you know improper shutdown on hard disk
will cause a wear on the disc platter and hence accelerate hard disk failure.

Thank you.
Title: Re: ADSL disconnection- How to reconnect automatically
Post by: franco on June 16, 2015, 07:56:10 pm
TRIM is enabled on first boot if the disk supports it. Disk life shouldn't be an issue, but you can also enable memory file systems for moving parts like /tmp and /var to further extend your disk life.

Thanks for the heads-up for the problem. We can certainly figure out a way to address it more graceful  (avoid the reboot and custom scripting).
Title: Re: ADSL disconnection- How to reconnect automatically
Post by: franco on June 28, 2015, 04:47:47 pm
For PPPoE connections there is an advanced option called "Periodic reset". Isn't this working as intended?