网卡VLAN Strip卸载测试

测试目的

验证网卡硬件支持VLAN Strip卸载连通性。

预置条件

按组网方式1搭建测试环境。

测试步骤

  1. 服务器1上创建vlan 10、11、12三个vlan子接口,地址配置如下:

    enp7s0f0: 192.168.0.1/24

    enp7s0f0.10: 192.168.10.1/24

    enp7s0f0.11: 192.168.11.1/24

    enp7s0f0.12: 192.168.12.1/24

    ip link add enp7s0f0.10 link enp7s0f0 type vlan id 10

    ip link add enp7s0f0.11 link enp7s0f0 type vlan id 11

    ip link add enp7s0f0.12 link enp7s0f0 type vlan id 12

    ip link add enp7s0f0.12 link enp7s0f0 type vlan id 12

    ifconfig enp7s0f0 192.168.0.1/24 up

    ifconfig enp7s0f0.10 192.168.10.1/24 up

    ifconfig enp7s0f0.11 192.168.11.1/24 up

    ifconfig enp7s0f0.12 192.168.12.1/24 up

  2. 服务器2上同理创建vlan10、12、111三个vlan子接口,地址配置如下:

    enp7s0f0: 192.168.12.2/24

    enp7s0f0.10: 192.168.10.2/24

    enp7s0f0.12: 192.168.0.2/24

    enp7s0f0.111: 192.168.11.2/24

  3. 在服务器1执行ping 192.168.0.2/24命令, 记录结果1。
  4. 在服务器1执行ping 192.168.10.2/24命令,记录结果2。
  5. 在服务器1执行ping 192.168.11.2/24命令,记录结果3。
  6. 在服务器1执行ping 192.168.12.2/24命令,记录结果4。
  7. 通过ethtool -k enp7s0f0查看 rx-vlan-offload是否均为on,若为on表示VLAN Strip offload打开。
  8. 通过ethtool -K enp7s0f0 rx-vlan-offload off关闭VLAN Strip offload,再用ethtool -k查看,用ethtool -k enp7s0f0 rx-vlan-offload on改回,记录结果5。

预期结果

  1. 结果1显示ping不通,本端没有配vlan接口。
  2. 结果2显示可以ping通。
  3. 结果3显示ping不通,本端与对端不是同一个vlan。
  4. 结果4显示ping不通,对端没有配vlan接口。
  5. 结果5的设置开关成功。

测试结果

-

备注

-