14-Jul-2014 03:34
Hi everyone,
I'm trying to capture traffic directed to a certain range of tcp ports with tcpdump. When using the "portrange" expression I get a syntax error:
tcpdump -i -s0 -w capture_file.trc portrange 8080-8082 tcpdump: syntax error in filter expression
Is this expression supported on BIG-IP (1600 10.2.4 HF5)?
Thanks in advance, Regards.
moog67
Solved! Go to Solution.
18-Jul-2014 07:21
try:
tcpdump -i SRV -s0 -w capture_file.trc port 8080 or port 8081 or port 8082
This worked for me, I saw traffic on all 3 ports in both directions in my dump. My only diff was the interface name.
This was on 10.2.4 HF5, tcpdump version 3.9.4, libpcap version 0.7.2
Again, no idea why portrange doesn't work, but I can confirm the same problem on this version.
14-Jul-2014 04:43
is that the syntax you actually used? because it's missing the interface name
14-Jul-2014 06:43
14-Jul-2014 07:31
Weird, it definitely doesn't work on 10.2.4 the same way it works in 11. It seems to require another option like src or dst.
'src portrange 8080-8082 or dst portrange 8080-8082' appears to work.
14-Jul-2014 20:20
18-Jul-2014 05:16
18-Jul-2014 07:21
try:
tcpdump -i SRV -s0 -w capture_file.trc port 8080 or port 8081 or port 8082
This worked for me, I saw traffic on all 3 ports in both directions in my dump. My only diff was the interface name.
This was on 10.2.4 HF5, tcpdump version 3.9.4, libpcap version 0.7.2
Again, no idea why portrange doesn't work, but I can confirm the same problem on this version.
18-Jul-2014 23:33
07-Jun-2023 11:26
Glad you found a reply for this! Here's a few articles by tcpdump enthusiast @JRahm in case you (or anyone else) is interested: