Track Network Connections in Linux With pktstat

Trending 1 month ago

What is your Linux machine sending, and where? Find retired pinch pkstat.

Cables plugged into a web switch

Key Takeaways

  • pktstat is simply a command-line inferior that shows packet activity successful existent time, akin to really apical aliases htop shows accusation connected processes.
  • Installing pktstat is easy and it tin beryllium recovered successful nan package managers of astir awesome Linux distros for illustration apt, pacman, and dnf.
  • Running pktstat arsenic guidelines allows you to show unfastened web connections, showing nan root and destination of packets betwixt your section instrumentality and distant computers.

If you’re wondering which processes are utilizing your bandwidth connected Linux, a small inferior called pktstat whitethorn beryllium capable to help. This command-line instrumentality shows packet activity successful existent time, pinch immoderate convenient options for communal functions.

What Is pktstat?

pktstat is simply a inferior that shows nan behaviour of packets going to and from your computer, akin to really top aliases htop shows accusation connected processes. It’s a full-screen programme that runs successful nan terminal.

How to Install pktstat

Installing pktstat is easy since it’s disposable successful nan package managers for astir awesome Linux distros.

For example, to instal it connected Debian aliases Ubuntu:

sudo apt instal pktstat

And connected Arch:

sudo pacman -S pktstat

And connected nan Red Hat family

sudo dnf instal pktstat

Monitoring Network Connections With pktstat

pktstat moving successful nan Linux terminal

To spot immoderate unfastened web connections pinch pktstat, you tin conscionable telephone it from nan bid line. Because web connections impact strategy security, you usually request to tally it arsenic root:

sudo pktstat

This will bring up a full-screen display. It will show immoderate unfastened web connections connected your machine. You’ll spot nan root and destination of immoderate packets going betwixt your section instrumentality and nan distant computer.

As pinch galore different Linux programs, nan existent powerfulness of pktstat comes from its various options. The -i action lets you specify an interface you want to monitor. For example, you whitethorn for illustration to way connections connected a wired Ethernet interface alternatively than nan Wi-Fi:

sudo pktstat -i [interface]

By default, pktstat will show shortened hostnames. To spot nan afloat hostname, usage nan -F option.

The -n action will dispense pinch hostnames completely, conscionable showing IP addresses. You tin besides property n to toggle nan numeric mode erstwhile pktstat is running.

The -c option will abstracted postulation flows that pktstat would usually harvester into one, specified arsenic aggregate TCP connections.

You tin alteration nan benignant bid by pressing t for “top mode” to benignant by spot count arsenic good arsenic by utilizing nan -t option.

pktstat is simply a useful console-based instrumentality for monitoring incoming and outgoing web connections connected your Linux strategy successful existent time. It's for illustration apical aliases htop for your network.

Source Tutorials
Tutorials