2017年06月06日

iptables: ファイアウォールルールを適用中: iptables-restore: line 2 failed [失敗]

CentOS6.9 (64bit)

vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3050 -j ACCEPT
/etc/init.d/iptables restart
02.png
# Firewall configuration written by system-config-firewall INPUT -m state --state NEW -m tcp -p tcp --dport 3050 -j ACCEPT
/etc/init.d/iptables restart

# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3050 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
~                                                                              
~                                                                              
~                                                                              
~                                                                              
~                                                                              
~                                                                              
-- INSERT --


iptables: ファイアウォールルールを適用中: iptables-restore: line 2 failed
  [失敗]
01.png
原因
viでコピー時に、貼り付け失敗




こちらが、正解

vi /etc/sysconfig/iptables
ok.png
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3050 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

/etc/init.d/iptables restart
03.png
OK





posted by a23 at 11:10| Comment(0) | CentOS
この記事へのコメント
コメントを書く
お名前:

メールアドレス:

ホームページアドレス:

コメント: