LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Web Server on private IP (http://www.linuxquestions.org/questions/linux-networking-3/web-server-on-private-ip-97202/)

lambmt 09-26-2003 01:05 PM

Web Server on private IP
 
I have my NAT set up and a web server inside the nat and i want to set it up so the nat forwards the web packets (port 80) to an address inside my internal network any help on that? .... RH9...

Looking_Lost 09-26-2003 04:23 PM

If everything else is good the a line like this will do it


iptables -t nat -A PREROUTING -p tcp -d my_external_ip_address -dport 80 -j DNAT --to-destination my_web_server_internal_ip

or swap

-d my_external_ip_address

for

-i eth0

or whatever card is the external one

lambmt 09-26-2003 08:19 PM

thanks will try it out and get back to ya!

lambmt 09-29-2003 01:55 PM

iptables -t nat -A PREROUTING -p tcp -d my_external_ip_address -dport 80 -j DNAT --to-destination my_web_server_internal_ip

i did this and got:

iptables v1.2.7a: multiple -d flags not allowed
Try `iptables -h' or 'iptables --help' for more information.

lambmt 09-29-2003 02:40 PM

got it the correct syntax is:

iptables -t nat -A PREROUTING -p tcp --dport 80 -i eth0 -j DNAT --to 192.168.0.8

if that helps ne one other than me !


All times are GMT -5. The time now is 07:15 PM.