【问题标题】:Emulate promiscuous mode with iptables使用 iptables 模拟混杂模式
【发布时间】:2017-09-12 03:42:58
【问题描述】:

我正在尝试在我的家庭网络上运行 snort,但我没有可以镜像端口的交换机。相反,我有一个带有番茄(dd-wrt)的华硕 RT-N16。经过数小时的搜索,我找到了唯一的解决方案:http://www.snort.org/assets/182/snort-opensuse-vbox-ddwrt.txt

基本上他们说要创建这两个 iptables 规则:

iptables -A PREROUTING -t mangle -j ROUTE --gw 192.168.1.20 --tee

iptables -A POSTROUTING -t mangle -j ROUTE --gw 192.168.1.20 --tee

问题在于 --gw 不是有效标志。

然后我需要创建一个脚本来检查规则是否存在。如果是,请删除该规则。如果没有,请创建规则。

我应该 grep iptables -L -v -n --line-n 还是应该 grep iptables-save

  1. 什么是正确的 iptables 语法来模拟到 192.168.1.20 的混杂端口?

  2. 如何创建脚本以在不存在时打开 iptables 规则,如果存在则将其删除?

谢谢,

瑞恩

【问题讨论】:

    标签: iptables snort dd-wrt promiscuous-mode


    【解决方案1】:

    几个月前我在番茄上做了这个。

    您至少需要 Tomato v1.24,其中包括 ipt_ROUTE。它用于启用 -j ROUTE 和 --tee 功能。

    /sbin/modprobe ipt_ROUTE

    然后添加你上面提到的 iptables 规则。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-10-04
      • 1970-01-01
      • 2012-03-31
      • 2014-01-02
      • 2017-10-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多