#Put any fixed rules you wish here. Example: #if [ -f /proc/net/ip_fwchains ]; then # #Place the ipchains versions of your rules here # /sbin/ipchains -A forward -s 172.16.0.0/24 -j MASQ #Masquerade from internal lan out #elif [ -f /proc/net/ip_input ]; then # #Place the ipfwadm versions of your rules here. # /sbin/ipfwadm -F -a accept -m -S 172.16.0.0/24 #Masquerade from internal lan out #else #The old >>>elif [ -n "`lsmod | grep '^ip_tables '`" ]; then<<<< doesn't work as iptables can be kernel-resident. Cross your fingers. # #Place the iptables versions of your rules here # #The following loads all netfilter modules - this may or may not be appropriate for you # MODDIR="/lib/modules/`uname -r`" # for MOD in \ # $MODDIR/ipv4/ip_* \ # $MODDIR/ipv4/ipt_* \ # $MODDIR/ipv4/iptable_* \ # $MODDIR/kernel/net/ipv4/netfilter/ip_* \ # $MODDIR/kernel/net/ipv4/netfilter/ipt_* \ # $MODDIR/kernel/net/ipv4/netfilter/iptable_* ; do # insmod $MOD >/dev/null 2>/dev/null ; modprobe $MOD >/dev/null 2>/dev/null # done # #Masquerade from internal lan out - syntax from iptables howto; thanks, Rusty. # iptables -A POSTROUTING -t nat -s 172.16.0.0/24 -o ppp0 -j MASQUERADE # #The following will allow the response packets back in/out/through your firewall. # #This, too, may or may not be appropriate for you and should not be taken as a suggestion. # #It is only here as a convience. If you use these, Mason will build a firewall # #of opening packets only. # iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT # iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT # iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT #fi