Load Balancing WAN using NFTables

Kernels & Hardware, configuring network, installing services

Load Balancing WAN using NFTables

Postby blee » 2020-04-20 00:41

I use 2 cellular connections; WWAN0 and WWAN1
Using Debian Buster
NFTables
all latest updates

So far I have route setup for nexthop:
Code: Select all
root@raspberrypi:/home/pi# ip route show
default
        nexthop via 100.195.xx.xx dev wwan0 weight 100
        nexthop via 10.71.yy.yy dev wwan1 weight 100
default via 10.71.yy.yy dev wwan1 proto dhcp src 10.71.yy.yz metric 20
default via 100.195.xx.xx dev wwan0 proto dhcp src 100.195.xx.xz metric 20
10.10.1.0/24 dev eth0 proto kernel scope link src 10.10.1.1
10.71.yy.yy/30 dev wwan1 proto kernel scope link src 10.71.yy.yz
10.71.yy.yy dev wwan1 proto dhcp scope link src 10.71.yy.yz metric 20
100.195.xx.xx/30 dev wwan0 proto kernel scope link src 100.195.xx.xz
100.195.xx.xx dev wwan0 proto dhcp scope link src 100.195.xx.xz metric 20


I am looking to load balance these connections and at the moment it is working. I added them manually using nexthop gateway. when I restart, I will not know the nexthop gateway until i check and manually add again, with this command:
Code: Select all
ip route add default scope global nexthop via xxx.xxx.xxx.xxx dev wwan0 weight 100 nexthop via yyy.yyy.yyy.yyy dev wwan1 weight 100


I am open to other suggestions on how to achieve a decent load balancer. I would like to stay efficient as possible with little processing and memory use.
If anyone is slick with writing scripts and knows of one I can use to call for the next hop gateway to run on startup. I would be humbled if you could share.

Thank you
blee
 
Posts: 3
Joined: 2020-03-29 03:40

Re: Load Balancing WAN using NFTables

Postby Head_on_a_Stick » 2020-04-20 12:08

Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12747
Joined: 2014-06-01 17:46
Location: /dev/chair


Return to System configuration

Who is online

Users browsing this forum: No registered users and 15 guests

fashionable