Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Marcin Giedz <marcin.giedz@eulerhermes.pl>
To: Marcin Giedz <marcin.giedz@eulerhermes.pl>
Cc: netfilter@lists.netfilter.org
Subject: Re: Forward port 80 (www) to other router..
Date: Sun, 20 Feb 2005 10:50:08 +0100	[thread overview]
Message-ID: <42185D50.8030601@eulerhermes.pl> (raw)
In-Reply-To: <200502181838.40615.marcin.giedz@eulerhermes.pl>

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


      reply	other threads:[~2005-02-20  9:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-18 17:38 Forward port 80 (www) to other router Marcin Giedz
2005-02-20  9:50 ` Marcin Giedz [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=42185D50.8030601@eulerhermes.pl \
    --to=marcin.giedz@eulerhermes.pl \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox