我的目标是将所有具有特殊以太网类型的以太网流量发送到特定接口。OpenVSwitch因此,我的接口上有一个虚拟开关eth0,我使用点击接口来检索特定帧以处理它们。正常流被发送到tap1,而特殊流被发送到tap0。这是 OpenVSwitch 配置:
# ovs-vsctl show
44c95237-25bd-45fd-bb97-d596aecf5f46
Bridge brLan
Port "tap0"
Interface "tap0"
Port "tap1"
Interface "tap1"
Port eth0
Interface eth0
Port brLan
Interface brLan
type: internal
ovs_version: "2.5.0"
brLan在带有 3 个端口( 、 和 )的桥上,eth0我tap0想将tap1所有带有 ethertype = 的帧切换0x88B5到tap0,而所有其他帧都在进行tap1。
我因此制定了这些 OpenFlow 规则:
# ovs-ofctl add-flow brLan "idle_timeout=0,priority=33100,in_port=1,dl_type=0x88b5,actions=output:6"
# ovs-ofctl add-flow brLan "idle_timeout=0,priority=33100,in_port=1,actions=output:7"
其中6是 的 ID是tap0的7ID tap1,显示为# ovs-ofctl show brLan
eth0现在,如果我使用 ethertype将帧发送到此接口0x88B5,它们不会切换到tap0,如命令所示:
# ovs-ofctl dump-flows brLan
NXST_FLOW reply (xid=0x4):
cookie=0x0, duration=54229.821s, table=0, n_packets=27269, n_bytes=1636190, idle_age=0, priority=33100,in_port=1 actions=output:7
cookie=0x0, duration=54229.790s, table=0, n_packets=0, n_bytes=0, idle_age=54229, priority=33100,in_port=1,dl_type=0x88b5 actions=output:6
第一个流程是普通以太网帧的正常流程,我看没问题,好切换到tap1。但是关于流向output:6,没有帧到达,即使我可以使用 WireShark 显示它们!
关于如何解决这个问题的任何想法,以使带有 ether_type = 的帧切换0x88B5到达tap0?