🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

ip Command

Intermediate Networking man(1)

Show and manipulate network interfaces, routing, and tunnels

👁 12 views 📅 Updated: Mar 15, 2026
SYNTAX
ip [OPTION]... OBJECT COMMAND

What Does ip Do?

The ip command is the modern replacement for ifconfig, route, and arp. It is the primary tool for managing network interfaces, IP addresses, routing tables, and ARP entries in modern Linux systems.

ip is part of the iproute2 package and provides a unified interface for all network configuration tasks. It supports IPv4 and IPv6, VLANs, tunnels, policy routing, and network namespaces.

The ip command uses a consistent object-oriented syntax: ip [object] [action]. Objects include addr (addresses), link (interfaces), route (routing), neigh (ARP), and more.

Options & Flags

OptionDescriptionExample
addr Show or manipulate IP addresses ip addr show
link Show or manipulate network interfaces ip link show
route Show or manipulate routing table ip route show
neigh Show or manipulate ARP/neighbor entries ip neigh show
-c Colorized output ip -c addr show
-br Brief output format ip -br addr show
-4/-6 Show only IPv4 or IPv6 ip -4 addr show
-s Show statistics ip -s link show

Practical Examples

#1 Show all IP addresses

Shows all network interfaces with their IP addresses.
$ ip addr show

#2 Brief address listing

Compact, colorized view of all interfaces and their IPs.
$ ip -br -c addr show
Output: lo UNKNOWN 127.0.0.1/8\neth0 UP 192.168.1.100/24

#3 Show routing table

Displays the current routing table with default gateway.
$ ip route show
Output: default via 192.168.1.1 dev eth0\n192.168.1.0/24 dev eth0 proto kernel

#4 Add an IP address

Adds a secondary IP address to eth0.
$ sudo ip addr add 192.168.1.200/24 dev eth0

#5 Bring interface up/down

Enables the eth0 network interface.
$ sudo ip link set eth0 up

#6 Add a static route

Adds a static route for the 10.0.0.0/8 network.
$ sudo ip route add 10.0.0.0/8 via 192.168.1.254

#7 Show ARP table

Displays the ARP cache showing IP-to-MAC address mappings.
$ ip neigh show

Tips & Best Practices

Use -br for clean output: ip -br addr show gives a much cleaner output than the default. Combined with -c for colors, it is the quickest way to check network status.
Changes are not persistent: ip command changes are temporary and lost on reboot. For persistent configuration, edit /etc/network/interfaces, /etc/netplan/, or use nmcli.
ip replaces ifconfig: ifconfig is deprecated. ip addr replaces ifconfig, ip route replaces route, ip neigh replaces arp. Learn ip as the modern standard.

Frequently Asked Questions

How do I check my IP address?
Use ip addr show or ip -br addr show for a brief view. For just the IP: hostname -I or ip -4 addr show scope global.
How do I see the default gateway?
Use ip route show. The line starting with 'default via' shows your gateway. Or: ip route show default.
What replaced ifconfig?
The ip command from iproute2 replaced ifconfig, route, arp, and netstat. Use: ip addr (ifconfig), ip route (route), ip neigh (arp).

Master Linux with Professional eBooks

Curated IT eBooks covering Linux, DevOps, Cloud, and more

Browse Books →