重定向来自 OpenBSD 的镜像流量



我有一个运行OpenBSD的软件路由器,在单独的物理机上的VM上有一个DPI服务。

我希望所有传递的流量都从OpenBSD机器在线镜像到DPI机器(不是批量的,而是合理最小化的延迟)。 我知道一种方法可以通过 SSH 将输出隧道tcpdump到侦听主机并在那里tcpreplay,但它感觉真的很黑客。

对于我的设置来说,正确的方法是什么? 也许像 GRE 镜像这样的隧道?

如果我理解正确,这可以通过桥来完成。假设您在 if1 上有传入流量,在 if2 上有传出流量,并且您的 DPI 机器背靠背有一个 if3,并且启用了 IP 转发。然后你可以

ifconfig bridge0 create
ifconfig bridge0 add if1 add if2 up
ifconfig bridge0 addspan if3

然后根据人4桥

SPAN PORTS
     The bridge can have interfaces added to it as span ports.  Span ports
     transmit a copy of every frame received by the bridge.  This is most
     useful for snooping a bridged network passively on another host connected
     to one of the span ports of the bridge.  Span ports cannot be bridge
     members; instead, the addspan and delspan commands are used to add and
     delete span ports to and from a bridge.

最新更新