【问题标题】:how to block forwarding traffic from the physical interface( seth_w0) to VPN interface( tun0)如何阻止从物理接口(seth_w0)到 VPN 接口(tun0)的转发流量
【发布时间】:2016-06-29 07:47:04
【问题描述】:

我有一个要求,需要阻止某些进程使用 VPN 接口 (tun0) 使用网络数据。

物理接口(蜂窝数据)-> tun0->用户空间程序->物理接口->目的地。

如果我错了,请纠正我,上述方式在启用 VPN 时流量仍然流动。

所以如果我想阻止一个特定的进程网络数据包不转发到 tun0 接口,我已经为物理接口和 tun0 接口应用了 iptable 规则。应用程序仍然可以使用 tun0 接口使用网络数据。

有没有办法阻止tun0接口的流量?

【问题讨论】:

    标签: vpn iptables


    【解决方案1】:

    不知道你设置了哪些规则,但也许这个修复

    (只允许tun0,拒绝其他)

    iptables -A INPUT -i tun0 -j ACCEPT

    iptables -A OUTPUT -o tun0 -j ACCEPT

    iptables -A 输入 -i ! tun0 -j 拒绝

    iptables -A 输出 -o ! tun0 -j 拒绝

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-07-22
      • 2011-09-08
      • 1970-01-01
      • 2014-04-23
      • 1970-01-01
      • 2013-04-10
      • 1970-01-01
      相关资源
      最近更新 更多