标签:-o ipv4 str 转发 smo ftp put -- ble
1.内核转发打开2.iptables的filter表的FORWARD链允许转发
iptables -L -n
iptables -P FOPWARD ACCEPT
iptables -P INPUT ACCEPT 清空
iptables -F
3.nat模块查看
lsmod | egrep ^ip
modprobe ip_tables
modprobe iptable_filter
modprobe iptable_nat
modprobe ip_conntrack
modprobe ip_conntrack_ftp
modprobe ip_nat_ftp
modprobe ipt_state
4.有固定外网地址:
iptables -t nat -A POSTROUTING -s 172.16.0.0/24 -o eth2 -j SNAT --to-source 192.168.56.151
-s 172.16.0.0/24 要上外网的网段
-o eth2 为网关的外网卡接口
-j SNAT --to-source 192.168.56.151 网关外网卡IP
5.变动外网地址:
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -j MASQUERADE
标签:-o ipv4 str 转发 smo ftp put -- ble
原文地址:http://blog.51cto.com/14033037/2306742