LoginSignup
0
0

iptablesのフィルタリングの動作検証してみた

Posted at

ブラウザだとどう見えるのかあまり資料がなかったのでとりま実験した感じです。

初期状態
image.png

検証するやつ全適用

iptables -t filter -A INPUT  -p tcp --dport 80  -j REJECT --reject-with icmp-net-unreachable
iptables -t filter -A INPUT  -p tcp --dport 80  -j REJECT --reject-with  icmp-host-unreachable
iptables -t filter -A INPUT  -p tcp --dport 80  -j REJECT --reject-with icmp-port-unreachable
iptables -t filter -A INPUT  -p tcp --dport 80  -j REJECT --reject-with  icmp-proto-unreachable
iptables -t filter -A INPUT  -p tcp --dport 80  -j REJECT --reject-with  icmp-net-prohibited
iptables -t filter -A INPUT  -p tcp --dport 80  -j REJECT --reject-with icmp-host-prohibited

icmp-net-unreachableが適用されているブラウザ画面(brave)
image.png

上から削除して行く※ルールが上のものから(番号が小さいものから)適用される

iptables -t filter -D INPUT  -p tcp --dport 80  -j REJECT --reject-with icmp-net-unreachable

icmp-host-unreachable
image.png

iptables -t filter -D INPUT  -p tcp --dport 80  -j REJECT --reject-with  icmp-host-unreachable

icmp-port-unreachable
image.png

iptables -t filter -D INPUT  -p tcp --dport 80  -j REJECT --reject-with icmp-port-unreachable

icmp-proto-unreachable
image.png

iptables -t filter -D INPUT  -p tcp --dport 80  -j REJECT --reject-with  icmp-proto-unreachable

icmp-net-prohibited
iptables -t filter -D INPUT -p tcp --dport 80 -j REJECT --reject-with icmp-proto-unreachable

iptables -t filter -D INPUT  -p tcp --dport 80  -j REJECT --reject-with  icmp-net-prohibited

icmp-host-prohibited
iptables -t filter -D INPUT -p tcp --dport 80 -j REJECT --reject-with icmp-net-prohibited

後片付け

iptables -t filter -D INPUT  -p tcp --dport 80  -j REJECT --reject-with icmp-host-prohibited

おかえりー
image.png

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