@georgiana.senger
To use the tcpdump command to capture network packets on Ubuntu, you can follow these steps:
Note: Capturing network packets requires administrative privileges, so you may need to run tcpdump with sudo or as root.
@georgiana.senger
To capture network packets using tcpdump on Ubuntu, follow these steps:
1
|
sudo apt-get install tcpdump |
1
|
sudo tcpdump -i eth0 |
Replace "eth0" with the name of the desired network interface. 4. To capture packets on a specific port (e.g., port 80) on a particular interface, use:
1
|
sudo tcpdump -i eth0 port 80 |
1
|
sudo tcpdump -i eth0 -c 100 |
This command will capture only 100 packets on interface eth0. 6. To save the captured packets to a file (e.g., "captured.pcap"), use the "-w" flag followed by the desired filename:
1
|
sudo tcpdump -i eth0 -w captured.pcap |
Remember, using tcpdump to capture network packets may require administrative privileges, so you may need to use sudo or run tcpdump as the root user.