Net-tools to iproute2

From Leo's Notes
Revision as of 18:44, 11 March 2020 by Leo (talk | contribs)
This page was last edited on 11 March 2020, at 18:44.

The deprecated net-tools package contains all legacy network tools such as ipconfig, route, arp, etc. Since tools from net-tools are now obsolete, it is best practice to move towards using the replacement commands provided by iproute2.

The following table maps the old net-tools commands to the new iproute2 commands.

Old net-tools New iproute2 Description
arp ip neighbour Show ARP table
netstat -ln ss -ln Show listening ports
netstat -r ip route Shows routing table
netstat -i ip -s link shows network interface counters
netstat -g ip maddr Show interface group memberships
iwconfig iw Wireless config
iptunnel ip tunnel IP Tunnel configuration
nameif ip link Shows interfaces based on MAC address
ifconfig ip address Shows interface addresses
ifconfig $interface [up|down] ip link set dev $interface [up|down] Bring an interface up or down
ifconfig $interface $ip netmask $netmask ip addr add $ip/$mask dev $interface Adds a secondary IP to an interface
ifconfig $interface del $ip netmask $netmask ip addr del $ip/$mask dev $interface Deletes a secondary IP to an interface
route add default gw $gateway ip route add default via $gateway Adds a default gateway
route add -net $net netmask $netmask gw $gateway ip route add $net/$mask via $gateway Adds a static route via a gateway
route del -net $net gw $gateway netmask $netmask dev $device ip route del $net/$mask via $gateway Deletes a static route
route -n ip route Shows routing table

The iproute2 sub commands can be specified with the shortest unambiguous name (ie. a or addr for address).

Some other commands: