ip

>Usage

The ip command is used for managing network interfaces, IP addresses, routing tables, and network devices on Linux and other Unix-like operating systems. It's part of the iproute2 suite, which is preferred over older commands like "ifconfig" for modern network management tasks, as ip provides additional functionalities and a more consistent syntax.

>Synopsis

ip [option]

>Options

link

The command ip link displays or modifies network device properties, such as interface status (up or down), MAC address, MTU (Maximum Transmission Unit), etc. It is used to check the status or configuration of network interfaces or to bring them up/down.

Example:

Dots

link

> ip link


2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:b5:29:64 brd ff:ff:ff:ff:ff:ff

addr del

The command addr del removes an IP address from a network interface.

Example:

Dots

addr del

>ip addr del 192.168.1.20/24 dev eth0


(no output if successful)
This command removes the IP address 192.168.1.20/24 from the eth0 interface.

route

The command ip route is used to show and manage routing tables. You can use ip route list [selector] to narrow down the search.

Example:

Dots

route

> $ ip route show


default via 192.168.1.1 dev eth0
192.168.1.0/24 dev eth0 scope link

link set dev

The command ip link set dev <interface> address is used to change the MAC address of a network interface.

Example 1:

Dots

link set dev

>$ ip link set dev eth0 address 00:11:22:33:44:55


This changes the MAC address of eth0 to 00:11:22:33:44:55.

neigh

The command neigh allows you to view, add, delete, or modify entries in the neighbor cache, which is essential for resolving IP addresses to MAC addresses for communication on a local network.
Its basic syntax being: ip neigh [OPTION] [COMMAND] [ADDRESS]
The neigh option of the ip command in Unix is used to manage the Neighbor Table, also known as the ARP (Address Resolution Protocol) Table for IPv4 or the NDP (Neighbor Discovery Protocol) Table for IPv6.
This table is used to map network-layer addresses (such as IP addresses) to link-layer addresses (such as MAC addresses).

Example:

Dots

neigh

$ ip neigh show


192.168.1.1 dev eth0 lladdr 00:14:22:01:23:45 STALE
192.168.1.100 dev eth0 lladdr 00:14:22:67:89:ab REACHABLE
192.168.1.200 dev eth0 lladdr 00:14:22:cd:ef:01 DELAY

>Quiz

Progress: Question ? out of ?

Question Title

Page written by Marianna Dinon Spindola