How to capture Packet from specific port

0 votes

Hi Guys,

I want to capture packets from a particular port no. But I am able to capture packets from all the ports. How can I allow only one port?

Oct 4, 2020 in Linux Administration by akhtar
• 38,170 points
106 views

1 answer to this question.

0 votes

Hi@akhtar,

Let’s say you want to capture packets for specific port 22, then you can execute the below command by specifying port number 22 as shown below.

$ tcpdump -i eth0 port 22
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
10:37:49.056927 IP 192.168.0.2.ssh > 192.168.0.1.nokia-ann-ch1: Flags [P.], seq 3364204694:3364204890, ack 4193655445, win 20904, length 196
answered Oct 4, 2020 by MD
• 95,180 points

Related Questions In Linux Administration

0 votes
1 answer

How to take input from user in bash script?

You can use if-else branch to check ...READ MORE

answered Jan 31, 2019 in Linux Administration by Omkar
• 69,130 points
246 views
0 votes
1 answer

How to Unblock SSH and FTP Access to Specific IP in Linux?

Firewalls(most of them) can either Reject or ...READ MORE

answered Jul 16, 2019 in Linux Administration by Archana
• 5,640 points
5,667 views
0 votes
1 answer

How to change port no 80 of httpd webserver?

Hi@akhtar, You can change port no of httpd ...READ MORE

answered Apr 21, 2020 in Linux Administration by MD
• 95,180 points
223 views
0 votes
1 answer

How to unblock one IP from black list?

Hi@akhtar, To unblock your blacklisted IP address, you ...READ MORE

answered Jun 9, 2020 in Linux Administration by MD
• 95,180 points
141 views
0 votes
1 answer
0 votes
1 answer

What is the difference between ctrl z and ctrl c in command line?

Hi@akhtar, Generally, these two commands are used to ...READ MORE

answered Feb 24, 2020 in Linux Administration by MD
• 95,180 points
7,884 views
0 votes
1 answer

How to create one new partition in my hard disk in Linux?

Hi@akhtar, To create new partition you can follow ...READ MORE

answered Apr 7, 2020 in Linux Administration by MD
• 95,180 points
142 views
0 votes
1 answer

not able to run netstat-tnlp in Linux.

Hi@akhtar, In Linux system netstat-tnlp command comes from ...READ MORE

answered Apr 16, 2020 in Linux Administration by MD
• 95,180 points
180 views
0 votes
1 answer

How to capture Packets from Specific Interface in Linux?

Hi@akhtar, You can use tcpdump command in your ...READ MORE

answered Oct 3, 2020 in Linux Administration by MD
• 95,180 points
95 views
0 votes
1 answer

How to run GUI program in SSH server from remote desktop?

Hi@akhtar, First you have to configure SSH server ...READ MORE

answered Mar 31, 2020 in Linux Administration by MD
• 95,180 points
2,214 views