You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ip link add link DEVICE name NAME type vlan [ protocol VLAN_PROTO ] id VLANID [ reorder_hdr { on | off } ] [ gvrp { on | off } ] [ mvrp { on | off } ] [ loose_binding { on | off } ] [ ingress-qos-map QOS-MAP ] [ egress-qos-map QOS-MAP ]
VXLAN Type Support
ip link add DEVICE type vxlan id VNI [ dev PHYS_DEV ] [ { group | remote } IPADDR ] [ local { IPADDR | any } ] [ ttl TTL ] [ tos TOS ] [ flowlabel FLOWLABEL ] [ dstport PORT ] [ srcport MIN MAX ] [ [no]learning ] [ [no]proxy ] [ [no]rsc ] [ [no]l2miss ] [ [no]l3miss ] [ [no]udpcsum ] [ [no]udp6zerocsumtx ] [ [no]udp6zerocsumrx ] [ ageing SECONDS ] [ maxaddress NUMBER ] [ [no]external ] [ gbp ] [ gpe ]
VETH, VXCAN Type Support
ip link add DEVICE type { veth | vxcan } [ peer name NAME ]
GRE, IPIP, SIT, ERSPAN Type Support
ip link add DEVICE type { gre | ipip | sit | erspan } remote ADDR local ADDR [ encap { fou | gue | none } ] [ encap-sport { PORT | auto } ] [ encap-dport PORT ] [ [no]encap-csum ] [ [no]encap-remcsum ] [ mode { ip6ip | ipip | mplsip | any } ] [ erspan IDX ] [ external ]
IP6GRE/IP6GRETAP Type Support
ip link add DEVICE type { ip6gre | ip6gretap } remote ADDR local ADDR [ [i|o]seq ] [ [i|o]key KEY ] [ [i|o]csum ] [ hoplimit TTL ] [ encaplimit ELIM ] [ tclass TCLASS ] [ flowlabel FLOWLABEL ] [ dscp inherit ] [ dev PHYS_DEV ]
IPoIB Type Support
ip link add DEVICE name NAME type ipoib [ pkey PKEY ] [ mode MODE ]
GENEVE Type Support
ip link add DEVICE type geneve id VNI remote IPADDR [ ttl TTL ] [ tos TOS ] [ flowlabel FLOWLABEL ] [ dstport PORT ] [ [no]external ] [ [no]udpcsum ] [ [no]udp6zerocsumtx ] [ [no]udp6zerocsumrx ]
MACVLAN and MACVTAP Type Support
ip link add link DEVICE name NAME type { macvlan | macvtap } mode { private | vepa | bridge | passthru [ nopromisc ] |source }
ip link add link DEVICE name NAME type macsec [ [ address <lladdr> ] port PORT | sci SCI ] [ cipher CIPHER_SUITE ] [ icvlen { 8..16 } ] [ encrypt { on | off } ] [ send_sci { on | off } ] [ end_station { on | off } ] [ scb { on | off } ] [ protect { on | off } ] [ replay { on | off } window { 0..2^32-1 } ] [ validate { strict | check | disabled } ] [ encodingsa { 0..3 } ]
# 创建 VETH 设备
ip link add link [DEVICE NAME] type veth
TAP
# 创建 TAP 设备
tunctl -p [TAP DEVICE NAME]
# 删除 TAP 设备
tunctl -d [TAP DEVICE NAME]
# 查询系统里所有二层设备,包括 VETH/TAP 设备
ip link show
# 删除普通二层设备
ip link delete [DEVICE NAME] type [TYPE]