ok, i solved it. 8)

here's the script i'm using. thanks for everyone's help.

-- 
Tom Vier <[EMAIL PROTECTED]>
DSA Key ID 0x15741ECE


script:

#!/bin/bash

INTFWIP="10.86.79.10"
INTIF="eth0"
EXTIF="eth1"

EXTIP=" fconfig $EXTIF | awk /$EXTIF/'{next}//{split($0,a,":");\
split(a[2],a," ");print a[1];exit}'"

#echo $EXTIP; exit 0

case "$1" in
        start)
iptables -t nat -A PREROUTING -p tcp -d $EXTIP --dport 2222 -j DNAT --to-destination 
10.86.79.10:22
iptables -I FORWARD 1 -i $EXTIF -o $INTIF -p tcp --dport 22 -m state --state 
NEW,ESTABLISHED,RELATED -j ACCEPT
;;

        stop)
iptables -t nat -D PREROUTING -p tcp -d $EXTIP --dport 2222 -j DNAT --to-destination 
10.86.79.10:22
iptables -D FORWARD -i $EXTIF -o $INTIF -p tcp --dport 22 -m state --state 
NEW,ESTABLISHED,RELATED -j ACCEPT
;;
        restart)
        $0 stop
        $0 start
;;

        *)
        exit 1
        ;;
esac


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to