从OpenBSD重定向镜像流量

时间:2019-01-09 12:57:22

标签: virtual-machine openbsd network-monitoring traffic-mirroring

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

我希望所有通过的流量都可以从OpenBSD机器在线镜像到DPI机器(不是批量的,但是可以将延迟最小化)。我知道一种方法,可以通过SSH将tcpdump输出通过SSH传输到侦听主机,然后tcpreplay将其在那里传输,但这确实很麻烦。

什么是适合我的设置的方法?像GRE镜像一样令人费解的东西吗?

1 个答案:

答案 0 :(得分:0)

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

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

然后根据man 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.
相关问题