All of lore.kernel.org
 help / color / mirror / Atom feed
* Two Internet Connections send port 80 on one interface and rest on another
@ 2005-01-20  5:44 Tommy W
  2005-01-20 12:09 ` Ulysses Almeida
  0 siblings, 1 reply; 2+ messages in thread
From: Tommy W @ 2005-01-20  5:44 UTC (permalink / raw)
  To: netfilter

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 ?

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.

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?
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 :)
Thanks


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Two Internet Connections send port 80 on one interface and rest on another
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Ulysses Almeida @ 2005-01-20 12:09 UTC (permalink / raw)
  To: 189; +Cc: netfilter

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-01-20 12:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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.