tcpdump and Iptables
Hi,
I think I've asked this before here, but I don't remember what the answer was.
If I have iptables running and I do a
tcpdump -i eth0, at what point is
tcpdump listening to the connection?
I'm trying to troubleshoot my firewall, but am not seeing the right behaviour as the packets that I'm trying to block by the following command:
$IPTABLES -A FORWARD -i eth1 -p tcp \
-d 192.168.7.1 -j DROPBut I still get tcp packets going to 192.168.7.1.
And wouldn't :
$IPTABLES -A FORWARD -i eth1 -p tcp \
-s 192.168.7.1 -j DROPin effect disables all access to the internet for machine IP 192.168.7.1?
But my main query is about the relationship between the packets that TCPDUMP sees and where the packets are within the packet filtering process.
Thanks
Quoted 8 lines · CC
Hi,
I think I've asked this before here, but I
don't remember what the answer was.If I have iptables running and I do a
tcpdump -i eth0, at what point is
tcpdump listening to the connection?
tcpdump operates at the BPF layer, which is below netfilter.
if the the inbound interface is eth0; packets that will eventually be dropped by netfilter will be captured by tcpdump.
if you're trying to see whether packets make it *through* the firewall--tcpdump on the exiting interface.
-j
Signature · 1 line
Jason Opperisano <[email protected]>
Quoted 2 lines · CC
If I have iptables running and I do a tcpdump -i eth0, at what point
is tcpdump listening to the connection?
tcpdump will see the packets before IPTables does anything to them.
Signature · 1 line
mors omnia vincit
Quoted 9 lines · Nick Drage
Quoted 2 lines · CC
If I have iptables running and I do a tcpdump -i eth0, at what point
is tcpdump listening to the connection?tcpdump will see the packets before IPTables does anything to them.
Thanks NIck for the info. Exactly what I wanted to know.
Edmund
Quoted 8 lines · cc
Quoted 4 lines · Nick Drage
Quoted 2 lines
If I have iptables running and I do a tcpdump -i eth0, at what
point is tcpdump listening to the connection?tcpdump will see the packets before IPTables does anything to them.
Thanks NIck for the info. Exactly what I wanted to know.
Thanks... though Jason's explanation was rather better :)
tcpdump is an excellent tool, but ( excuse me if I'm stating the obvious ), don't underestimate the usefulness of the logging rules in IPTables combined with
tail -f /var/log/$logfile | grep $string_you_are_looking_for
Signature · 1 line
mors omnia vincit
Quoted 6 lines · Nick Drage
Quoted 2 lines · CC
If I have iptables running and I do a tcpdump -i eth0, at what point
is tcpdump listening to the connection?tcpdump will see the packets before IPTables does anything to them.
If that's true (I don't doubt it) then I have a question:
Where in the routing process does tcpdump see the traffic? It can be very important to know it for some studies.
Signature · 12 lines
Jose Maria Lopez Hernandez Director Tecnico de bgSEC [email protected] bgSEC Seguridad y Consultoria de Sistemas Informaticos http://www.bgsec.com ESPAÑA The only people for me are the mad ones -- the ones who are mad to live, mad to talk, mad to be saved, desirous of everything at the same time, the ones who never yawn or say a commonplace thing, but burn, burn, burn like fabulous yellow Roman candles. -- Jack Kerouac, "On the Road"
Quoted 14 lines · CC
Hi,
I think I've asked this before here, but I don't remember what the answer was.
If I have iptables running and I do a
tcpdump -i eth0, at what point is
tcpdump listening to the connection?I'm trying to troubleshoot my firewall, but am not seeing the right behaviour as the packets that I'm trying to block by the following command:
Quoted 5 lines
$IPTABLES -A FORWARD -i eth1 -p tcp \ -d 192.168.7.1 -j DROPBut I still get tcp packets going to 192.168.7.1.
Wouldn't it work if you use -o eth1 instead of
-i eth1. Where it's situated 192.168.7.1? If
the routes says it has to go through eth1 to
get to 192.168.7.1 then you need -o.
Or maybe you have packets routed through other
interfaces, not eth1. Or maybe the packets
are being originated in the same firewall, so
the FORWARD rule does not apply.
Quoted 16 lines
And wouldn't :
$IPTABLES -A FORWARD -i eth1 -p tcp \ -s 192.168.7.1 -j DROPin effect disables all access to the internet for machine IP 192.168.7.1?
But my main query is about the relationship between the packets that TCPDUMP sees and where the packets are within the packet filtering process.
Thanks
Signature · 12 lines
Jose Maria Lopez Hernandez Director Tecnico de bgSEC [email protected] bgSEC Seguridad y Consultoria de Sistemas Informaticos http://www.bgsec.com ESPAÑA The only people for me are the mad ones -- the ones who are mad to live, mad to talk, mad to be saved, desirous of everything at the same time, the ones who never yawn or say a commonplace thing, but burn, burn, burn like fabulous yellow Roman candles. -- Jack Kerouac, "On the Road"