Iproute2
lastmod 2026-01-05created 2020-07-2319 edits
(For the OSI network layer protocol, see Internet Protocol.)
iproute2 is a collection of userspace utilities for controlling and monitoring various aspects of networking in the Linux kernel, including routing, network interfaces, tunnels, traffic control, and network-related device drivers.
iproute2 is an open-source project released under the terms of version 2 of the GNU General Public License. Its development is closely tied to the development of networking components of the Linux kernel. As of December 2013, iproute2 is maintained by Stephen Hemminger. The original author, Alexey Kuznetsov, was responsible for the quality of service (QoS) implementation in the Linux kernel.
iproute2 collection contains the following command-line utilities: ip, ss, bridge, rtacct, rtmon, tc, ctstat, lnstat, nstat, routef, routel, rtstat, tipc, arpd and devlink. tc is used for traffic control. iproute2 utilities communicate with the Linux kernel using the netlink protocol. Some of the iproute2 utilities are often recommended over now-obsolete net-tools utilities that provide the same functionality. Below is a table of obsolete utilities and their iproute2 replacements.
Categories
- Iproute2:tc (Traffic Control)
- Iproute2:ip
- Iproute2:ss
- netplan - To set a static IP on Ubuntu, see Netplan#How to set a static IP.
ip (linux command)
See Iproute2:ip for details.
How to check whether a network interface is physically connected
Run the ip link command; if state DOWN next to the interface status information changes to state UP, it is connected.
$ ip link
...
2: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000
...
Installing The Linux Dummy-Network Interface
If your NST system does not have an active NIC adapter installed or is off-line from the network, you can install a Dummy Network Interface Module to simulate a network computing environment. This can be quite useful for testing out various networking tools (e.g., Wireshark and Snort) with the Network Security Toolkit when off-line. Use the following procedure to install the Linux Dummy-Network Interface:
1. Add an IP address and host name to your "/etc/hosts" table. For example, an Internet address of 10.0.0.1 would result in:
2. Preload the dummy network driver on the machine. If this command is successful, you do not receive any messages from the server.
3. Create the interface(s) (Example: Network Interface: dummy1):
4. Bind an IPv4 Address to Network Interface dummy1:
5. Bring the dummy1 Network Interface up:
6. If you need to add more than one (1) dummy interface use the following:
$ ip link add dummy2 type dummy;
$ ip link add dummy3 type dummy;
$ ip addr add 10.0.0.2/24 dev dummy2;
$ ip addr add 10.0.0.3/24 dev dummy3;
$ ip link set dummy2 up;
$ ip link set dummy3 up;
7. Check the network bindings with the linux ip command:
[root@nst28-dev ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
link/ether 36:f5:1b:3a:12:41 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.1/24 scope global dummy1
valid_lft forever preferred_lft forever
inet6 fe80::34f5:1bff:fe3a:1241/64 scope link
valid_lft forever preferred_lft forever
3: dummy2: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
link/ether 6a:5c:3f:56:dc:2d brd ff:ff:ff:ff:ff:ff
inet 10.0.0.2/24 scope global dummy2
valid_lft forever preferred_lft forever
inet6 fe80::685c:3fff:fe56:dc2d/64 scope link
valid_lft forever preferred_lft forever
4: dummy3: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
link/ether 86:d5:9f:08:f1:32 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.3/24 scope global dummy3
valid_lft forever preferred_lft forever
inet6 fe80::84d5:9fff:fe08:f132/64 scope link
valid_lft forever preferred_lft forever
Removing The Linux Dummy-Network Interface
1. Unbind the dummy established Network Interface(s):
2. Remove interface:
3. Remove the dummy kernel module.
Edit Routing Table
Add Route
How to check the IP address of a specific interface
Script to check the IPv4 address of the "nebula1" interface:
How to configure communication between IPs in different ranges
See Internet Protocol#How to configure communication between IPs in different ranges.
Examples
- [Recommended] Linux ip Command Examples - nixCraft
Add the following examples:
- List all network interfaces details
- Assign an IP address
- Delete the IP address
- Flush the IP address
- Mark interface as UP or DOWN
- Set the txqueuelen
- Set the MTU
- Show ARP cache
- Add a new ARP entry
- Delete a ARP entry
- Flush ARP cache
- Show routing table
- Add a new route
- Delete a route
- Change MAC address
- Configure color output
- Displaying all IP address
- Old vs. new tool