Youtube 没有被 iptables 屏蔽

spe*_*eps 18 iptables

在我们的 Ubuntu 机器上,我试图通过将以下行添加到 /etc/network/interfaces 来阻止对某个用户帐户的互联网访问:

pre-up iptables -A OUTPUT -p tcp -m owner --uid-owner 1001 -j DROP
Run Code Online (Sandbox Code Playgroud)

这很好用,除非 Youtube 和其他 Google 属性没有被阻止。

我不是 iptables 的专家,但我认为上述命令会丢弃来自指定用户的所有传出请求。谷歌资产有什么特别之处会以某种方式导致它们被豁免吗?

作为参考,这里是我的 iptables 列表:

$ sudo iptables --list

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
DROP       tcp  --  anywhere             anywhere             owner UID match ****
Run Code Online (Sandbox Code Playgroud)

Edu*_*ani 36

用户是否使用 Chrome/Chromium?如果是这样,浏览器很可能对这些站点使用QUIC,并且该协议使用 UDP 作为传输。

您可以阻止 UDP 端口 80 和 443 来解决它。

  • 您也可以删除`-p tcp`,从而阻止所有内容。 (10认同)
  • 我想知道 Chrome 与 Google 网站是否有什么特别之处。那绝对是它。我删除了 -p tcp,现在一切都被阻止了。 (2认同)