From: Andrew Beverley <andy@andybev.com>
To: lartc@vger.kernel.org
Subject: Re: routing e dmz in multiple gw
Date: Sat, 29 Jun 2013 08:55:14 +0000 [thread overview]
Message-ID: <1372496114.3924.76.camel@andrew-desktop> (raw)
In-Reply-To: <13f75a91e3e.ninnig1@tin.it>
On Mon, 2013-06-24 at 12:09 +0200, ninnig1@tin.it wrote:
> hi, I have a big problem, I hope for your help.
> I have two balanced
> ADSL: ADSL 1 and ADSL 2. This is the script.
>
> #!/bin/bash
>
> ip route add
> xx.yy.205.200/255.255.255.248 dev eth0 src xx.yy.205.202 table ADSL1
> ip
> route add default via xx.yy.205.201 table ADSL1
>
> ip route add xx.yy.
> 246.176/255.255.255.248 dev eth1 src xx.yy.246.178 table ADSL2
> ip route
> add default via xx.yy.246.177 table ADSL2
>
> ip rule add from xx.yy.
> 205.202 table ADSL1
> ip rule add from xx.yy.246.178 table ADSL2
>
> ip
> route add 127.0.0.0/8 dev lo table ADSL1
> ip route add 127.0.0.0/8 dev
> lo table ADSL2
>
> ip route add default scope global nexthop via xx.yy.
> 205.201 dev eth0 weight 1 nexthop via xx.yy.246.177 dev eth1 weight 1
>
>
> ip route flush cache
>
> echo "0" > /proc/sys/net/ipv4/conf/all/rp_filter
>
> echo "0" > /proc/sys/net/ipv4/conf/eth0/rp_filter
> echo "0" >
> /proc/sys/net/ipv4/conf/eth1/rp_filter
> echo "0" >
> /proc/sys/net/ipv4/conf/eth2/rp_filter
>
> Ever since it was to balance
> the traffic out everything was fine. Now I have the need to publish a
> server on the LAN on the internet.
>
> The server in question
> (192.168.1.10) must be published with the address xx.yy.205.202 (ADSL1)
>
>
> I thought so to set the configuration:
>
> ip rule add fwmark 1 lookup
> ADSL1
>
> iptables -t nat -A POSTROUTING -s 192.168.1.10 -o eth2 -j MARK --
> set-mark 1
> iptables -t nat -A POSTROUTING -s 192.168.1.10 -o eth0 -j
> SNAT --to-source xx.yy.205.202
> iptables -t nat -A PREROUTING -p tcp -m
> tcp -d xx.yy.205.202/32 -i eth0 --dport 80 -j DNAT --to-destination
> 192.168.1.10:80
>
> This configuration don't work !!
> the server comes out
> once the correct interface and once the wrong one
You're marking the packets in POSTROUTING, but which time the routing
decision has already taken place. You'll need to mark them much earlier,
somewhere in PREROUTING.
Andy
next prev parent reply other threads:[~2013-06-29 8:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-24 10:09 routing e dmz in multiple gw ninnig1
2013-06-29 8:55 ` Andrew Beverley [this message]
2013-06-29 9:02 ` Andrew Beverley
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=1372496114.3924.76.camel@andrew-desktop \
--to=andy@andybev.com \
--cc=lartc@vger.kernel.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.