-ip link add : 작동할 물리적 장치를 지정(추가)합니다. NAME은 새 가상 장치의 이름을 지정합니다. TYPE은 새 장치의 유형을 지정합니다.
- ip link set : 장치 속성 변경합니다.
- ip link delete : 가상 링크를 삭제합니다.
- ip link show : 장치의 속성을 출력합니다.
네트워크 인터페이스 종류
bridge - Ethernet Bridge device bond - Bonding device dummy - Dummy network interface hsr - High-availability Seamless Redundancy device ifb - Intermediate Functional Block device ipoib - IP over Infiniband device macvlan - Virtual interface base on link layer address (MAC) macvtap - Virtual interface based on link layer address (MAC) and TAP. vcan - Virtual Controller Area Network interface vxcan - Virtual Controller Area Network tunnelinterface veth - Virtual ethernet interface vlan - 802.1q tagged virtual LAN interface vxlan - Virtual eXtended LAN ip6tnl - Virtual tunnel interface IPv4|IPv6 overIPv6 ipip - Virtual tunnel interface IPv4 over IPv4 sit - Virtual tunnel interface IPv6 over IPv4 gre - Virtual tunnel interface GRE over IPv4 gretap - Virtual L2 tunnel interface GRE over IPv4 erspan - Encapsulated Remote SPAN over GRE andIPv4 ip6gre - Virtual tunnel interface GRE over IPv6 ip6gretap - Virtual L2 tunnel interface GRE overIPv6 ip6erspan - Encapsulated Remote SPAN over GRE andIPv6 vti - Virtual tunnel interface nlmon - Netlink monitoring device ipvlan - Interface for L3 (IPv6/IPv4) based VLANs ipvtap - Interface for L3 (IPv6/IPv4) based VLANsand TAP lowpan - Interface for 6LoWPAN (IPv6) over IEEE802.15.4 / Bluetooth geneve - GEneric NEtwork VirtualizationEncapsulation bareudp - Bare UDP L3 encapsulation support macsec - Interface for IEEE 802.1AE MAC Security(MACsec) vrf - Interface for L3 VRF domains netdevsim - Interface for netdev API tests rmnet - Qualcomm rmnet device xfrm - Virtual xfrm interface
ip link 명령어 포맷
ip link delete { DEVICE | group GROUP } type TYPE [ ARGS ]
ip link add [ link DEVICE ] [ name ] NAME [ txqueuelen PACKETS ] [ address LLADDR ] [ broadcast LLADDR ] [ mtu MTU ] [ index IDX ] [ numtxqueues QUEUE_COUNT ] [ numrxqueues QUEUE_COUNT ] [ gso_max_size BYTES ] [ gso_max_segs SEGMENTS ] type TYPE [ ARGS ]
#VLAN Type 지원하는 경우
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 } ] [ bridge_binding { on | off } ] [ ingress-qos- map QOS-MAP ] [ egress-qos-map QOS-MAP ]
ip link set { DEVICE | group GROUP } [ { up | down } ] [ type ETYPE TYPE_ARGS ] [ arp { on | off } ] [ dynamic { on | off } ] [ multicast { on | off } ] [ allmulticast { on | off } ] [ promisc { on | off } ] [ protodown { on | off } ] [ protodown_reason PREASON { on | off } ] [ trailers { on | off } ] [ txqueuelen PACKETS ] [ name NEWNAME ] [ address LLADDR ] [ broadcast LLADDR ] [ mtu MTU ] [ netns { PID | NETNSNAME } ] [ link-netnsid ID ] [ alias NAME ] [ vf NUM [ mac LLADDR ] [ VFVLAN-LIST ] [ rate TXRATE ] [ max_tx_rate TXRATE ] [ min_tx_rate TXRATE ] [ spoofchk { on | off } ] [ query_rss { on | off } ] [ state { auto | enable | disable } ] [ trust { on | off } ] [ node_guid eui64 ] [ port_guid eui64 ] ] [ { xdp | xdpgeneric | xdpdrv | xdpoffload } { off | object FILE [ section NAME ] [ verbose ] | pinned FILE } ] [ master DEVICE ] [ nomaster ] [ vrf NAME ] [ addrgenmode { eui64 | none | stable_secret | random } ] [ macaddr [ MACADDR ] [ { flush | add | del } MACADDR ] [ set MACADDR ] ]
ip link show [ DEVICE | group GROUP ] [ up ] [ master DEVICE ] [ type ETYPE ] [ vrf NAME ]
ip link 명령어 예제
ip link show type bridge # 브릿지 타입의 디바이스를 출력합니다.
ip link show type vlan # vlan 타입의 디바이스를 출력합니다.
ip link delete dev eth0.10 # vlan 디바이스를 삭제합니다.
ip link set eth0.100 up # vlan 디바이스의 상태를 활성화시킵니다.
ip link add link eth0 name eth0.10 type vlan id 10 # 장치 eth0에 새 VLAN 장치 eth0.10을 만듭니다.
ip link set veth0.10 type vlan egress 4:5 # 이 "4" 우선 순위는 송신 qos 매핑에서 VLAN 우선 순위 "5"를 설정하는 데 사용할 수 있습니다.