netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Lennart Sorensen <lsorense@csclub.uwaterloo.ca>
Cc: W Agtail <wagtail@iol.ie>, netdev@vger.kernel.org
Subject: Re: two gateways with one NIC
Date: Mon, 09 Apr 2007 18:13:50 +0200	[thread overview]
Message-ID: <461A663E.4050904@trash.net> (raw)
In-Reply-To: <20070409161142.GC2299@csclub.uwaterloo.ca>

Lennart Sorensen wrote:
> On Mon, Apr 09, 2007 at 04:56:20PM +0100, W Agtail wrote:
> 
>>Hi there, and thanks v. much for getting back to me on this one.
>>I now have changed iptables on the web servers to the following:
>>
>>iptables -t mangle -A POSTROUTING -p tcp --sport 8088 -o eth0 -j MARK
>>--set-mark 1
>>iptables -t mangle -A POSTROUTING -p tcp --sport 8089 -o eth0 -j MARK
>>--set-mark 2
>>
>>But I'm still seeing traffic being returned via gw2 for port 8088 :(
>>Any ideas? Thanks.
> 
> 
> Hmm, I know I have done something like this before (I made all port 80
> traffic return through another host rather than the default gateway, but
> it was about 3 years ago and I don't remember the exact syntax).


As the name suggests, POSTROUTING comes after routing, so marking
packets there doesn't affect routing. Use PREROUTING for forwarded
traffic and OUTPUT for locally generated traffic.


  reply	other threads:[~2007-04-09 16:13 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-08  3:35 two gateways with one NIC W Agtail
2007-04-08 15:01 ` Lennart Sorensen
2007-04-08 16:10   ` W Agtail
2007-04-08 18:22     ` Lennart Sorensen
2007-04-08 19:29       ` W Agtail
2007-04-09 14:54         ` Lennart Sorensen
2007-04-09 15:56           ` W Agtail
2007-04-09 16:11             ` Lennart Sorensen
2007-04-09 16:13               ` Patrick McHardy [this message]
2007-04-09 16:19                 ` Lennart Sorensen
2007-04-09 17:02                   ` W Agtail
2007-04-09 17:14                     ` Patrick McHardy
2007-04-09 17:23                     ` Lennart Sorensen
2007-04-09 18:05                       ` W Agtail
2007-04-09 18:11                         ` Ben Greear
2007-04-10 13:46                           ` W Agtail
2007-04-10 15:32                             ` Ben Greear
2007-04-11 15:38                               ` W Agtail
2007-04-09 18:11                         ` Lennart Sorensen
2007-04-09 18:24                           ` W Agtail
2007-04-09 21:23                             ` Lennart Sorensen

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=461A663E.4050904@trash.net \
    --to=kaber@trash.net \
    --cc=lsorense@csclub.uwaterloo.ca \
    --cc=netdev@vger.kernel.org \
    --cc=wagtail@iol.ie \
    /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).