用普通网线将PC与开发板直连,
PC:Ubuntu 20.04
开发板:Android Q,内核版本 4.14
PC侧:
sudo vconfig add eno1 5
sudo ifconfig eno1 192.168.1.100 netmask 255.255.255.0 broadcast 192.168.1.255
sudo ifconfig eno1.5 192.168.2.100 netmask 255.255.255.0 broadcast 192.168.2.255
开发板侧:
adb shell
toybox vconfig add eth0 5
ifconfig eth0 192.168.1.101 netmask 255.255.255.0 broadcast 192.168.1.255
ifconfig eth0.5 192.168.2.101 netmask 255.255.255.0 broadcast 192.168.2.255
验证结果:
PC侧 ping 192.168.1.101能通,ping192.168.2.101不通(ICMP request包中带有VLAN tag,对端收到了request包但是没有发出response包),
开发板侧 ping 192.168.1.100能通,ping192.168.2.100不通(没有抓到ICMP request包),
将开发板换成另一个PC(也是Ubuntu 20.04),两台PC之间都能ping通,
即:
PC1侧 ping 192.168.1.101能通,ping192.168.2.101也能通(ICMP request包中带有VLAN tag),
PC2侧 ping 192.168.1.100能通,ping192.168.2.100也能通(ICMP request包中带有VLAN tag),
问题咨询:
1. 验证方法是否有问题?
2. 方法没问题的话,会是什么原因呢?Android VLAN功能有bug?