#!/bin/sh # Load the NAT module (this pulls in all the others). modprobe iptable_nat # Turn on IP forwarding echo 1 > /proc/sys/net/ipv4/ip_forward # In the NAT table (-t nat), Append a rule (-A) after routing (POSTROUTING) # which says to MASQUERADE the connection (-j MASQUERADE). /usr/sbin/iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j MASQUERADE # Allows forwarding specifically to our LAN /usr/sbin/iptables -A FORWARD -s 192.168.0.0/24 -j ACCEPT