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

Re: Masquerade and DNAT with iptables



On Sat, 2003-05-24 at 01:44, Liviu Marciu wrote:
> Hello,
> I have a linux box that is connected to internet with a pptp
> connexion. This box is the gateway that connects my Lan to the
> internet using Maquerade and iptables.
> 
> How can i make a webserver form my Lan visible from the internet ?
> I want to redirect port 8080 from the linux box to the 192.168.0.222
> ip address port 80.

# Some port and ip address definitions
HTTP_PORT="80"
PF_HTTP_PORT="8080"
INET_IFACE="eth0"
LINUX_SERVER_IPADDR="192.168.0.222"

# DNAT (port forwarding)
$IPTABLES -t nat -A PREROUTING -i $INET_IFACE -p tcp --dport $PF_HTTP_PORT \
    -j DNAT --to-destination $LINUX_SERVER_IPADDR:$HTTP_PORT

HTH
Regards.
Mark.



Reply to: