← 返回命令列表

Linux command

ip-link 命令

网络

复制后可按需替换文件名、目录或参数。

常用示例

Example

ip link

Example

ip link show eth0

Example

ip -s link show eth0

Example

sudo ip link set eth0 up

Example

sudo ip link set eth0 alias "LAN Interface"

Example

sudo ip link set dev eth0 address ff:ee:dd:cc:bb:aa

Example

sudo ip link set eth0 mtu 9000

Example

sudo ip link set eth0 promisc on

Example

sudo ip link add link eth0 name eth0.10 type vlan id 10

说明

ip link manages network devices. It can list interfaces, change their state and parameters (MAC address, MTU, alias, promiscuous mode), and create or delete virtual links such as bridges, bonds, VLANs, VXLANs, dummies, veth pairs, and tun/tap devices. It is part of the iproute2 suite that replaces the older ifconfig utility.

参数

show _device_
Display interface information. Without _device_, all interfaces are shown. Combine with -s for statistics, -d for detailed driver info.
set _device_
Modify properties of an existing interface.
add _link DEV_ name _NAME_ type _TYPE_
Create a virtual interface of the given type (bridge, vlan, veth, dummy, bond, vxlan, ...).
delete _device_
Remove a virtual interface.
up | down
Bring the interface administratively up or down.
address _LLADDR_
Set the link-layer (MAC) address. Usually requires the interface to be down first.
mtu _BYTES_
Set the Maximum Transmission Unit.
alias _NAME_
Set a human-readable interface description.
promisc on | off
Enable or disable promiscuous mode.
multicast on | off
Enable or disable multicast reception.
arp on | off
Enable or disable ARP on the interface.
master _DEVICE_
Enslave the interface to a master (bridge or bond).
nomaster
Detach the interface from its master.
txqueuelen _N_
Set the transmit queue length.
netns _PID_ | _NAME_
Move the interface into the given network namespace.

FAQ

What is the ip-link command used for?

ip link manages network devices. It can list interfaces, change their state and parameters (MAC address, MTU, alias, promiscuous mode), and create or delete virtual links such as bridges, bonds, VLANs, VXLANs, dummies, veth pairs, and tun/tap devices. It is part of the iproute2 suite that replaces the older ifconfig utility.

How do I run a basic ip-link example?

Run `ip link` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does show _device_ do in ip-link?

Display interface information. Without _device_, all interfaces are shown. Combine with -s for statistics, -d for detailed driver info.