Linux ip command Cheat Sheet

The ip command is a versatile command on Linux. You can use it to view, monitor, and manage IP configurations. This tutorial provides a ready-to-use collection of the ip command with examples.

Viewing/managing IP addresses

Command Description Example
ip address show Display IP configuration of all interfaces ip address show
ip address show [interface] Display IP configuration of the specified interface ip address show ens160
ip address add [ip address/subnet mask] dev [interface] Temporarily add the specified IP address to the specified interface ip address add 10.0.0.1/8 dev ens160
ip address del [ip address/ subnet mask] dev [interface] Temporarily delete the specified IP address from the specified interface ip address del 10.0.0.1/8 dev ens160

Viewing/managing multicast addresses

Command Description Example
ip maddr Display multicast addresses of all interfaces ip maddr
ip maddr show dev [interface] Display the multicast address of the specified address ip maddr show dev ens160
ip maddr add [multicast address] dev [interface] Temporarily add the specified multicast address to the specified interface ip maddr add 22:22:22:00:00:01 dev ens160
ip maddr del [multicast address] dev [interface] Temporarily remove the specified multicast address from the specified interface ip maddr remove 22:22:22:00:00:01 dev ens160

Displaying/managing link state information

Command Description Example
ip link show Display link state information for interfaces ip link show
ip link show [interface] Display link state information for the specified interface ip link show ens160
ip -s link Display statistics for all interfaces ip -s link
ip link set [interface] down Bring the specified interface offline ip link set ens160 down
ip link set [interface] up Bring the specified interface online ip link set ens160 up
ip link set [interface] mtu [mtu value] Set the specified mtu value on the specified interface ip link set ens160 mtu 9000
ip link set [interface] promisc on Set the promiscuous mode on for the specified device ip link set ens160 promisc on

Showing default gateway/route

Command Description Example
ip route Display all route entries from the routing table ip route
ip -4 route Display only IPv4 routes ip -4 route
ip -6 route Display only IPv6 routes ip -6 route

Displaying ARP/neighbor table

Command Description Example
ip neigh Show the ARP neighbor table ip neigh
ip neigh show dev [interface] Show the ARP neighbor table for the specified device ip neigh show dev ens160

Viewing help

Command Description Example
ip help Display help about the ip command ip help
ip address help Display help about the address option and its arguments ip address help
ip link help Display help about the link option and its arguments ip link help
ip neigh help Display help about the neigh option and its arguments ip neigh help

ComputerNetworkingNotes Linux Tutorials Linux ip command Cheat Sheet