How To Install And Use Net Tools In Ubuntu

Ubuntu Sudo

The net-tools package contains classic networking commands like ifconfig, netstat, route, arp, and hostname.
While newer tools like ip (from the iproute2 package) are now the default, some scripts and tutorials still rely on these older commands.

This guide will help you:

1. Installing Net Tools

Ubuntu no longer includes net-tools by default, but you can easily add it:

sudo apt update
sudo apt install net-tools

Verify the installation:

ifconfig --version

2. Common Commands in Net Tools

1. ifconfig

View and configure network interfaces:

ifconfig

Use it to quickly check IP addresses and interface status.

2. netstat

Check open ports, connections, and routing tables:

netstat -tulnp

3. route

Display or modify the system’s routing table:

route -n

4. arp

Show the ARP table:

arp -a

5. hostname

View or set the system’s hostname:

hostname

3. Modern Alternatives

The iproute2 suite has replaced most net-tools commands.
Here is a quick reference table for modern equivalents:

Deprecated Command (net-tools)Modern Equivalent
ifconfigip addr, ip link
netstatss, ip route, ip -s link
arpip neighbour
routeip route

For example, instead of ifconfig, you can use:

ip addr show

And instead of netstat -tulnp, use:

ss -tulnp

4. Complementary Networking Tools

Beyond net-tools, these utilities are worth knowing:

These tools, combined with net-tools, provide a more comprehensive networking toolkit.

5. When Should You Use Net Tools?

Modern Ubuntu recommends ip, ss, and related commands from the iproute2 package. However:

Think of net-tools as a fallback toolkit, while learning modern tools for new workflows.

6. Conclusion

net-tools provides a simple way to access classic network commands on Ubuntu.
Even though newer tools are preferred, keeping net-tools installed can be useful for compatibility and quick diagnostics.
Combine these with modern utilities for a full-featured networking toolbox.

References