Answer the question
In order to leave comments, you need to log in
How to set up a computer as a router with two Internet lines?
Two Internet lines enter the office, respectively, two routers. I want to know if it is possible to put a computer to which both Internet lines will be connected and distribute the Internet to other computers via Wi-Fi. Those. the question is precisely to combine the speed of the two lines. How to do it? It seems to have heard that on Linux there is an opportunity to configure everything like that? And how to distribute Wi-Fi from a computer?
Answer the question
In order to leave comments, you need to log in
It will not work to completely combine the speed of 2 lines, for this you need BGP + MPLS-TE, but you can distribute the Internet to part of the clients from one line, and parts from the other, for this we distribute clients between channels by NAT rules, you can even do dynamic distribution, such as in randomly each new customer into your channel in a circle. Internet distribution via wifi is easiest to set up through hostappd.
An example of dynamic NAT over 2 links on pf
cat /etc/pf.conf
set limit states 128000
set optimization aggressive
#Интерфейсы на каналы, если есть алиасы можно задать IP
ext_if1="vlan100" #Kanal1
ext_if2="vlan200" #Kanal2
#Шлюз для каждого канала
ext_gw1="192.168.88.1"
ext_gw2="192.168.89.1"
#На какие адреса мы не будем nat'ить.
table <no_nat> const { 192.168.0.0/16 10.0.0.0/16 }
#Нормализуем трафик
scrub in all
#Натим поочередно пользователей через каждый из каналов.
nat from 10.0.0.0/20 to !<no_nat> -> { ($ext_if1) ($ext_if2) } round-robin sticky-address
pass out on $ext_if1 route-to ($ext_if2 $ext_gw2) from $ext_if2 to !<no_nat>
pass out on $ext_if2 route-to ($ext_if1 $ext_gw1) from $ext_if1 to !<no_nat>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question