All of lore.kernel.org
 help / color / mirror / Atom feed
* Forward port 80 (www) to other router..
@ 2005-02-18 17:38 Marcin Giedz
  2005-02-20  9:50 ` Marcin Giedz
  0 siblings, 1 reply; 2+ messages in thread
From: Marcin Giedz @ 2005-02-18 17:38 UTC (permalink / raw)
  To: netfilter

Hello..

Here is the problem: I have two routers connected to two different providers. 
Both routers have internal interfaces in my LAN.

router1
provider1<----------->eth0---------linux---------eth1<------------>LAN 
(192.168.49.101)
router2
provider2<----------->eth0---------linux---------eth1<------------>LAN 
(192.168.49.10)

Nowadays all clients in LAN have set up router1 as the default gateway so all 
traffic is forwarded to this router1 (www e.g.). Now I'd like to forward all 
www traffic to router2 from all my clients. I know this should be done on 
router1 with some iptables rules but I'm rather fresh in netfilter so if it 
possible please help me ;)

Thanks,
Marcin


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

* Re: Forward port 80 (www) to other router..
  2005-02-18 17:38 Forward port 80 (www) to other router Marcin Giedz
@ 2005-02-20  9:50 ` Marcin Giedz
  0 siblings, 0 replies; 2+ messages in thread
From: Marcin Giedz @ 2005-02-20  9:50 UTC (permalink / raw)
  To: Marcin Giedz; +Cc: netfilter

Użytkownik Marcin Giedz napisał:

>Hello..
>
>Here is the problem: I have two routers connected to two different providers. 
>Both routers have internal interfaces in my LAN.
>
>router1
>provider1<----------->eth0---------linux---------eth1<------------>LAN 
>(192.168.49.101)
>router2
>provider2<----------->eth0---------linux---------eth1<------------>LAN 
>(192.168.49.10)
>
>Nowadays all clients in LAN have set up router1 as the default gateway so all 
>traffic is forwarded to this router1 (www e.g.). Now I'd like to forward all 
>www traffic to router2 from all my clients. I know this should be done on 
>router1 with some iptables rules but I'm rather fresh in netfilter so if it 
>possible please help me ;)
>
>Thanks,
>Marcin
>
>
>  
>
Hello again ;)

I think my problem is solved with iptables and iproute2 (ip) - mainly 
taken from transparent proxy - THANKSSSS
And here is the solution:

on router1 put:
iptables -t mangle -A PREROUTING -j MARK --set-mark 3 -p tcp --dport 80 
-s 192.168.49.9 (192.168.49.9 is my internal router, behind him there 
are all my clients)
ip rule add fwmark 3 table 2
ip route add default via router2_eth1_address dev eth1 table 2

That is all.
Now I have main router (router1) for other than port 80 traffic and 
router2 for port 80 traffic.

Thanks,
Marcin


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

end of thread, other threads:[~2005-02-20  9:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-18 17:38 Forward port 80 (www) to other router Marcin Giedz
2005-02-20  9:50 ` Marcin Giedz

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.