From: <kr...@us...> - 2007-10-31 16:12:35
|
Revision: 1341 http://astlinux.svn.sourceforge.net/astlinux/?rev=1341&view=rev Author: krisk84 Date: 2007-10-31 09:12:36 -0700 (Wed, 31 Oct 2007) Log Message: ----------- add support for NONAT Modified Paths: -------------- trunk/package/iptables/astfw trunk/target/generic/target_skeleton/stat/etc/rc.conf Modified: trunk/package/iptables/astfw =================================================================== --- trunk/package/iptables/astfw 2007-10-30 18:50:57 UTC (rev 1340) +++ trunk/package/iptables/astfw 2007-10-31 16:12:36 UTC (rev 1341) @@ -322,17 +322,53 @@ #turn on NAT (PAT) for everything\everyone else... +if [ "$NONAT" ] +then +for i in $NONAT +do + +if [ "$i" = "$INTIF" ] +then +INTIFNAT=off +else +INTIFNAT=on +fi + +if [ "$i" = "$INT2IF" ] +then +INT2IFNAT=off +else +INT2IFNAT=on +fi + +if [ "$i" = "$INT3IF" ] +then +INT3IFNAT=off +else +INT3IF=on +fi + +done +else +INTIFNAT=on +INT2IFNAT=on +INT3IFNAT=on +fi + for i in $EXTIFS do +if [ "$INTIF" -a "$INTIFNAT" = "on" ] +then if [ "$MASQPORTS" ] then iptables -t nat -A POSTROUTING -s $IPBASE.0/$INTNM -o $i -p udp -j MASQUERADE --to-ports $MASQPORTS iptables -t nat -A POSTROUTING -s $IPBASE.0/$INTNM -o $i -p tcp -j MASQUERADE --to-ports $MASQPORTS fi iptables -t nat -A POSTROUTING -s $IPBASE.0/$INTNM -o $i -j MASQUERADE +fi -if [ "$INT2IF" ] +if [ "$INT2IF" -a "$INT2IFNAT" = "on" ] then if [ "$MASQPORTS" ] then @@ -342,7 +378,8 @@ iptables -t nat -A POSTROUTING -s $IP2BASE.0/$INT2NM -o $i -j MASQUERADE fi -if [ "$INT3IF" ] + +if [ "$INT3IF" -a "$INT3IFNAT" = "on" ] then if [ "$MASQPORTS" ] then Modified: trunk/target/generic/target_skeleton/stat/etc/rc.conf =================================================================== --- trunk/target/generic/target_skeleton/stat/etc/rc.conf 2007-10-30 18:50:57 UTC (rev 1340) +++ trunk/target/generic/target_skeleton/stat/etc/rc.conf 2007-10-31 16:12:36 UTC (rev 1341) @@ -280,6 +280,11 @@ ##force TCP and UDP connections to always be natted within the range of ports defined. #MASQPORTS="30000-60000" +##NONAT +##By default we do NAT/PAT on all of the internal interfaces. If you don't want to, +##define that here. As usual, multiple arguments can be seperated by spaces. +#NONAT="$INT2IF" + ##Master NTP server. This is the NTP server that AstLinux will sync against ##upon bootup. It is also the server that the running ntpd process will use ##to maintain that time sync. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |