P
P
p1nger2011-10-01 12:55:33
linux
p1nger, 2011-10-01 12:55:33

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

2 answer(s)
P
polyakstar, 2011-10-01
@p1nger

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

V
vitroot, 2012-01-24
@vitroot

IP1=`/sbin/ifconfig $IF1 | grep “inet addr:” | cut ­d ” ” ­f 12 | cut ­d “:” ­f 2`
P1=`/sbin/ifconfig $IF1 | grep “inet addr:” | cut ­d ” ” ­f 14 | cut ­d “:” ­f 2`

I didn’t understand something, where did 12 or 14 fields come from

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question