From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Alexander W. Janssen" Subject: Re: Dynamic IP port forwarding Date: Wed, 19 Feb 2003 20:41:39 +0100 Sender: netfilter-admin@lists.netfilter.org Message-ID: <20030219194139.GA12955@ynfonatic.de> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BXVAT5kNtrzKuDFl" Return-path: Content-Disposition: inline In-Reply-To: Errors-To: netfilter-admin@lists.netfilter.org List-Help: List-Post: List-Subscribe: , List-Id: List-Unsubscribe: , List-Archive: To: Dan Egli Cc: netfilter@lists.netfilter.org --BXVAT5kNtrzKuDFl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 19, 2003 at 11:30:55AM -0700, Dan Egli wrote: > I have a dynamic IP generated by my ISP. How do I forward a port from the= =20 > outsite to a machine inside when I have a dynamic IP? Example: You like to forward all http (80/tcp) traffic to your internal machine 192.168.4.99 and to port 918/tcp (because your Apache listens to th= at port): OUT_DEV=3Dppp0 # Adapt to the name of your interface, not the IP! iptables -t nat -A PREROUTING -i $OUT_DEV -p tcp --dport 80 -j DNAT \ --to-destination 192.168.4.99:918 That's all. No more magic. You just have to know your device. Not the IP. That's the real magic. If you want to use UDP you have to change the -p statement, but you almost know that, because you are going to read a tutorial, aren't you? :-) I sugg= est you reading that HOWTO: http://www.netfilter.org/documentation/tutorials/blueflux/ But anyway, you can write to the list again if you need further help :) Good luck and have fun, Alex. --=20 "Mr Data, when I said 'Fire at Will', I didn't mean for you to be so litera= l." Instructions for use of this post: Insert tounge in cheek. Read as normal. --BXVAT5kNtrzKuDFl Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: Weitere Infos: siehe http://www.gnupg.org iEYEARECAAYFAj5T3fMACgkQEMMZKORQoYLg9wCeIpMDAb70pLf5LbzTmbTFGAri FOkAnjRd42M1vjh510wVUmMbG3dH4Cj2 =olXS -----END PGP SIGNATURE----- --BXVAT5kNtrzKuDFl--