Skip to content

ip command

Show and change IP addresses, routes and network interfaces.

  • Networking
  • Package iproute2
  • 7 options · 8 examples
On this page

Syntax

ip [options] object command

Provided by the iproute2 package. Run man ip for the full manual.

Common options

OptionWhat it does
a / addrAddresses
linkInterfaces
r / routeRouting table
n / neighARP / neighbour table
-brBrief output
-4 / -6Only IPv4 or IPv6
-cColour output

Examples

  1. Show all IP addresses

    ip a
  2. Brief list of interfaces and addresses

    ip -br a
  3. Show the routing table

    ip r
  4. Default gateway

    ip route show default
  5. Add an address

    sudo ip addr add 192.0.2.50/24 dev eth0
  6. Bring an interface up

    sudo ip link set eth0 up
  7. Show the ARP table

    ip neigh
  8. Which route a packet takes

    ip route get 8.8.8.8

Tips

  • ip replaces the old ifconfig and route commands. Changes made with it are lost on reboot; use Netplan or NetworkManager to keep them.

ip guides

← All Linux commands · Suggest a fix

Back to top