Configuring Linux

This example is for Linux kernel version 2.2.x with ipchains and ipmasqadm. The examples below assume that your FTP server has local address 192.168.1.2.

First we need to enable NAT for our FTP server. As root user:

  echo "1">/proc/sys/net/ipv4/ip_forward
  ipchains -P forward DENY
  ipchains -I forward -s 192.168.1.2 -j MASQ

Now we load the autofw kernel module and forward ports 20 and 21 to the FTP server:

  insmod ip_masq_autofw
  ipmasqadm autofw -A -r tcp 20 21 -h 192.168.1.2

Then we forward ports for Passive FTP. In our etc/proftpd.conf file we restriced passive ports to 60000-65535, so that's what we'll use here:

  ipmasqadm autofw -A -r tcp 60000 65535 -h 192.168.1.2

Now you can try to login to your FTP server from a computer on the Internet!

Рейтинг@Mail.ru