Configure NET Share Internet Resources
Echo "1"> / proc / sys / net / ipv4 / ip_forward
INET_IFACE = "PPP0"
INET_IP = "xxx.xxx.xxx.xxx"
LAN_IP = "192.168.0.1"
LAN_IP_RANGE = "192.168.0.0/24"
IPT = "/ sbin / iptables"
/ sbin / depmod -a
/ sbin / modprobe ip_tables
/ SBIN / MODPROBE IP_NAT_FTP
/ sbin / modprobe ipt_log
$ IPT -P Input Accept
$ Ipt -p forward accept
$ IPT -P Output Accept
$ Ipt -t nat -p preloading accept
$ Ipt -t nat -p postrouting accepting accept
$ Ipt -t nat -p output accept accept
For Table In Filter Nat Mangle; Do
$ IPT -T $ TABLE -F
$ IPT -T $ TABLE -X
DONE
$ Ipt -a input -m state --state established, Related -j Accept
For DNS IN $ (grep ^ n /etc/resolv.conf|awk '{print $ 2}'); do
$ IPT -A INPUT -P UDP -S $ DNS --SPORT DOMAIN -J ACCEPT
DONE
IF [$ inet_iface "= ppp0]; then
$ Ipt -t nat -a postrouting -o $ inet_iface -j masquerade
Else
$ Ipt -t nat -a postrol-ip $ inet_iface -j snat --to $ inet_ip
Fi