由 sbrd 在 09-19-2003 10:39 发表:
请大家帮我看看这个脚本问题出在哪里?
#!/bin/sh
/sbin/modprobe ip_tables
/sbin/modprobe ip_nat_ftp
/sbin/modprobe ip_conntrack_ftp
/sbin/iptables -F
/sbin/iptables -F -t nat
/sbin/iptables -X
/sbin/iptables -Z
zero all counters
Policy for chains DROP everything
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -t nat -A PREROUTING -p udp -d 192.168.0.1 --dport 53 -j DNAT --to 211.92.184.130:53
iptables -t nat -A POSTROUTING -s 0/0 -o eth0 -j SNAT -to wan_ip
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
iptables -A FORWARD -s 0/0 -d 0/0 -j ACCEPT
echo "1">/proc/sys/net/ipv4/icmp_echo_ignore_all
/sbin/iptables -P INPUT ACCEPT
/sbin/iptables -P FORWARD ACCEPT
/sbin/iptables -P OUTPUT ACCEPT
iptables -L -n
echo 7 > /proc/sys/net/ipv4/ip_dynaddr
echo "1">/proc/sys/net/ipv4/ip_forward
为什么我一运行,就会出现下面的错误:
modprobe: Can't locate module ip_tables
modprobe: Can't locate module ip_nat_ftp
modprobe: Can't locate module ip_conntrack_ftp
iptables: No chain/target/match by that name
': Table does not exist (do you need to insmod?)e `nat
Perhaps iptables or your kernel needs to be upgraded.
iptables: Table does not exist (do you need to insmod?)
iptables: Table does not exist (do you need to insmod?)
iptables: Bad policy name
iptables: Bad policy name
- iptables: Bad policy name
command not found
'ptables v1.2.6a: Invalid target name `MASQUERADE
- Try `iptables -h' or 'iptables --help' for more information.
command not found
'ad argument `211.92.207.82
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.2.6a: Invalid target name `MASQUERADE
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.2.6a: Invalid target name `ACCEPT
- Try `iptables -h' or 'iptables --help' for more information.
command not found
No such file or directorys/net/ipv4/icmp_echo_ignore_all
command not found
command not found
command not found
command not found
iptables: Bad policy name
iptables: Bad policy name
- iptables: Bad policy name
command not found
'ptables v1.2.6a: Unknown arg `-n
- Try `iptables -h' or 'iptables --help' for more information.
command not found
No such file or directorys/net/ipv4/ip_dynaddr
No such file or directorys/net/ipv4/ip_forward
由 Glue 在 09-19-2003 19:58 发表:
脚本没有问题,
是你的内核没有支持。
重新编译过内核
<font face