Port forwarding from Internet to lan webserver

Hello,

I try to access my webserver in lan from internet. I try to forwarding internet 81 port from my server to my lan pc port 80, so in that way i could access my lan webserver from internet in this way: http://my_server_ip:81/ I have debian installed in my server and try to config iptables in this way:

eth0 - internet eth1 - lan

iptables -t nat -A PREROUTING -i eth0 -p tcp --sport 81 j DNAT

--to-destination 192.168.1.2:80

i try some other configuraion witch i found by google, but no one worked.

Could you help me to solve this problem?

Reply to
Wyrda
Loading thread data ...

Yeah, you should get something that's less complicated.

Duane :)

Reply to
Duane Arnold

formatting link

[TXT] NAT-HOWTO.txt 17-Oct-2004 14:34 25K

^^^^^^^^^^

So you will take packets that come from some host on the internet that are _sourced_from_ port 81, and send them on. Sorry - not going to work. Try

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 81 j DNAT

--to-destination 192.168.1.2:80

The web site above will help. Last I checked, it had seven different HOWTOs in several languages. By the way, "it doesn't work" is a rather useless description, that tells nothing. You have to look, and report what is in the logs and error messages. Did the computer catch fire? That might tell someone what you did wrong.

Old guy

Reply to
Moe Trin

Cabling-Design.com Forums website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.