ip
Commandip
The ip
command is a versatile tool used to manage networking in Linux. It is part of the iproute2
package and replaces older commands like ifconfig
. This command can configure network interfaces, manage routing, and more.
ip [OPTIONS] OBJECT {COMMAND | help}
ip
The ip
command has several objects, including:
ip link
Manage network interfaces:
ip link [COMMAND]
ip addr
Manage IP addresses:
ip addr [COMMAND]
ip route
Manage routing tables:
ip route [COMMAND]
show
Display information:
ip link show
add
Add a new interface or address:
ip addr add 192.168.1.100/24 dev eth0
del
Delete an interface or address:
ip addr del 192.168.1.100/24 dev eth0
set
Set parameters for an interface:
ip link set dev eth0 up
link set
Change the state of a network interface:
ip link set eth0 down
ip
Commandip link show
This command displays all network interfaces and their status.
ip addr add 192.168.1.100/24 dev eth0
This command assigns the IP address 192.168.1.100
to the eth0
interface.
ip addr del 192.168.1.100/24 dev eth0
This command removes the IP address 192.168.1.100
from the eth0
interface.
ip route show
This command displays the current routing table.
The output of the ip
command can vary based on the object and command used. For example:
Option | Description |
---|---|
link |
Manage network interfaces. |
addr |
Manage IP addresses. |
route |
Manage routing tables. |
neigh |
Manage ARP entries. |
rule |
Manage routing policy rules. |
tunnel |
Manage IP tunnels. |
show |
Display information about the specified object. |
add |
Add a new interface or address. |
del |
Delete an interface or address. |
set |
Set parameters for an interface. |