iproute2 vs net-toolshttps://linoxide.com/iproute2-vs-net-tools/
iproute2 package contains utilities for controlling and monitoring networking, IP address, and routing. It is a modern replacement for net-tools.
Iproute2 is an open-source project mainly focussed on network components of the Linux kernel. The commonly used utilities inside iproute2 are ip, ss, and bridge.
6M
56
Activision Blizzard Shareholders Vote in Favor of Microsoft’s $68.7 Billion Takeover Bid
The below table shows the iproute2 and deprecated net-tools Linux commands.
iproute2 | net-tools | Note |
ip link show | ifconfig -a | Display all interfaces |
ip link set down/up eth0 | ifconfig eth0 up/down | Enable (UP)/Disable (DOWN) Network Interface |
ip addr add 192.168.0.10/24 dev eth0 | ifconfig eth0 192.168.0.10/24 | Assign an IPv4 address to Network Interface |
ip addr del 192.168.0.10/24 dev eth0 | ifconfig eth0 0 | Delete an IPv4 address from Network Interface |
ip addr show dev eth0 | ifconfig eth0 | Display IPv4 address of a Network Interface |
ip -6 addr add fe80::f0b7:57ff:fe2f:5f0d/64 dev eth1 | ifconfig eth1 inet6 add fe80::f0b7:57ff:fe2f:5f0d/64 | Assign an IPv6 address to a Network Interface |
ip -6 addr show dev eth0 | ifconfig eth0 | Display IPv6 address of a Network Interface |
ip link set dev eth0 address 02:42:20:d2:28:36 | ifconfig eth0 hw ether 02:42:20:d2:28:36 | Change the MAC Address of a Network Interface |
ip route show | route -n | Show IP Routing Table |
ip route add default via 192.168.0.1 dev eth0 | route add default gw 192.168.0.1 eth0 | Add a Default Route |
ip route replace default via 192.168.0.1 dev enp0s3 | route del default gw 192.168.0.1 enp0s3 | Delete a Default Route |
ip route add 10.24.32.0/24 via 192.168.0.1 dev enp0s3 | route add -net 10.24.32.0/24 gw 192.168.0.1 dev enp0s3 | Add a Static Route |
ip route del 192.168.10.0/24 | route del -net 192.168.10.0/24 | Delete a Static Route |
ss | netstat | Display socket - listening tcp/udp |
arp -an | ip neigh | Display ARP Table |
bridge | brctl | Manage bridge addresses and devices |
iproute2 cheat sheet
Many Linux users still prefer to use legacy tools such as netstat, ifconfig, route etc. Iproute2 package tools are pretty faster and retrieve more information for example ss command is faster than netstat.