T
T
tikhonov_y_v2015-03-28 20:44:37
Computer networks
tikhonov_y_v, 2015-03-28 20:44:37

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

1 answer(s)
S
Sergey Petrikov, 2015-03-28
@RicoX

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>

for iptables here are the options help.ubuntu.ru/wiki/ip_balancing

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question