简单的共享上网,eth1接内网,eth0是动态ip
#!/bin/sh
IPT='/usr/local/sbin/iptables' $IPT -F $IPT -X $IPT -P FORWARD DROP $IPT -P INPUT DROP $IPT -P OUTPUT ACCEPT $IPT -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT $IPT -A FORWARD -i eth1 -j ACCEPT $IPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT $IPT -A INPUT -i lo -j ACCEPT $IPT -A INPUT -i eth1 -j ACCEPT $IPT -t nat -F $IPT -t nat -X $IPT -t nat -P PREROUTING ACCEPT $IPT -t nat -P POSTROUTING ACCEPT $IPT -t nat -P OUTPUT ACCEPT $IPT -t nat -A POSTROUTING -o eth0 -j MASQUERADE
|
阅读(1995) | 评论(0) | 转发(0) |