All of lore.kernel.org
 help / color / mirror / Atom feed
* Routing HTTP Through Another Link
@ 2009-08-31 18:30 Diogo Sperb Schneider
  2009-09-01  5:55 ` Marek Kierdelewicz
  0 siblings, 1 reply; 6+ messages in thread
From: Diogo Sperb Schneider @ 2009-08-31 18:30 UTC (permalink / raw)
  To: netfilter


Greetings!

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 use it.
My main link has it's own static IP address, so I have SNAT doing the address translation. (working)

My second link is a dynamic-IP DSL, so I believe NAT rules will need MASQUERADE instead.

Could somebody please post a sample ruleset that does the trick?

Many thanks in advance.

Best regards,
Diogo


_________________________________________________________________
Acesse seu Hotmail de onde quer que esteja através do celular. Clique aqui.
http://www.windowslive.com.br/celular/home.asp?utm_source=MSN_Hotmail&utm_medium=Tagline&utm_campaign=MobileServices200908

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Routing HTTP Through Another Link
@ 2009-09-11 14:30 Diogo Sperb Schneider
  2009-09-11 18:19 ` Diogo Sperb Schneider
  2009-09-13  6:49 ` Marek Kierdelewicz
  0 siblings, 2 replies; 6+ messages in thread
From: Diogo Sperb Schneider @ 2009-09-11 14:30 UTC (permalink / raw)
  To: netfilter

Greetings!

I gave up on that old web-based firewall and now I'm running plain
CentOS 4.8 with 3 ethernet adapters:

eth0 = LAN
eth1 = WAN
eth2 = ADSL

So I tried the following:

ip route add default via 189.30.16.65 dev eth1 table WAN # < 1 in
/etc/iproute2/rt_tables
ip route add default via 192.168.2.1 dev eth2 table ADSL # < 2 in
/etc/iproute2/rt_tables
ip rule add from all fwmark 1 table WAN
ip rule add from all fwmark 2 table ADSL
iptables -t mangle -I PREROUTING -i eth0 -p tcp --dport 80 -j MARK
--set-mark 2 # Tried with -I and -A with same effect

(Got those from the Linux Advanced Routing mini HOWTO)

Still, when I browse IP detection websites I get my WAN IP address.

Just for the record; My other relevant netfilter rules are:

iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to-source
189.30.16.66 # <- my adapter's IP address
iptables -t nat -A POSTROUTING -o eth2 -j SNAT --to-source
192.168.2.254 # <- my adapter's IP address
iptables -A FORWARD -i eth0 -p tcp --dport 80 -j ACCEPT # HTTP

Many thanks for reading!

Diogo

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

end of thread, other threads:[~2009-09-13  6:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-31 18:30 Routing HTTP Through Another Link Diogo Sperb Schneider
2009-09-01  5:55 ` Marek Kierdelewicz
     [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

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.