Olivine logo
jpnt blog / Journal / Iproute2

Iproute2

#networks

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 Commandiproute2 CommandDescription
ifconfigip addrShow or manipulate network interfaces
routeip routeDisplay or manipulate the IP routing table
arpip neigh or ip -4 neighShow or manipulate the ARP cache
netstatss or ip -sDisplay network connections, routing tables, interface statistics, masquerade connections, and multicast memberships
hostnamehostnamectlQuery and change the system hostname and related settings
dnsdomainnamehostnamectl --transientQuery and change the system transient hostname and related settings
domainnamehostnamectl --staticQuery and change the system static hostname and related settings
nisdomainnamehostnamectl --prettyQuery and change the system pretty hostname and related settings
ifconfig -aip addr showShow information about all network interfaces, including those that are down
route -nip route showDisplay the routing table in numeric format
ifconfig <iface> up/downip link set <iface> up/downBring an interface up or down
arp -s <ip> <mac>ip neigh add <ip> lladdr <mac>Add a static ARP entry
netstat -tulnss -tulnDisplay listening sockets for TCP and UDP
netstat -rnip route showDisplay 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.