Iproute2

Posted on Nov 1, 2023

iproute2 is the Linux networking toolkit that replaced net-tools (ifconfig, route, arp etc.).

This post serves mostly to compare the old commands with the new standard ones. If you want a more detailed cheatsheet I encourage you to visit https://paulgorman.org/technical/linux-iproute2-cheatsheet.html

net-tools vs iproute2 table

Net-tools Command iproute2 Command Description
ifconfig ip addr Show or manipulate network interfaces
route ip route Display or manipulate the IP routing table
arp ip neigh or ip -4 neigh Show or manipulate the ARP cache
netstat ss or ip -s Display network connections, routing tables, interface statistics, masquerade connections, and multicast memberships
hostname hostnamectl Query and change the system hostname and related settings
dnsdomainname hostnamectl --transient Query and change the system transient hostname and related settings
domainname hostnamectl --static Query and change the system static hostname and related settings
nisdomainname hostnamectl --pretty Query and change the system pretty hostname and related settings
ifconfig -a ip addr show Show information about all network interfaces, including those that are down
route -n ip route show Display the routing table in numeric format
ifconfig <iface> up/down ip link set <iface> up/down Bring an interface up or down
arp -s <ip> <mac> ip neigh add <ip> lladdr <mac> Add a static ARP entry
netstat -tuln ss -tuln Display listening sockets for TCP and UDP
netstat -rn ip route show Display the routing table

Why iproute2?

Unlike its predecessor net-tools, iproute2 offers a comprehensive set of networking utilities that go beyond the basic functionalities of net-tools.

In addition to providing replacements for commands like ifconfig, route, arp, and netstat, iproute2 introduces a more versatile and unified approach to network configuration. With iproute2, you can not only retrieve information about network interfaces and routes but also perform advanced tasks such as configuring devices, setting up policies, managing tunnels, and more.

This expanded set of capabilities positions iproute2 as the Swiss Army knife for network administrators and users, providing a sophisticated and efficient approach to network management on Linux.