I would like to try and build a load balancing ADSL router from cheap off the shelf parts. This might be something others would be interested in as Dual Wan routers are quite expensive and most only have a single built in modem with the second WAN ethernet interface requiring an additional modem.
Is anyone aware of any projects or ready built Pi Distros which will achieve the above. I have seen Pi routers using 3G modems but I would like to utilise two Thomson Speedtouch or similar, connected to the USB ports on the Pi. If I can get it to work I would disassemble the Thomson's and mount everything in a single case.
Possibly DD-Wrt or OpenWrt have a suitable image but I thought I would ask in this Forum first to see if the Pi can actually handle the connection and throughput of a USB modem.
Many thanks
Fozzie
-
- Posts: 6
- Joined: Mon Feb 23, 2015 11:26 am
Re: Raspberry Pi as dual Wan Router using 2 x USB Modems
I don't have a RPI using dual USB modems, but I do have my RPI using a WLAN connection as one WAN, and a tagged wired connection as the second WAN. Then my LAN connection goes out to my LAN untagged.
Using the scripts I have, it sounds like you may be able to get them to work on with the USB modems as well, as all you have to do is change the LAN/WAN interface names.
A screenshot of my Cacti graphs for the RPI is below:

If there is interest, I will certainly share what I did to get this to work.
--John
Using the scripts I have, it sounds like you may be able to get them to work on with the USB modems as well, as all you have to do is change the LAN/WAN interface names.
A screenshot of my Cacti graphs for the RPI is below:

If there is interest, I will certainly share what I did to get this to work.
--John
Re: Raspberry Pi as dual Wan Router using 2 x USB Modems
i would like to use my RPI as dual wan router. i do have 2 wifi usb modems attached to the rpi.
could you share with us the way to do it, please?
could you share with us the way to do it, please?
Re: Raspberry Pi as dual Wan Router using 2 x USB Modems
These are the scripts I use for my setup: http://www.jbarbieri.net/rpi/dual_wan/
firewall > goes into /etc/init.d
forwards.firewall, firewall.firewall, gwping, routes.firewall, wan1.script, and wan2.script all go into root directory.
edit /etc/init.d/firewall, and change the dhclient lines to match your two WAN interfaces (EG: Mine are wlan0 and eth0.12; change to your two interfaces)
in firewall.firewall and forwards.firewall, change laniface to match your lan interface.
Then all you have to do is make sure you LAN interface starts when the computer starts (in /etc/network/interfaces), and then run /etc/init.d/firewall start. That script will kill dhclient if running, launch with the new scripts for it, as well as flush the firewall and rebuild it, and the proper routing tables.
For any kind of port forwarding, you can make the changes in forwards.firewall, and re-run the firewall.firewall script (which calls forwards.firewall). The reason why you launch the first script is that the first script flushes the firewall out.
Good luck!
firewall > goes into /etc/init.d
forwards.firewall, firewall.firewall, gwping, routes.firewall, wan1.script, and wan2.script all go into root directory.
edit /etc/init.d/firewall, and change the dhclient lines to match your two WAN interfaces (EG: Mine are wlan0 and eth0.12; change to your two interfaces)
Code: Select all
update-rc.d firewall enable
Then all you have to do is make sure you LAN interface starts when the computer starts (in /etc/network/interfaces), and then run /etc/init.d/firewall start. That script will kill dhclient if running, launch with the new scripts for it, as well as flush the firewall and rebuild it, and the proper routing tables.
For any kind of port forwarding, you can make the changes in forwards.firewall, and re-run the firewall.firewall script (which calls forwards.firewall). The reason why you launch the first script is that the first script flushes the firewall out.
Good luck!
Re: Raspberry Pi as dual Wan Router using 2 x USB Modems
thanks a lot for the reply.
i have tried to have the eth0 as my LAN.
i have 2 usb wifi sticks that i would like to assign as wan interfaces.
May i ask for your /etc/network/interfaces please?
i am getting something wrong with the routes and default gateways.
i have tried to have the eth0 as my LAN.
i have 2 usb wifi sticks that i would like to assign as wan interfaces.
May i ask for your /etc/network/interfaces please?
i am getting something wrong with the routes and default gateways.
Re: Raspberry Pi as dual Wan Router using 2 x USB Modems
hello, is it possible to have the info so i could set it up, please?
Re: Raspberry Pi as dual Wan Router using 2 x USB Modems
Yes I am using it , with custom build of OpenWrt . I just edited few files to allow use of a cheap USB Ethernet card and configured MWAN3 .
You can find the guide here http://blog.arevindh.com/2016/05/19/loa ... pberry-pi/
You can find the guide here http://blog.arevindh.com/2016/05/19/loa ... pberry-pi/