LoginSignup
7
9

More than 5 years have passed since last update.

iptablesで特定のipからのアクセスを破棄しました。

Posted at

iptablesで特定のipからのアクセスを拒否しました。環境はCentOSです。

iptablesの設定を確認

iptablesの設定を確認します。

iptables -L

拒否するipを追加する

ipを追加します。

iptables -I INPUT -s 93.174.93.117 -j DROP

iptablesの設定を保存する

saveします。

/etc/init.d/iptables save
ファイアウォールのルールを /etc/sysconfig/iptables に保存中[  OK  ]

iptablesを再起動して確認

iptablesを再起動します。

/etc/init.d/iptables restart

ファイアウォールルールを適用中:                            [  OK  ]
チェインポリシーを ACCEPT に設定中filter                   [  OK  ]
iptables モジュールを取り外し中                            [  OK  ]
iptables ファイアウォールルールを適用中:                   [  OK  ]
iptables -L

略

DROP       all  --  93.174.93.117        anywhere

DROPという行が追加されました。

参考

7
9
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
9