I have a firewall with these simple rules:

iptables -A INPUT -p tcp -s --dport 6000 -j ACCEPT
iptables -A INPUT -p tcp -s --dport 6000 -j ACCEPT
iptables -A INPUT -p tcp --dport 6000 -j REJECT

Now, suppose I am using TCPDUMP like this:

tcpdump port 6000

And I have host trying to connect to port 6000.

Will/should tcpdump output some packets coming from


tcpdump uses libpcap and libpcap processes packets before they get processed by the firewall, so the answer is "yes".

  • 17
    This is only partially true. tcpdump will see inbound traffic before iptables, but will see outbound traffic only after the firewall has processed it. See superuser.com/q/925286/18898 – chb May 19 '17 at 10:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.