#!/bin/sh # # Startup script for nat # IPTABLES=/usr/local/sbin/iptables #IPTABLES=/sbin/iptables EXT_IF=eth0 INT_IF=eth1 case "$1" in start) echo -n "Starting nat firewall: " $IPTABLES --table nat --flush $IPTABLES --table nat --delete-chain $IPTABLES -t nat -A POSTROUTING -s 192.168.4.0/24 -j SNAT --to-source 172.16.3.4 echo "Done" ;; stop) echo -n "Stopping nat firewall: " $IPTABLES --table nat --flush $IPTABLES --table nat --delete-chain echo "Done" ;; restart) $0 stop $0 start ;; *) echo "Usage: %s {start|stop|restart}\n" "$0" exit 1 esac exit 0