iptables 转ftp端口
iptables 转ftp端口
#iptables 转ftp端口 /etc/sysconfig/iptables-config文件结尾加ftp支持,顺序不能改 cat >>/etc/sysconfig/iptables-config<<EOF IPTABLES_MODULES="ip_conntrack_ftp" IPTABLES_MODULES="ip_nat_ftp" EOF sysctl -w net.ipv4.ip_forward=1 modprobe ip_conntrack_ftp modprobe ip_nat_ftp iptables -t nat -A PREROUTING -p tcp --dport 22222 -j DNAT --to-destination 192.168.0.20:21 iptables -t nat -A POSTROUTING -p tcp --dport 21 -j MASQUERADE