+# SNAT only using indexed iptables (should be rather function, hmm)
+# ===============================================================
+
+for czfip in `grep -v ^# $pimp_snat|cut -f 1 -d " "`
+do
+ pubip=`grep "$czfip " $pimp_snat|cut -f 2 -d " "`
+ czffirstindex=priv_`ipcalc -n $czfip/20|grep Network|cut -f 4 -d \ |tr [./] _`
+ czfsecondindex=priv_`ipcalc -n $czfip/23|grep Network|cut -f 4 -d \ |tr [./] _`
+ czfthirdindex=priv_`ipcalc -n $czfip/26|grep Network|cut -f 4 -d \ |tr [./] _`
+
+ if ! grep $czffirstindex $script > /dev/null
+ then
+ echo $iptables -t nat -N $czffirstindex >> $script
+ echo $iptables -t nat -F $czffirstindex >> $script
+ echo $iptables -t nat -A POSTROUTING -s `ipcalc -n $czfip/20|grep Network|cut -f 4 -d \ ` -o eth1 -j $czffirstindex >> $script
+ fi
+
+ if ! grep $czfsecondindex $script > /dev/null
+ then
+ echo $iptables -t nat -N $czfsecondindex >> $script
+ echo $iptables -t nat -F $czfsecondindex >> $script
+ echo $iptables -t nat -A $czffirstindex -s `ipcalc -n $czfip/23|grep Network|cut -f 4 -d \ ` -o eth1 -j $czfsecondindex >> $script
+ fi
+
+ if ! grep $czfthirdindex $script > /dev/null
+ then
+ echo $iptables -t nat -N $czfthirdindex >> $script
+ echo $iptables -t nat -F $czfthirdindex >> $script
+ echo $iptables -t nat -A $czfsecondindex -s `ipcalc -n $czfip/26|grep Network|cut -f 4 -d \ ` -o eth1 -j $czfthirdindex >> $script
+ fi
+
+ echo $iptables -t nat -A $czfthirdindex -s $czfip/32 -o eth1 -j SNAT --to-source $pubip >> $script
+ echo $iptables -t nat -A $czfthirdindex -s $czfip/32 -o eth1 -j ACCEPT >> $script
+
+ echo -n .
+ echo "echo -n ." >>$script
+done
+echo " done."
+
+# ===============================================================
+# Dashboard rules