Proper way to setup DNAT to servers inside a different internal
charles at aib.net
Mon Apr 18 12:34:03 CEST 2005
My boss has need me to setup a DNAT at the gateway into a LAN server =
an IPSec VPN, which is not at the same network as the pub gateway. That
create a big problem! I hope someone can help me!
The pub gateway is a RedHat 8.0 Linux with kernel 2.4.18, iptables =
126.96.36.199 is the public ip at the pub gateway
10.8.1.88 is the internal network address of the pub gateway
and 10.8.2.99 is the internal network of the LAN server
the vpn gateway at the LAN network is also the LAN gateway, has its own
broadband connection connect to the Internet
We need to forward at least (will be more in the future) HTTP, FTP, PPTP
traffic at 188.8.131.52 into the LAN server!!
I try to draw the network config here:
[Internet client] <--> (eth0:184.108.40.206) [pub gateway] (eth1:10.8.1.88)
<-(VPN)-> [vpn gateway] (eth1:10.8.2.1) <-LAN->(eth0:10.8.2.99) LAN =
I've successfully make half the way by using DNAT and SNAT:
iptables -t nat -A PREROUTING -i eth0 -d 220.127.116.11 -j DNAT --to =
iptables -t nat -A POSTROUTING -d 10.8.2.99 -j SNAT --to-source =
- Internet client connect to 18.104.22.168 http can connect to the LAN =
browsing webpage is ok, but when doing a HTTP post upload it fails by =
period of time and then browser report webpage not found!
- Internet client connect to 22.214.171.124 ftp can connect to the LAN =
but ftp cannot start file transfer with both active/passive mode!
- Internet client connect to 126.96.36.199 PPTP can connect to the LAN =
and start the pptp vpn connection, strange?
Am I missing something?
Thanks a lot!
I am using the free version of SPAMfighter for private users.
It has removed 23251 spam emails to date.
Paying users do not have this message in their emails.
Try www.SPAMfighter.com for free now!
More information about the netfilter