From: "Vlado Drz(ík" <vlado@ttx.sk>
To: Maxim Koshelev <chuchelo@gmail.com>
Cc: netfilter@vger.kernel.org
Subject: Re: SNAT and multiple ISP problem
Date: Mon, 27 Apr 2009 12:14:25 +0200 [thread overview]
Message-ID: <49F58581.3020705@ttx.sk> (raw)
In-Reply-To: <40e8da40904260645x601a22a4obb942a30e3428d31@mail.gmail.com>
Maxim Koshelev wrote / napísal(a):
> Hi all,
> I have a problem that I can't find working way to do some kind of load
> balance beetween two internet channels using SNAT. I've tried various
> schemes to do this but in all of them kernel makes wrong routing.
> For example if I try to add such rules in nat:
>
> iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to $ETH0IP
> iptables -t nat -A POSTROUTING -o ppp0 -j SNAT --to $PPP0IP
>
> kernel will do SNAT only according default route in table main. It is
> ok. But if I try to change default routing selection (e.g. by adding
> in 'mangle' table some marks and adding 'ip rules' with this marks)
> kernel begins to route some packets nated to ppp0 into eth0 and
> vice-versa! I can simple monitor this ugly behavior using tcpdump. It
> brings to lost packets and connections drops ( because one of IP's is
> 192.168... but second one is real )
>
> Is there any way to make right routing?
Please post your routing table and mark setup. For me it seems that you
don't have routing tables setup up correctly (or is not doing what you
want). For example imcomming packets that are marked are using
alternative routing table and that doesn't include your internal network
routes (and so is sent outside to default route after un-NATing).
Regards,
Vlado.
next prev parent reply other threads:[~2009-04-27 10:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-26 13:45 SNAT and multiple ISP problem Maxim Koshelev
2009-04-27 10:14 ` Vlado Drz(ík [this message]
[not found] ` <1240817530.16720.7.camel@casper.meteor.dp.ua>
2009-04-27 16:54 ` Vlado Držík
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=49F58581.3020705@ttx.sk \
--to=vlado@ttx.sk \
--cc=chuchelo@gmail.com \
--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