Linux ip Command: Inspect and Configure Network Interfaces and Routes

ip is an iproute2 tool for checking or changing network interfaces, IP addresses, routing, and neighbor tables. It is not a command to check just a single address, but manages Linux network states by dividing them into multiple objects.

What is the ip command?

The basic format is ip [options] object command. link deals with the interface itself, address with the assigned IP address, route with the next path of packets, and neigh with neighbor information on the same link. Queries usually end with show, but add/del/set actually change the network.

Basic syntax

ip [options] object command [arguments]

The installed implementations and options may vary depending on the distribution. Check the current system's description with man ip.

Examples

Checking interfaces and addresses

You can see the device's UP status along with assigned IPv4 and IPv6 addresses.

ip -br address show

Checking the routing table

You can check the default route and the exit interface for each destination network.

ip route show

Calculate the path to a specific destination

Check the kernel's choice of which interface and source address to use.

ip route get 192.0.2.1

How to read interface status and addresses

ip -brief address shows the name, status, and assigned address of each interface in one line. In the following example, 192.0.2.10 is a documentation address and not the value used in actual settings.

ip -brief address

Example output:

lo      UNKNOWN  127.0.0.1/8 ::1/128
eth0    UP       192.0.2.10/24

UP is the status of the interface, and /24 is the IPv4 network prefix length. Even if there is an address, it does not guarantee an internet connection, so use ip route to check routes and ping or DNS lookup to verify connectivity to the destination separately. During remote access, changing addresses or routes may disconnect the session.

To narrow a network problem, check the address with ip -brief address, the default route with ip route, and name resolution with resolvectl or a DNS tool. A valid-looking address alone does not provide outside connectivity if the default gateway is missing.

Main Options and Format

Options/Format Description
link show Display network interfaces and link status.
address show Display the IP addresses set on the interfaces.
route show Display the routing table.
neigh show Display ARP and NDP neighbor entries.
-br Output supported lookup commands in a simple table format.
-4 / -6 Limit to IPv4 or IPv6 entries.

Precautions when using

If you run ip link set ... down or change the address/default route on a remote server, the connection may be immediately lost. Record the current settings and prepare console access and a recovery plan. Changes made directly with ip may be reset by network management services or lost on reboot, so for permanent settings, follow the distribution's management method.

Frequently Asked Questions

What is the difference between ip address and ip route?

The ip address shows the addresses on interfaces, and ip route shows the routes and next hops for sending packets to destinations.

Official Documentation

The exact behavior of options and differences between implementations can be checked in the official documentation for ip.

More in This Category
Linux apropos Command: Search Commands by Description

Linux apropos Command: Search Commands by Description

Learn how to use the Linux apropos command to find relevant manual pages by searching description keywords, with essential options, practical examples, output interpretation, and common troubleshooting tips.

Linux touch Command: Create Files and Change Timestamps

Linux touch Command: Create Files and Change Timestamps

Learn how to use the Linux touch command to create empty files and change access or modification timestamps, including reference times, date formats, and symlink handling.

Linux xargs Command: Pass Standard Input as Command Arguments

Linux xargs Command: Pass Standard Input as Command Arguments

Learn how to pass Standard Input as Command Arguments with the Linux xargs command, including practical examples, key options, and important precautions.

Linux uniq Command: Remove or Count Adjacent Duplicate Lines

Linux uniq Command: Remove or Count Adjacent Duplicate Lines

Learn how to remove or count adjacent duplicate lines with the Linux uniq command, including practical examples, key options, and important precautions.

Linux history Command: Review and Reuse Shell Command History

Linux history Command: Review and Reuse Shell Command History

Learn how to use the Linux history command to review, search, reuse, and manage shell command history, with essential options, practical examples, output interpretation, and common troubleshooting tips.

Linux shred Command: Overwrite File Data and Understand Its Limits

Linux shred Command: Overwrite File Data and Understand Its Limits

Learn how Linux shred overwrites file data, which options control its passes and removal, and why SSDs, snapshots, backups, and modern filesystems limit its guarantees.

Linux truncate Command: Shrink or Extend File Size

Linux truncate Command: Shrink or Extend File Size

Learn how to shrink or extend files with Linux truncate, adjust sizes relatively, match a reference file, and distinguish sparse logical size from disk usage.

Linux column Command: Format Text as a Table

Linux column Command: Format Text as a Table

Learn how to format Text as a Table with the Linux column command, including practical examples, key options, and important precautions.

Linux Tutorial / Choosing a Linux Distribution

Linux Tutorial / Choosing a Linux Distribution

Explore major Linux distributions and learn when to choose Ubuntu LTS or Rocky Linux for study and server practice. Compare package management, release policies, and practical selection criteria.

Linux lsblk Command: Inspect Disks, Partitions, and Mounts

Linux lsblk Command: Inspect Disks, Partitions, and Mounts

Learn how to inspect Disks, Partitions, and Mounts with the Linux lsblk command, including practical examples, key options, and important precautions.