# the script arguments are:
# $1 is "I" for insert the masquerade in the table before all other iptables enteries
# $2 is the source IP address to be masqueraded be it a specific address "10.11.11.3" or "10.11.11.0/24"
# this is particularly useful for openvpn connections
/usr/sbin/sysctl -w net.ipv4.ip_forward=1
/usr/sbin/sysctl -w net.ipv6.conf.all.forwarding=1
iptables --table nat -$1 POSTROUTING -s $2 -j MASQUERADE
No comments:
Post a Comment