iptables脚本错误No chain/target/match by that name



执行iptables脚本错误提示

2010-01-21 23:31:33| 分类: Linux |举报|字号 订阅
[root@localhost ~]# sh iptables_mail.sh
iptables: No chain/target/match by that name
iptables: Bad policy name
iptables: Bad policy name
iptables: Bad policy name
: command not foundine 10:
‘ptables v1.3.5: Invalid target name `ACCEPT
Try `iptables -h’ or ‘iptables –help’ for more information.
‘ptables v1.3.5: Invalid target name `ACCEPT
Try `iptables -h’ or ‘iptables –help’ for more information.
: command not foundine 15:
‘ptables v1.3.5: Invalid target name `ACCEPT
Try `iptables -h’ or ‘iptables –help’ for more information.
‘ptables v1.3.5: Invalid target name `ACCEPT
Try `iptables -h’ or ‘iptables –help’ for more information.
: command not foundine 19:
‘ptables v1.3.5: Invalid target name `ACCEPT
Try `iptables -h’ or ‘iptables –help’ for more information.
‘ptables v1.3.5: Invalid target name `ACCEPT
Try `iptables -h’ or ‘iptables –help’ for more information.
‘ptables v1.3.5: Invalid target name `ACCEPT
Try `iptables -h’ or ‘iptables –help’ for more information.
‘ptables v1.3.5: Invalid target name `ACCEPT
Try `iptables -h’ or ‘iptables –help’ for more information.
: command not foundine 26:
‘ptables v1.3.5: Invalid target name `ACCEPT
Try `iptables -h’ or ‘iptables –help’ for more information.
‘ptables v1.3.5: Invalid target name `ACCEPT
Try `iptables -h’ or ‘iptables –help’ for more information.
‘ptables v1.3.5: Invalid target name `ACCEPT
Try `iptables -h’ or ‘iptables –help’ for more information.
‘ptables v1.3.5: Invalid target name `ACCEPT
Try `iptables -h’ or ‘iptables –help’ for more information.
: command not foundine 32:
‘ptables v1.3.5: Invalid target name `ACCEPT
Try `iptables -h’ or ‘iptables –help’ for more information.
‘ptables v1.3.5: Invalid target name `ACCEPT
Try `iptables -h’ or ‘iptables –help’ for more information.
‘ptables v1.3.5: Invalid target name `ACCEPT
Try `iptables -h’ or ‘iptables –help’ for more information.
‘ptables v1.3.5: Invalid target name `ACCEPT
Try `iptables -h’ or ‘iptables –help’ for more information.
: command not foundine 38:
‘ptables v1.3.5: Invalid target name `ACCEPT
Try `iptables -h’ or ‘iptables –help’ for more information.
‘ptables v1.3.5: Invalid target name `ACCEPT
Try `iptables -h’ or ‘iptables –help’ for more information.
‘ptables v1.3.5: Invalid target name `ACCEPT
Try `iptables -h’ or ‘iptables –help’ for more information.
‘ptables v1.3.5: Invalid target name `ACCEPT
Try `iptables -h’ or ‘iptables –help’ for more information.
: command not foundine 43:
: command not foundine 44:
‘ptables v1.3.5: Invalid target name `ACCEPT
Try `iptables -h’ or ‘iptables –help’ for more information.
‘ptables v1.3.5: Invalid target name `ACCEPT
Try `iptables -h’ or ‘iptables –help’ for more information.
‘ptables v1.3.5: Invalid target name `ACCEPT
Try `iptables -h’ or ‘iptables –help’ for more information.
‘ptables v1.3.5: Invalid target name `ACCEPT
Try `iptables -h’ or ‘iptables –help’ for more information.
: command not foundine 49:
‘ptables v1.3.5: Invalid target name `ACCEPT
Try `iptables -h’ or ‘iptables –help’ for more information.
‘ptables v1.3.5: Invalid target name `ACCEPT
Try `iptables -h’ or ‘iptables –help’ for more information.
‘ptables v1.3.5: Invalid target name `ACCEPT
Try `iptables -h’ or ‘iptables –help’ for more information.
‘ptables v1.3.5: Invalid target name `ACCEPT
Try `iptables -h’ or ‘iptables –help’ for more information.
: command not foundine 54:
: command not foundine 55:
‘ptables v1.3.5: Invalid target name `DROP
Try `iptables -h’ or ‘iptables –help’ for more information.
‘ptables v1.3.5: Invalid target name `DROP
Try `iptables -h’ or ‘iptables –help’ for more information.
‘ptables v1.3.5: Invalid target name `DROP
Try `iptables -h’ or ‘iptables –help’ for more information.
: command not foundine 60:
‘ptables v1.3.5: Invalid target name `DROP
Try `iptables -h’ or ‘iptables –help’ for more information.
‘ptables v1.3.5: Invalid target name `DROP
Try `iptables -h’ or ‘iptables –help’ for more information.
‘ptables v1.3.5: Invalid target name `DROP
Try `iptables -h’ or ‘iptables –help’ for more information.

 

这种情况出现的原因是 iptables_mail.sh 文件格式是Windows格式,是因为文件末尾^M导致。

需要将文件格式转化为Unix格式即可。

可以使用Gvim等编辑器帮助转换。