Introduction

The ip command is an extremely powerful tool used to manage network interfaces, IP addresses, network routing, and ARP/neighbor cache on Linux systems. It comes preinstalled on all modern Linux distros as part of the iproute2 package which is a collection of different network utilities. The ip command is a modern replacement of many deprecated net-tools utilities such as ifconfig, route, arp, etc.

Command Structure

The ip command has the following syntax

ip [ OPTIONS ] OBJECT { COMMAND | help }

Let me break down the syntax for you:

When you are working with IP objects, you can save time by using abbreviated or shortened object names. For instance, instead of typing "address," you can simply use "addr" or even just "a."

Managing Network Interfaces

The “link” object is used to manage all network interfaces available on a device, for example, wired connections and Wi-Fi adaptors.

Listing all network interfaces

To list all available network interfaces use the following command:

ip link show

This command is generally used to see the state (up or down) of network interfaces. Additionally from its output, you can find the interface name, its MAC address, MTU size, etc.

Activating a network interface

To activate a network interface, use “ip link set dev” followed by the device name and then the “up” state.

Here is an example of activating the wlan0 interface:

ip link set dev wlan0 up