Wie kann ich in der iptables-Protokolldatei sehen, welcher Port blockiert wurde?

Wie kann ich in der iptables-Protokolldatei sehen, welcher Port blockiert wurde?

Ich habe einige iptables-Regeln erstellt und getestet. Ich habe INPUT, OUTPUTKetten mit folgendem Code erstellt:

  #!/bin/bash



iptables -F

iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP

iptables -N accept-input

iptables -A accept-input -j LOG --log-prefix "INPUT-ACCEPTED "
iptables -A accept-input -j ACCEPT


iptables -N drop-input

iptables -A drop-input -j LOG --log-prefix "INPUT-DROPPED "
iptables -A drop-input -j DROP

iptables -N accept-output

iptables -A accept-output -j LOG --log-prefix "OUTPUT-ACCEPTED "
iptables -A accept-output -j ACCEPT

iptables -N drop-output

iptables -A drop-output -j LOG --log-prefix "OUTPUT-DROPPED "
iptables -A drop-output -j ACCEPT

iptables -A INPUT -j drop-input
iptables -A OUTPUT -j drop-output

und ich habe weitere Regeln hinzugefügt, um bestimmte Ports zuzulassen. Ich möchte die VERLORENEN Pakete sehen. Ich verwende Port 9191 für IIS-Websites. Ich kann keine Websites erreichen, weil dieser blockiert ist.

Antwort1

grep DROPPED /var/log/kern.log

oder

dmesg|grep DROPPED

verwandte Informationen