ip Cheat Sheet
The iproute2 suite — addresses, routes, links, neighbors, and namespaces in one command.
Networking3 sections · 21 commands
⌘K
Addresses
6ip addrAll interfaces and addresses
ip addr show eth0One interface
ip addr add 10.0.0.5/24 dev eth0Add an address
ip addr del 10.0.0.5/24 dev eth0Remove an address
ip -4 addrIPv4 only
ip -6 addrIPv6 only
Routes
7ip routeShow the routing table
ip route show defaultDefault gateways
ip route add default via 10.0.0.1Set the default gateway
ip route add 192.168.50.0/24 via 10.0.0.2Add a static route
ip route del 192.168.50.0/24Delete a route
ip route get 8.8.8.8Which route wins for an IP
ip route replace default via NEWGWReplace the default route
Links & Neighbors
8ip linkAll interfaces with states
ip link set eth0 up/downBring an interface up or down
ip link set eth0 mtu 9000Change MTU
ip neighARP/NDP table
ip neigh flush allClear the neighbor cache
ip link add br0 type bridgeCreate a bridge
ip netns add NAMECreate a network namespace
ip netns exec NAME ip addrRun a command in a namespace