iif: your intranet interface
iip: your intranet IP
wif: your internet (WAN) interface
wip: your wan internet (WAN) IP
inm: your intranet netmask
Enable Forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
Enable IP Forwarding
- iptables -I FORWARD -i $wif -o $iif -j ACCEPT
- iptables -I FORWARD -i $iif -o $wif -j ACCEPT
- iptables -t nat -A POSTROUTING -s $iip/$inm -o $wif -j MASQUERADE
iptables -t nat -I POSTROUTING -s $iip/$inm -j SNAT --to $wip
No comments:
Post a Comment