virtual-machine - 从 OpenBSD 重定向镜像流量
问题描述
我有一个运行 OpenBSD 的软件路由器和一个在单独物理机上的 VM 上的 DPI 服务。
我希望所有通过的流量都从 OpenBSD 机器在线镜像到 DPI 机器(不是批量,而是合理地最小化延迟)。我知道一种tcpdump
通过 SSH 将输出隧道传输到侦听主机并tcpreplay
在那里 ing 的方法,但感觉真的很hacky。
我的设置有什么合适的方法?像GRE镜像这样的隧道?
解决方案
如果我理解正确,这可以通过桥来完成。假设您在 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.
推荐阅读
- hotkeys - 特殊字符的自动关键字短语
- gnuplot - 在 gnuplot 上绘制 10 行软 1000 个值
- regex - 如何从Pig中的方括号中提取字符串
- vue.js - 如何使用 Vue 和 axios 检索和显示单个记录
- node.js - Ffmpeg:此解码器不支持比特流
- api - V2 API - 访问权限不足
- amazon-web-services - 使用 NAT 实例从外部连接到 Elasticache
- angular - Angular 6 DataTables 最初显示但过滤器控件不起作用
- node.js - 将 vscode 调试器与 webpack 和 node.js 一起使用
- python - python pipe limited to 196608 ( 65536*3 ) with subprocess.Popen()