From: "Martin A. Brown" Date: Wed, 17 Jul 2002 17:18:17 +0000 Subject: Re: [LARTC] Routing private and non-private ips Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: lartc@vger.kernel.org Lucky, : Well, there comes something to my mind: All of the 192.168.2.0/24 gets : masq'ed to the internet on the router. I think I somehow have to exclude : 192.168.2.206 (the pr.iv.at.ip) from the masq'ing, right? : Or is the best solution to put the to-be-NATed server in another subnet : (192.168.4.0/24) for example? Perhaps you could insert a new rule with ipchains or iptables. So, you have something in your chains rules that looks like this: ipchains -A forward -s 192.168.2.0/24 -d 0/0 -j MASQ Simply insert a special case: ipchains -I forward 1 -s 192.168.2.206 -d 0/0 -j ACCEPT Then the packet will not be masqueraded and will be handled by whatever=20 other packet mangling rules you have (in particular, it will be NAT'd=20 by the rule policy database). To verify that the RPDB has the rules you=20 inserted, try this (your output should look similar to this; filled in=20 with the correct pu.bl.ic.ip, of course): # ip rule show 0: from all lookup local 32765: from 192.168.2.206 lookup main map-to pu.bl.ic.ip 32766: from all lookup main=20 32767: from all lookup 253 # ip route show table all | grep nat nat pu.bl.ic.ip via 192.168.2.206 table local scope host Rules in both iptables and ipchains are handled sequentially, so you want=20 to create the more specific chains rules first and then the more general. = This prevents the general rule from matching before the specific rule is=20 used. Freundliche gr=FCsse, -Martin --=20 Martin A. Brown --- SecurePipe, Inc. --- mabrown@securepipe.com _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/