From: Andrew Beverley <andy@andybev.com>
To: Evan Pierce <evan@pierce.co.za>
Cc: netfilter@vger.kernel.org
Subject: Re: Load Balancing issue
Date: Mon, 11 Apr 2011 18:46:44 +0100 [thread overview]
Message-ID: <1302544004.1551.8.camel@andybev> (raw)
In-Reply-To: <4DA2CB4D.2070402@pierce.co.za>
On Mon, 2011-04-11 at 11:35 +0200, Evan Pierce wrote:
> All I want to do is to get all port 80 and port 443 traffic to go up the
> 4mb adsl line and the rest can go up the 512kb line.
>
> I have the rules as follows:
>
I do a similar thing (successfully), so comparing my rules with yours:
> ip route add table 4 default via 192.168.1.1
>
I don't think it will make any difference, but I have the device as
well:
ip route add table 4 default dev eth4 via 192.168.1.1
> iptables -t mangle -A PREROUTING -p tcp --dport 80 -s 192.168.11.0/24 -j
> MARK --set-mark 4
> iptables -t mangle -A PREROUTING -p tcp --dport 443 -s 192.168.11.0/24
> -j MARK --set-mark 4
I think your marking is fine. You don't need to save the mark of the
connection as you're not bothered about the connection as a whole - all
packets on that connection will be marked regardless as they'll always
be going to the same port numbers. Packets returning aren't marked, but
you're not doing anything with them - they should just go back to the
source host.
> iptables -t nat -A POSTROUTING -o eth4 -j SNAT --to-source 192.168.1.2
> iptables -t nat -A POSTROUTING -o eth3 -j SNAT --to-source 197.213.0.42
> ip rule add fwmark 4 table 4
> ip route flush cache
>
Try in addition:
echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter
According to the HOWTO that I used
http://www.sysresccd.org/Sysresccd-networking_en_Iptables-and-netfilter-load-balancing-using-connmark
"You must also disable Reverse Path Filtering. It's an option enabled by
default that increases the security and prevents ip spoofing by checking
that the source address of the incoming packets matches the routing
table on the local machine"
Andy
prev parent reply other threads:[~2011-04-11 17:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-11 9:35 Load Balancing issue Evan Pierce
2011-04-11 12:31 ` John Lister
[not found] ` <4DA2FB80.4050306@pierce.co.za>
2011-04-11 15:37 ` John Lister
2011-04-11 16:23 ` Evan Pierce
2011-04-11 17:46 ` Andrew Beverley [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1302544004.1551.8.camel@andybev \
--to=andy@andybev.com \
--cc=evan@pierce.co.za \
--cc=netfilter@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).