From: =?iso-8859-15?q?Aur=E9lien_MALO?= Date: Wed, 01 Jun 2005 12:23:12 +0000 Subject: [LARTC] SNAT (or MASQUERADING) and DNAT question Message-Id: <200506011423.12949.amalo@cerdd.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: lartc@vger.kernel.org Hi, The private adresses (192.168.254.0/255.255.255.0) of my network are sent=20 dynamically by dhcp on my network. The dhcp server is on the firewall which= =20 address is 192.168.254.1/255.255.255.255 (this address is static). I've got a rsync server on this network which is on a separe server. His=20 address is 192.168.254.200/255.255.255.255 (this address is static). I want that the users of the private network can make a rsync request to th= e=20 firewall, and the firewall forward the request to the rsync server=20 transparently. For the moment, I can do it with shorewall but only by specifying the clien= t=20 adress. I'm using masquerading and DNAT rule, in the example the client=20 address is 192.168.254.107/255.255.255.255 : >masq file eth0 192.168.254.107/32 192.168.254.254 eth0 192.168.254.200/32 192.168.254.254 >rules file DNAT loc:192.168.254.107 loc:192.168.254.100 udp 873 - DNAT loc:192.168.254.100 loc:192.168.254.107 udp 873 - DNAT loc:192.168.254.107 loc:192.168.254.100 tcp 873 - DNAT loc:192.168.254.100 loc:192.168.254.107 tcp 873 - So I would prefer to redirect all rsync traffic from network. An other=20 important thing is that all my harware are on the same subnet (gateway,=20 server, workstations). I've tried to use SNAT and DNAT ipatbles rules to do that but without any=20 succes : iptables -t nat -A POSTROUTING -d 192.168.254.1 -o eth0 -p tcp --dport 873 = -j=20 SNAT --to-source 192.168.254.1 iptables -t nat -A POSTROUTING -d 192.168.254.1 -o eth0 -p udp --dport 873 = -j=20 SNAT --to-source 192.168.254.1 iptables -t nat -A PREROUTING -d 192.168.254.1 -p tcp --dport 873 -j DNAT=20 --to-destination 192.168.254.200 iptables -t nat -A PREROUTING -d 192.168.254.1 -p udp --dport 873 -j DNAT=20 --to-destination 192.168.254.200 How can i do this ? Does I have to mark the packets ? Thanks in advance for any help, link, ... --=20 Aur=E9lien MALO - amalo@cerdd.org T=E9l. bureau : 03 21 08 52 42 - T=E9l. port : 06 21 54 23 80 CEntre Ressource du D=E9veloppement Durable _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc