network tools ubuntu

Net-tools is a collection of base networking utilities. It includes arp, hostname, ifconfig, ipmaddr, iptunnel, mii-tool, nameif, netstat, plipconfig, rarp, route, and slattach.

As net-tools wasn’t maintained for a long time, the utilities have been deprecated and replaced by modern alternatives (ip, ss, etc.). We recommend using the newer tools, but it’s ultimately up to the user to choose as the older utilities still work as well.

We’ll explain how you can install the net-tools package on Ubuntu and also cover the new replacements for the commonly used tools in this article.

Install net-tools

The net-tools package can be installed directly from the main Ubuntu repo.

sudo apt install -y net-tools

Now, let’s look at the usage of the deprecated commands and their new equivalents, starting with arp.

arp

arp is used to view or modify the IPv4 network neighbor cache table. To view the contents of the table, you would use arp without any additional options.

arp

Arp, like most other net-tools, has been made obsolete by the ip command from the iproute2 package. The ip equivalent to view the cache table is the ip neighbour command.

ip n

ifconfig

ifconfig is used to display and configure network interfaces. Using it without any options will display the active interfaces.

ifconfig

Similarly, you can bring interfaces up or down like so

ifconfig <interface> down
ifconfig eth0 up

The new command for displaying the active interfaces is ip addr, or ip a in short.

ip a

As for setting interface states, you can use ip link like so

ip link set dev <interface> down
ip link set dev eth0 up

netstat

netstat can display a range of network statistics from ports and routing tables to network interfaces. By default, it lists active connections.

netstat

netstat has been replaced by the socket statistics (ss) tool for the most part. Additionally, some of its functionalities can now be performed with the ip command. The new command to list established connections is

ss

We’ve covered common netstat usage along with the new replacements in the same manner below. To list listening sockets, you can use

netstat -l
ss -l

To list both listening and non-listening sockets, you can use the all flag.

netstat -a
ss -a

You can display all network interfaces like so.

netstat -i
ip -s link

The route flag retrieves the kernel routing tables.

netstat -r
ip route

Finally, the statistics flag displays summary stats for each protocol.

netstat -s
ss -s

route

route is used to view or modify the kernel’s IP routing tables. Using route without any options prints the routing table.

route

The ip equivalent of this is ip route.

ip r

Similarly, you can view all routing entries of all tables with

ip route list table all
Anup Thapa

Senior Writer

Anup Thapa is a Linux enthusiast with an extensive background in computer hardware and networking. His goal is to effectively communicate technical concepts in a simplified form understandable by new Linux users. To this end, he mainly writes beginner-friendly tutorials and troubleshooting guides. Outside of work, he enjoys reading up on a range of topics, traveling, working out, and MOBAs.