Splitting traffic
Hi,
Several days ago I asked about splitting the traffic to the Net.
I have gotten it working, at least for splitting it according to the
destination. All it needs was the iproute2 package.
I have two servers that serving the Internet users; one is connected to
the Net via a wireless link, and the other via a modem. The web proxy is
run on the first server (and of course, the machine is default routed to
the wireless link).
I wanted to have the modem to add some additional
bandwidth, so I had to split the traffic so that some of it got routed
via the modem. The first machine IP is 192.168.1.x, and the second is
192.168.1.y. The command in 192.168.1.y (the one that has the modem, and
the modem is already up):
ip route add default dev ppp0 table modem
ip rule add from 192.168.1.x to <my parent proxy's IP> table modem
iptables -t nat -A POSTROUTING -o ppp0 -s 192.168.1.x \
-d <parent proxy> -j MASQUERADE
on the 192.168.1.x:
ip route add default via 192.168.1.y dev eth0 table modem
ip rule add to <parent proxy> table modem
The content of /etc/iproute2/rt_tables:
bdg:~# more /etc/iproute2/rt_tables
#
# reserved values
#
255 local
254 main
253 default
0 unspec
#
# local
#
1 wireless
2 modem
Basically, that's it.
Ideally, the split is done based on the protocol names, but I don't have
it running yet. (Iproute2 understands fwmark.)
Oki
Reply to: