Start Capture with -i eth1
In this step, you will learn how to start a network packet capture using Wireshark's command-line tool tshark
on the eth1 interface. This is the fundamental operation for network traffic analysis.
Network interfaces are the physical or virtual points where your computer connects to a network. The -i
flag in tshark specifies which network interface to capture packets from. In most Linux systems, eth1
represents the first Ethernet interface, which is typically your primary wired network connection. In our LabEx VM environment, eth1
is the default Ethernet interface connected to the network.
When you run tshark without any filters, it will capture all network traffic passing through the specified interface. This includes both incoming and outgoing packets. The command we're about to use provides a real-time view of this traffic.
Follow these steps to begin capturing:
- Open the terminal in your LabEx VM (you should already be in the
~/project
directory)
- Run the following command to start capturing on eth1:
tshark -i eth1
This command tells tshark to listen on the eth1 interface and display each packet as it's captured. The output will show detailed information about each network packet in real-time.
You should see output similar to this as packets start being captured:
Capturing on 'eth1'
1 0.000000000 192.168.1.100 → 192.168.1.1 TCP 74 55942 → 80 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK_PERM=1 TSval=123456789 TSecr=0 WS=128
2 0.000123456 192.168.1.1 → 192.168.1.100 TCP 74 80 → 55942 [SYN, ACK] Seq=0 Ack=1 Win=65535 Len=0 MSS=1460 SACK_PERM=1 TSval=987654321 TSecr=123456789 WS=128
Each line represents a captured packet, showing its timestamp, source and destination IP addresses, protocol type (TCP in this case), and various protocol-specific details. The first packet shows a TCP connection initiation (SYN flag), while the second shows the response (SYN-ACK).
To stop the capture, press Ctrl+C
in the terminal. This will display a summary of the captured packets before returning to the command prompt. The summary includes statistics about how many packets were captured and processed.