Re: Dynamic IP port forwarding

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 
> 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 that
port):

OUT_DEV=ppp0      # 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 suggest
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.

-- 
"Mr Data, when I said 'Fire at Will', I didn't mean for you to be so literal."
Instructions for use of this post: Insert tounge in cheek. Read as normal.

Attachment: pgp00341.pgp
Description: PGP signature


[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux