执行命令:
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -F
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
报: Couldn't load target `MASQUERADE':No such file or directory
查看iptable 源码发现:在加载target时,需要XTABLES——LIBDIR的环境变量: xtables_libdir = getenv("XTABLES_LIBDIR");
添加环境变量:
export XTABLES_LIBDIR=/lib/xtables
阅读(2765) | 评论(0) | 转发(0) |