我正在尝试使用 VLAN ID 4 标记路由 Linux 机器(Ubuntu 14.04)流量。重要的是,标记将在 Linux 本身中完成,而不是在进一步的交换机中完成。
我使用此命令创建了一个新接口 eth0.4
vconfig add eth0 4
ifconfig eth0.4 10.0.0.32 broadcast 10.0.0.0 up
此外,我检查了 8021q 驱动程序是否已使用
lsmod | grep 8021q
我还添加到 /etc/network/interfaces
auto eth0.4
iface eth0.4 inet static
address 10.0.0.32
netmask 255.255.255.0
vlan-raw-device eth0
当我向 HTTP 网站发出请求时。我没有看到任何来自 vlan 的界面(使用 ifconfig)。
我想知道Linux如何知道通过vlan的接口路由流量?如果不是,我该如何手动配置这样的路由?