【问题标题】:Redirecting mirrored traffic from OpenBSD从 OpenBSD 重定向镜像流量
【发布时间】:2019-01-09 12:57:21
【问题描述】:
我有一个运行 OpenBSD 的软件路由器和一个在单独物理机上的 VM 上的 DPI 服务。
我希望所有通过的流量都从 OpenBSD 机器在线镜像到 DPI 机器(不是批量,而是合理地最小化延迟)。我知道一种通过 SSH 将tcpdump 输出通过隧道传送到侦听主机并在那里tcpreplaying 的方法,但感觉真的很hacky。
什么方法适合我的设置?像 GRE 镜像这样的隧道?
【问题讨论】:
标签:
virtual-machine
openbsd
network-monitoring
【解决方案1】:
如果我理解正确,这可以通过桥接来完成。
假设您在 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.