Answer the question
In order to leave comments, you need to log in
Channel balancing in linux?
Task: we have ubuntu server 10.04, and two internet channels. Channel A is fast but with gray ip, channel B is slow but with white ip. It is necessary that all outgoing connections go through channel A, but if there is an incoming connection from channel B, then it is necessary that the response goes to channel B. Is it possible to implement this?
Answer the question
In order to leave comments, you need to log in
It is necessary to make 2 separate routing tables for each channel with different default routes.
Next, using iptables, we
mark
the necessary packets depending on your wishes and send them to one or another routing table using ip route
.
dport 53 -j MARK --set-mark 2 # turn all packets with
mark 2 into germany routing table
ip rule add fwmark 2 table germany
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question