我用的snat脚本,ssh为什么上不了?

我用的snat脚本,ssh为什么上不了?

1、首先建立文件/etc/rc.d/snat-firewall,如下:
#!/bin/bash
echo "1" > /proc/sys/net/ipv4/ip_forward
#外网;
INET_IFACE="eth0"
INET_IP="***.***.***.***"
#局域网;
LAN_IFACE="eth1"
LAN_IP="10.1.1.8"
LAN_IP_RANGE="10.1.1.0/8"
IPT="/sbin/iptables"
/sbin/depmod -a
/sbin/modprobe ip_tables
/sbin/modprobe iptable_nat
/sbin/modprobe ip_nat_ftp
/sbin/modprobe ipt_LOG
$IPT -P INPUT ACCEPT
$IPT -P FORWARD ACCEPT
$IPT -P OUTPUT ACCEPT
$IPT -t nat -P PREROUTING ACCEPT
$IPT -t nat -P POSTROUTING ACCEPT
$IPT -t nat -P OUTPUT ACCEPT
for TABLE in filter nat mangle ; do
$IPT -t $TABLE -F
$IPT -t $TABLE -X
done
$IPT -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
for DNS in $(grep ^n /etc/resolv.conf|awk '{print $2}'); do
$IPT -A INPUT -p udp -s $DNS --sport domain -j ACCEPT
done
$IPT -N LOGDENY
$IPT -A LOGDENY -j LOG --log-prefix "iptables:"
$IPT -A LOGDENY -j DROP
$IPT -A INPUT -i ! lo -m state --state NEW,INVALID -j LOGDENY
if [ "$INET_IFACE" = ppp0 ] ; then
$IPT -t nat -A POSTROUTING -o $INET_IFACE -j MASQUERADE
else
$IPT -t nat -A POSTROUTING -o $INET_IFACE -j SNAT --to $INET_IP
fi
$IPT -A INPUT -p tcp --dport 22 -j ACCEPT
$IPT -A OUTPUT -p udp --dport 22 -j ACCEPT

2、chmod u+x /etc/rc.d/snat-firewall

3、执行上脚本:/etc/rc.d/snat-firewall

局域网能上网了,可是却访问不了ssh;这时停用iptables,ssh可访问,请问是我哪能里写错了吗?22端口放的不对吗?
谢谢!
你把最后两行放到前面去