If you have installed the VLAN kernel module and the Administrative Tools Vconfig,tap/tun Device Management tool TUNCTL, you can set up the relevant network device using the following command:
- Create Bridge:brctl ADDBR [Bridge NAME]
- Delete Bridge:brctl Delbr [Bridge NAME]
- Attach device to Bridge:brctl addif [Bridge name] [device name]
- From bridge Detach device: Brctl Delif [Bridge name] [device name]
- Check Bridge situation: Brctl Show
- To create a VLAN device: vconfig Add [PARENT device NAME] [VLAN ID]
- Remove VLAN device: vconfig REM [VLAN device NAME]
- Set VLAN devices flag:vconfig Set_flag [VLAN device NAME] [flag] [VALUE]
- To set VLAN device QoS:
Vconfig Set_egress_map [VLAN DEVICE NAME] [skb_priority] [Vlan_qos]
Vconfig Set_ingress_map [VLAN DEVICE NAME] [skb_priority] [Vlan_qos]
- Query VLAN device Condition: Cat/proc/net/vlan/[vlan device NAME]
- Create VETH device pair: IP link Add [device NAME0] Type VETH peer name [device NAME1]
- Create tap device: tunctl-p-T [tap device NAME]
- Delete tap device: tunctl-d [tap device NAME]
- Create namespace: IP netns Add [name space]
- Assign the associated device to the namespace: IP link set [DEVICE NAME] netns [name space]
- Query all two-tier devices in the system, including VETH/TAP devices: IP link Show
- Remove normal two-tier device: IP link Delete [device NAME] type [type]
Example of configuring network device commands on Linux