[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 547
  • Last Modified:

TC and Iptables - Load balancing 3 providers outbound.

I am looking for a script that can load balance traffic outbound with tc and iptables between three different connections.
I am using nat on the internal interface eth3, and I need to send and balance out to three other connections eth0-2. I would appreciate any help anyone can give me.

0
jon37325
Asked:
jon37325
  • 2
2 Solutions
 
pablouruguayCommented:
0
 
jon37325Author Commented:
The only problem is that route and random are not supported anymore in the 2.6 kernel.
0
 
ParacelsiusCommented:
Hi jon37325

instead of -j ROUTE you can MARK the packets an user policy based routing using ip:

ex.:
iptables -t mangle -A PREROUTING -i eth1 -p tcp --sport 1000 -j MARK --set-mark 5

ip route add default via 192.168.0.1 table linkB
ip rule add fwmark 5 table linkB

regards,
pC


0
 
jon37325Author Commented:
so what would the entire script look like? please give an example.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now