LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Raspberry pi as wan failover with 3G (https://www.linuxquestions.org/questions/linux-networking-3/raspberry-pi-as-wan-failover-with-3g-4175628837/)

silent001 05-02-2018 05:46 AM

Raspberry pi as wan failover with 3G
 
Good day everyone. So to start I just want to say I am really new with networking and linux so forgive me if my questions are rather simple but here goes.
I have a Asus RT-AC3200 router that links to my ONT to give me internet to the house. I have a raspberry pi 3 on Raspbian(port of debian 8) on the network monitoring my whole network and other things. I have a 3G usb dongle on my raspberry pi to sms me if there is a power outage at home (network is on a ups) and my router as a dual wan feature for any of my Ethernet ports or usb port for 3G modem usage as a failover if the network is down. Now what I am looking for is a solution that I can use to possible make my raspberry pi connect to the 3G modem and use that as a failover but only if the main internet is down. And disconnect when the main internet is back up but I need it to give internet to the network and also notify me once the main wan is down. How can I do this. I was thinking of catching the request from the router to the raspberry pi asking for internet the making the raspberry pi connect to the internet using the usb modem. Then when the router detects it has its main internet back it will switch back to that and then somehow it must stop asking the raspberry pi for internet thus making the raspberry pi disconnect from the 3G modem. I don't want the 3G network on all the time as this will cost more than the main internet. Any suggestions and simple explorations would help please. Also if you need more information please do ask.

jefro 05-02-2018 01:31 PM

I've had a few Asus routers and every one of them had the ability to use a usb modem as failover. I ran one that way for a year with a tmobile usb attached hotspot till the battery died.

However it may be possible to configure the pi to act in this but it will be rather complex I'd think. Some sort of ping maybe or other means to monitor and then a watch script to disconnect and tc command maybe to limit.

silent001 05-02-2018 02:06 PM

Thank you jefro. I am aware that it works. But I need to notify myself that it has gone over to the 3G and no longer on the normal fixed line. We all know that 3G data if left unmanaged on a normal uncapped network will end with huge $$$$$$$ at the end of the month. I did notice that I can use the lan port as failover and have the option for PPP and was thinking of maybe using the pi as a PPP server somehow and only connected over the 3G when the PPP credentials are supplied and when there is no request to disconnect. Like I say I am still very new to the networking thing and I need backup internet as I am not always home to sort it out but I want somehow to sort it out from anywhere. I already can VPN in on my network to sort out some internal issues but a VPN won't work if there is no internet.

silent001 05-02-2018 02:34 PM

Here is my thought process so far using the two options available for dual wan with failover built into the RT-AC3200:

Rpi3G = Raspberry Pi 3 with 3G modem
Router = Asus RT-AC3200 router

Option 1 (prefered):
1. Router connected to main internet
1.a Rpi3G connect as guest on network
2. Router lose internet
3. Router ask Rpi3G over Ethernet for internet.
3.a Rpi3G detect request and send sms
3.b Rpi3G connect to internet over 3G SUB
3.c Rpi3G give internet to router
3.d Rpi3G act as guest on network to other devices
4. Router on 3G internet
5. Router detect main internet return
6. Router connect to main internet
6.a Rpi3G disconnect 3G

Option 2:
Connect usb to router and use 3G as failover directly.
Use pi to test somehow if the router has gone over to 3G and send me sms notification soon change to and from 3G


All times are GMT -5. The time now is 04:05 PM.