iproute2 is the standard collection of user-space utilities for configuring networking in Linux, covering interfaces, addresses, routing, neighbor tables, tunnels, network namespaces and traffic control. It talks to the kernel through Netlink sockets and has replaced the older net-tools package, whose commands such as ifconfig, route and netstat are now considered legacy.
In Linux networking, iproute2 is the low-level layer that almost every higher-level tool builds on or mirrors. NetworkManager, systemd-networkd and Netplan write persistent configuration, but administrators use iproute2 to inspect the live kernel state and to make immediate, temporary changes.
How iproute2 communicates with the kernel
iproute2 sends structured requests over rtnetlink, the routing family of the Netlink protocol, instead of using the older ioctl calls that net-tools relied on. Netlink messages carry typed attributes, so new kernel features such as VRF devices, multipath routes or VXLAN options can be exposed without redesigning the interface.
Because the kernel is the single source of truth, iproute2 shows exactly what the network stack is doing at that moment. Every change it makes is applied immediately but not persistent: a reboot or a restart of the network manager discards it unless the same settings are stored in a configuration system.
Netlink also supports event subscriptions. The ip monitor mode listens for kernel notifications and prints link, address and route changes as they happen, which is valuable when diagnosing flapping interfaces or routing daemons.
Utilities included in iproute2
The package contains several specialized programs, each responsible for one area of the network stack. The table below lists the most frequently used ones.
| Utility | Purpose | Typical use |
|---|---|---|
| ip | Interfaces, addresses, routes, rules, namespaces | Assigning an address or adding a route |
| ss | Socket statistics | Listing listening ports and TCP connection states |
| tc | Traffic control and queuing disciplines | Shaping bandwidth or adding latency |
| bridge | Linux bridge ports, VLANs and forwarding database | Inspecting learned MAC addresses |
| devlink | Device-level settings for network hardware | Configuring SmartNIC or switch ASIC options |
| nstat | Kernel network counters | Tracking retransmissions and drops |
The ip utility is organized into objects and actions. Objects include link, address, route, rule, neigh, netns, tunnel and xfrm; actions include show, add, del, set and flush. Commands accept unique prefixes, so ip a is equivalent to ip address show.
Recent versions add machine-readable output. The -j option produces JSON, the -br option prints a compact one-line summary per interface, and -c adds color. JSON output makes iproute2 a reliable data source for scripts and monitoring agents.
iproute2 compared with net-tools
iproute2 is the maintained successor to net-tools, and most current distributions no longer install net-tools by default. The older commands still work on many systems, but they cannot display or configure several modern kernel features.
| Task | Legacy net-tools command | iproute2 command |
|---|---|---|
| Show interfaces and addresses | ifconfig | ip address show |
| Show routing table | route -n | ip route show |
| Show ARP or neighbor table | arp -n | ip neigh show |
| List open sockets | netstat -tulpn | ss -tulpn |
| Manage bridges | brctl | ip link and bridge |
| Multicast memberships | netstat -g | ip maddress show |
The practical differences are significant. ifconfig shows only one address per interface label and hides secondary addresses added with iproute2, while ip address lists every IPv4 and IPv6 address. net-tools also has no support for policy routing tables, network namespaces or most tunnel types.
Advanced capabilities of iproute2
Beyond basic addressing, iproute2 exposes the full feature set of the Linux network stack, which is why container runtimes, VPN software and routers depend on it.
- Policy-based routing:
ip ruleselects one of up to 2^32 routing tables by source address, firewall mark or interface; named tables live in thert_tablesfile under the iproute2 configuration directory. - Network namespaces:
ip netnscreates isolated network stacks, the same mechanism containers use. - Virtual devices:
ip link addcreates veth pairs, VLAN, VXLAN, bond, bridge, macvlan, WireGuard and VRF interfaces. - IPsec state:
ip xfrmmanages security associations and policies in the kernel. - Equal-cost multipath: a single route can list several next hops with weights.
The next table shows which iproute2 object handles common advanced tasks.
| Task | Object | Example |
|---|---|---|
| Route traffic from one subnet via a second uplink | ip rule and ip route | ip rule add from 10.2.0.0/24 table 200 |
| Connect a namespace to the host | ip link with veth | ip link add veth0 type veth peer name veth1 |
| Tag traffic with VLAN 30 | ip link with vlan | ip link add link eth0 name eth0.30 type vlan id 30 |
| Add 50 ms of delay for testing | tc qdisc | tc qdisc add dev eth0 root netem delay 50ms |
| Watch routing changes live | ip monitor | ip monitor route |
Common mistakes and limitations of iproute2
The most common mistake is treating iproute2 changes as permanent. An address added with ip address add disappears after a reboot, and NetworkManager or systemd-networkd may remove it even sooner when they reapply their own configuration.
- Conflicting managers: manual changes on an interface controlled by NetworkManager can be silently overwritten.
- Missing prefix length: omitting
/24assigns a/32host address and breaks the connected route. - Flushing the wrong object:
ip address flush dev eth0over SSH can cut off the remote session. - Assuming the main table: with policy routing,
ip route showdisplays only the main table;ip route show table allreveals the rest.
iproute2 is also not a configuration management system. It has no file format for complete interface definitions and does not handle DHCP, Wi-Fi authentication or DNS; those tasks belong to tools such as NetworkManager, wpa_supplicant and systemd-resolved.
In simple terms
iproute2 is the toolbox Linux administrators use to see and change network settings directly in the system core. With it, they can check which addresses a computer has, which path its traffic takes and which connections are open.
Think of it as the control panel behind the scenes. Friendly network settings windows save preferences and restore them after each restart, but iproute2 changes what is happening right now. That makes it ideal for troubleshooting, while permanent settings belong elsewhere.
A practical example
A hosting provider runs a Linux server with two uplinks: a primary link on 203.0.113.0/24 and a backup link on 198.51.100.0/24. Replies to clients who reach the backup address were leaving through the primary link, so upstream filters dropped them as spoofed traffic.
The engineer creates a second routing table named backup with ID 200, adds a default route through the backup gateway with ip route add default via 198.51.100.1 table backup, and adds ip rule add from 198.51.100.10 table backup. Running ss -tn and ip route get 192.0.2.50 from 198.51.100.10 confirms the path. After testing, the same rules are written into the systemd-networkd configuration for persistence. The result is symmetric routing on both uplinks and no more dropped replies.