diff --git a/include/static b/include/static index edeb03d..1405f73 100644 --- a/include/static +++ b/include/static @@ -29,8 +29,6 @@ if [ $COMPAT_CONFIG == "1" ]; then MODPROBE=`which modprobe` fi - - # ANSI color sequences BLUE="\E[34m" GREEN="\E[32m" diff --git a/options.default b/options.default index 6350793..65c9434 100755 --- a/options.default +++ b/options.default @@ -1,3 +1,8 @@ +# Config file version. Don't change this. Will be used some day to +# figure out if we need to alert the user that they need to redo their +# config file. +CONFIG_VERSION=0.9 + # This is for testing purposes. IPTABLES=/bin/true IP6TABLES=/bin/true diff --git a/port-forwards b/port-forwards index 94bd800..a3ba181 100644 --- a/port-forwards +++ b/port-forwards @@ -1,3 +1,3 @@ # Format is: -# External interface:External port:internal ip:internal port -#eth0:8080:tcp:192.168.0.100:80 +# External interface:External IP:External port:Internal ip:Internal port +#eth0:4.2.2.1:8080:tcp:192.168.0.100:80 diff --git a/rc.firewall b/rc.firewall index 95f4d77..435d4d3 100755 --- a/rc.firewall +++ b/rc.firewall @@ -333,12 +333,12 @@ if [ $PORTFW ] && [ $NAT ]; then display_c YELLOW "Adding port forward for: " N for i in `grep -v "\#" $PORTFW`; do PORTADD=( ${i//:/ } ) - $IPTABLES -A PREROUTING -t nat -i ${PORTADD[0]} -p ${PORTADD[2]} \ - --dport ${PORTADD[1]} -j DNAT --to \ - ${PORTADD[3]}:${PORTADD[4]} - $IPTABLES -A INPUT -p ${PORTADD[2]} -m state --state NEW \ - --dport ${PORTADD[1]} -i ${PORTADD[0]} -j ACCEPT - echo -en "${GREEN}${PORTADD[0]}:${PURPLE}${PORTADD[1]}:${PORTADD[2]}${AQUA}->${BLUE}${PORTADD[3]}:${PORTADD[4]} " + $IPTABLES -A PREROUTING -t nat -i ${PORTADD[0]} -p ${PORTADD[3]} \ + --dport ${PORTADD[2]} -d {PORTADD[1]} -j DNAT --to \ + ${PORTADD[4]}:${PORTADD[5]} + $IPTABLES -A INPUT -p ${PORTADD[3]} -m state --state NEW \ + --dport ${PORTADD[2]} -i ${PORTADD[0]} -j ACCEPT + echo -en "${GREEN}${PORTADD[0]}:${PURPLE}${PORTADD[1]}:${PORTADD[2]}:${PORTADD[3]}${AQUA}->${BLUE}${PORTADD[4]}:${PORTADD[5]} " done reset_color fi