| created on | November 12, 2025 |
In Linux, the network setup of a machine is done with the iproute2 tools. The iproute tools supersede the now obsolete net-tools, which include, among others, the well known , and commands.
The commands of iproute2 tools are:
The table below list the most important iproute2 commands to set up a network and display its configuration. For each iproute2 command, the corresponding net-tools command is listed.
| action | iproute2 command | net-tools command |
|---|---|---|
| set IP, netmask and broadcast address in one go | ||
| set default gateway | ||
| delete default gateway | ||
| display link status | ||
| display link status, include statistics | ||
| display IP address | ||
| delete IP address | N/A | |
| delete all IP addresses of a device | N/A | |
| activate device (change state of device to UP) | ||
| deactivate device (change state of device to DOWN) | ||
| display routing table | ||
| display ARP cache | ||
| display ARP cache for specific device | ||
| list connections |
For each iproute2 command in the table above, there is also a short form, which I didn’t include. I tend to use the long forms, because I find them easier to remember. and are your friends here.
All traffic to destinations that match a blackhole route is silently discarded.
The general form is
example: , discards all traffic to host with IP address 192.168.0.5.