How to Install and Use Wireshark on Ubuntu

Chưa phân loại
Wireshark is a network packet analyzer. It captures every packet getting in or out of a network interface and shows them in a nicely formatted text. It is used by Network Engineers all over the world.

Wireshark is cross platform and it is available for Linux, Windows and Mac OS. You get the same user experience in any operating system you use.

To learn more about Wireshark, visit the official website of Wireshark at

In this article, I will show you how to install Wireshark on Ubuntu and how to use it. I am using Ubuntu 18.04 LTS for the demonstration. But it should work on any LTS version of Ubuntu still supported at the time of this writing. Let’s get started.

Installing Wireshark:

Wireshark is available in the official package repository of Ubuntu 14.04 LTS and later. So it is really easy to install.

First update the APT package repository cache with the following command:

$ sudo apt update

The APT package repository cache should be updated.

Now, Run the following command to install Wireshark on your Ubuntu machine:

$ sudo apt install wireshark

Now press y and then press <Enter>.

By default, Wireshark must be started as root (can also be done with sudo) privileges in order to work. If you want to run Wireshark without root privileges or without sudo, then select <Yes> and press <Enter>.

Wireshark should be installed.

Now if you selected <Yes> in the earlier section to run Wireshark without root access, then run the following command to add your user to the wireshark group:

$ sudo usermod -aG wireshark $(whoami)

Finally, reboot your computer with the following command:

$ sudo reboot

Starting Wireshark:

Now that Wireshark is installed, you can start Wireshark from the Application Menu of Ubuntu.

You can also run the following command to start Wireshark from the Terminal:

$ wireshark

If you did not enable Wireshark to run without root privileges or sudo, then the command should be:

$ sudo wireshark

Wireshark should start.

Capturing Packets Using Wireshark:

When you start Wireshark, you will see a list of interfaces that you can capture packets to and from.

There are many types of interfaces you can monitor using Wireshark, for example, Wired, Wireless, USB and many external devices. You can choose to show specific types of interfaces in the welcome screen from the marked section of the screenshot below.

Here, I listed only the Wired network interfaces.

Now to start capturing packets, just select the interface (in my case interface ens33) and click on the Start capturing packets icon as marked in the screenshot below. You can also double click on the interface that you want to capture packets to and from to start capturing packets on that particular interface.

You can also capture packets to and from multiple interfaces at the same time. Just press and hold <Ctrl> and click on the interfaces that you want to capture packets to and from and then click on the Start capturing packets icon as marked in the screenshot below.

Using Wireshark on Ubuntu:

I am capturing packets on the ens33 wired network interface as you can see in the screenshot below. Right now, I have no captured packets.

I pinged from the terminal and as you can see, many packets were captured.

Now you can click on a packet to select it. Selecting a packet would show many information about that packet. As you can see, information about different layers of TCP/IP Protocol is listed.

You can also see the RAW data of that particular packet.

You can also click on the arrows to expand packet data for a particular TCP/IP Protocol Layer.

Filtering Packets Using Wireshark:

On a busy network thousands or millions of packets will be captured each second. So the list will be so long that it will be nearly impossible to scroll through the list and search for certain type of packet.

The good thing is, in Wireshark, you can filter the packets and see only the packets that you need.

To filter packets, you can directly type in the filter expression in the textbox as marked in the screenshot below.

You can also filter packets captured by Wireshark graphically. To do that, click on the Expression… button as marked in the screenshot below.

A new window should open as shown in the screenshot below. From here you can create filter expression to search packets very specifically.

In the Field Name section almost all the networking protocols are listed. The list is huge. You can type in what protocol you’re looking for in the Search textbox and the Field Name section would show the ones that matched.

In this article, I am going to filter out all the DNS packets. So I selected DNS Domain Name System from the Field Name list. You can also click on the arrow on any protocol

And make your selection more specific.

You can also use relational operators to test whether some field is equal to, not equal to, great than or less than some value. I searched for all the DNS IPv4 address which is equal to as you can see in the screenshot below.

The filter expression is also shown in the marked section of the screenshot below. This is a great way to learn how to write filter expression in Wireshark.

Once you’re done, just click on OK.

Now click on the marked icon to Apply the filter.

As you can see, only the DNS protocol packets are shown.

Stopping Packet Capture in Wireshark:

You can click on the red icon as marked in the screenshot below to stop capturing Wireshark packets.

Saving Captured Packets to a File:

You can click on the marked icon to save captured packets to a file for future use.

Now select a destination folder, type in the file name and click on Save.

The file should be saved.

Now you can open and analyze the saved packets anytime. To open the file, go to File > Open from Wireshark or press <Ctrl> + o

Then select the file and click on Open.

The captured packets should be loaded from the file.

So that’s how you install and use Wireshark on Ubuntu. Thanks for reading this article.

ONET IDC thành lập vào năm 2012, là công ty chuyên nghiệp tại Việt Nam trong lĩnh vực cung cấp dịch vụ Hosting, VPS, máy chủ vật lý, dịch vụ Firewall Anti DDoS, SSL… Với 10 năm xây dựng và phát triển, ứng dụng nhiều công nghệ hiện đại, ONET IDC đã giúp hàng ngàn khách hàng tin tưởng lựa chọn, mang lại sự ổn định tuyệt đối cho website của khách hàng để thúc đẩy việc kinh doanh đạt được hiệu quả và thành công.
Bài viết liên quan

How to install Vivaldi 1.11 on Ubuntu – New Browser Icon

Vivaldi 1.11 recently released, comes with a host of new features, some of which includes a brand-new application icon...

Performance Testing [Phần 5] Hướng dẫn sử dụng Gatling Report

Một trong nhưng ưu điểm của Gatling khi đánh giá với các công cụ benchmark web khác là khả năng...

Install and Use TensorFlow on Ubuntu

TensorFlow with CPU support This mechanism takes less time (usually 5 to 10 minutes) during installation. If your system...
Bài Viết

Bài Viết Mới Cập Nhật

mua Proxy riêng ở đâu, và nó đem lại lợi ích gì cho người sử dụng

Hướng dẫn sử dụng Proxy Helper Fakeip khi thuê proxy


Mua Proxy Nuôi Zalo Giá Rẻ Tại