All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ulysses Almeida <ulysses.almeida@gmail.com>
To: 189@telia.com
Cc: netfilter@lists.netfilter.org
Subject: Re: Two Internet Connections send port 80 on one interface and rest on another
Date: Thu, 20 Jan 2005 09:09:28 -0300	[thread overview]
Message-ID: <d64535605012004091d48725a@mail.gmail.com> (raw)
In-Reply-To: <200501200644.20040.tommy@svearike.sytes.net>

On Thu, 20 Jan 2005 06:44:20 +0100, Tommy W <tommy@svearike.sytes.net> wrote:
> Hi.
Hi.

> I have 2 internetconnections (eth0 and eth2) and a local net (eth1)
> as it is now I have eth1 masqueraded behind eth0 so all internet activity
> is used on eth0 . But now I want port 80 to be "redirected" to eth2 in order
> to always get good speed on http.
> How can I do this ?
You'll need multiple routing tables.

> 
> as a matter of fact I can't get the machine to listen on both ips :(
> I do
> $ route add default gw $ETH2_GW
> $ route add default gw $ETH0_GW
> but that really messes things up.
Yes, don't do it with route, do it with iproute2
Something like:

echo 100 slink >> /etc/iproute2/rt_tables      #Only the first time
ip route add default via $ETH2_GW dev eth2 table slink

And then, you'll need to add other routes, like route to your own eth2
network and so on. After doing this, you'll create some rule, to make
http connections altk trhough eth2.

iptables -t mangle -m tcp -A PREROUTING -p tcp -s <lan> --dport 80 -j
MARK --set-mark 0x02
ip rule add fwmark 0x02 lookup slink

> 
> What decides which ip is to be used first (outbound locally)
> say if I do ping www.helgon.net
> what decides which ip I get?
Always the default gateway. But you can have only one. Or with
iproute2 only one per table. ;)

> is it the first default route in the $ route   list?
> is it the first ethX device?
> I'm lost.. :(
> please send me some links, or even better. A working solution :)
To be clearer, visit
http://www.lartc.org/howto/

This week I start to write a mini-HowTo about this, and it's
inconplete yet... But can help you.
https://lists.netfilter.org/pipermail/netfilter/2005-January/058112.html

Regards

-- 
 - Ulysses Almeida


      reply	other threads:[~2005-01-20 12:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-20  5:44 Two Internet Connections send port 80 on one interface and rest on another Tommy W
2005-01-20 12:09 ` Ulysses Almeida [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=d64535605012004091d48725a@mail.gmail.com \
    --to=ulysses.almeida@gmail.com \
    --cc=189@telia.com \
    --cc=netfilter@lists.netfilter.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 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.