Quantcast
Channel: OKWAVE 最新質問(ネットワーク/227)【本日】
Viewing all articles
Browse latest Browse all 6177

CentOS6.5のiptablesについて

$
0
0
CentOS6.5において、こちらのサイトhttp://centossrv.com/iptables.shtml を参考にiptablesのスクリプトを作成しました。 いざ sh iptables.shで実行しようとすると iptables: チェインをポリシー ACCEPT へ設定中filter [ OK ] iptables: ファイアウォールルールを消去中: [ OK ] iptables: モジュールを取り外し中: [ OK ] iptables: ファイアウォールルールを適用中: Bad argument `ACCEPT' Error occurred at line: 9 Try `iptables-restore -h' or 'iptables-restore --help' for more information. [失敗] と表示されます。 9行目付近は 1 #!/bin/bash 2 3 4 # デフォルトルール(以降のルールにマッチしなかった場合に適用するルール)設 定 5 IPTABLES_CONFIG=`mktemp` 6 echo "*filter" >> $IPTABLES_CONFIG 7 echo ":INPUT DROP [0:0]" >> $IPTABLES_CONFIG # 受信はすべて破棄 8 echo ":FORWARD DROP [0:0]" >> $IPTABLES_CONFIG # 通過はすべて破棄 9 echo ":OUTPUT ACCEPT [0:0]" >> $IPTABLES_CONFIG # 送信はすべて許可 10 echo ":ACCEPT_COUNTRY - [0:0]" >> $IPTABLES_CONFIG # 指定した国からのア> クセスを許可 11 echo ":DROP_COUNTRY - [0:0]" >> $IPTABLES_CONFIG # 指定した国からのア> クセスを破棄 12 echo ":LOG_PINGDEATH - [0:0]" >> $IPTABLES_CONFIG # Ping of Death攻撃は ログを記録して破棄 とサイトと同じ内容になっています。 空白など無駄なものが挿入されていないか確認しましたがありませんでした。 解決できるようどうかお力添えをお願いします。

Viewing all articles
Browse latest Browse all 6177

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>