LoginSignup
3
3

More than 5 years have passed since last update.

iptable アクセス拒否メモ

Posted at

いちいち忘れるのでメモ。薄いです。

${_SRC} : アクセス元のIP 192.168.1.0/24 あたりでレンジ指定してもええ
${_DST} : アクセス先ホストのIP リクエストを受け付けるinterface(ethXとか)のIP
${_DST_PORT} : アクセス先ホストのポート

bash
export _SRC=★
export _DST=★
export _DST_PORT=★


echo "iptables -A INPUT -p tcp -s "${_SRC}" -d "${_DST}" --dport "${_DST_PORT}" -j REJECT"

# echo 結果に問題なければコピペして使ってね
# 今のところReject派です。

iptables -L
iptables -L -n -v

参考
http://qiita.com/Tocyuki/items/6d90a1ec4dd8e991a1ce

3
3
0

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
3
3