All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Kierdelewicz <marek@piasta.pl>
To: Diogo Sperb Schneider <vonsperb@live.com>, netfilter@vger.kernel.org
Subject: Re: Routing HTTP Through Another Link
Date: Tue, 1 Sep 2009 07:55:06 +0200	[thread overview]
Message-ID: <20090901075506.478a8a6c@catlap> (raw)
In-Reply-To: <BLU116-W25EED7BAB4A40766109367A2F20@phx.gbl>

>Greetings!

Hello Diogo!

>I'd like to route my HTTP traffic (ports 80 and 443) through a separate
>link, but I'm not sure if I must use the ROUTE target or even how to

You can use policy routing with MARK:

iptables -t nat -A PREROUTING -i LAN_INTERFACE -m multiport --dport
80,443 -j MARK --set-mark 0x10
iptables -t nat -A POSTROUTING -o WWW_ONLY_LINK -j MASQUERADE

ip ru add fwmark 0x10 table 100 prio 100
ip ro add default via WWW_LINK_GW table 100

assumption: WWW_LINK_GW (gateway address of www-onlu link) is always
the same

Be sure to place MASQ rule before SNAT rule you've written about or
specify an output interface in SNAT rule.

You can find "ip" in "iproute2" package in any distro I think.

Best regards,
Marek

  reply	other threads:[~2009-09-01  5:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-31 18:30 Routing HTTP Through Another Link Diogo Sperb Schneider
2009-09-01  5:55 ` Marek Kierdelewicz [this message]
     [not found]   ` <BLU116-W61B4883A90045AEF7BDB6A2F10@phx.gbl>
     [not found]     ` <20090901135848.793936a7@catlap>
2009-09-01 16:42       ` Diogo Sperb Schneider
  -- strict thread matches above, loose matches on Subject: below --
2009-09-11 14:30 Diogo Sperb Schneider
2009-09-11 18:19 ` Diogo Sperb Schneider
2009-09-13  6:49 ` Marek Kierdelewicz

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=20090901075506.478a8a6c@catlap \
    --to=marek@piasta.pl \
    --cc=netfilter@vger.kernel.org \
    --cc=vonsperb@live.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.