在我创建了这样一个新的虚拟接口之后:
ip link add link eth0 name eth0.100 type vlan id 100
Run Code Online (Sandbox Code Playgroud)
之后如何验证是否为该 VLAN 配置了虚拟接口?两者都不
ip link show eth0.100
Run Code Online (Sandbox Code Playgroud)
也不
ip a s
Run Code Online (Sandbox Code Playgroud)
似乎显示任何 VLAN 信息。
sta*_*fry 17
刚刚在寻找其他东西时发现了这个问题......
您即将完成...您需要使用的是-d
显示有关链接的详细信息,然后您可以使用该链接grep
获取 VLAN 信息:
$ ip -d link show dev eth0.100 | grep 'vlan protocol'
vlan protocol 802.1Q id 5 <REORDER_HDR>
Run Code Online (Sandbox Code Playgroud)
找到了以下解决方案:
cat /proc/net/vlan/eth0.2011
eth0.2011 VID: 2011 REORDER_HDR: 1 dev->priv_flags: 1 total frames received 1129 total bytes received 55318 Broadcast/Multicast Rcvd 0
total frames transmitted 8
total bytes transmitted 648
Device: eth0 INGRESS priority mappings: 0:0 1:0 2:0 3:0 4:0 5:0 6:0 7:0
EGRESS priority mappings:
Run Code Online (Sandbox Code Playgroud)