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 in Linux Administration by akhtar
• 33,720 points
33 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 by MD
• 79,930 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,030 points
153 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,600 points
3,877 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 in Linux Administration by MD
• 79,930 points
83 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 in Linux Administration by MD
• 79,930 points
100 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 in Linux Administration by MD
• 79,930 points
3,063 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 in Linux Administration by MD
• 79,930 points
95 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 in Linux Administration by MD
• 79,930 points
105 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 in Linux Administration by MD
• 79,930 points
32 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 in Linux Administration by MD
• 79,930 points
991 views