小编Moh*_*LEL的帖子

Linux 中的发夹

我有一个安装了 Linux 系统的路由器。

我希望我的路由器支持 NAT 发夹。

Kernel Linux 中是否存在这样的功能?如果是如何激活它?是否有补丁可以将其应用于我的内核以支持发夹?

来自维基百科的发夹解释:

Let us consider a private network with the following:

    Gateway address: 192.168.0.1
    Host 1: 192.168.0.5
    Host 2: 192.168.0.7

    The gateway has an external IP : 192.0.2.1
    Host 1 runs a P2P application P1 on its port 12345 which is externally mapped to 4444.
    Host 2 runs a P2P application P2 on its port 12345 which is externally mapped to 5555.

If the NAT device supports hairpinning, then P1 application can …
Run Code Online (Sandbox Code Playgroud)

networking linux nat kernel linux-kernel

6
推荐指数
1
解决办法
5903
查看次数

如何使用 iptables 阻止 https 网站

我想屏蔽一些 https 网站,比如 youtube.com、facebook.com。

我知道我们无法使用 url 规则阻止它。因为网址是加密的。

所以我试图阻止所有包含我想要过滤的域的 DNS 查询。所以我添加了以下规则:

iptables -A OUTPUT -p udp --dport 53 -m string --domain yahoo.com -j DROP
Run Code Online (Sandbox Code Playgroud)

但是youtube继续运行。但是在一段时间不活动(大约 15 分钟)后,youtube 被阻止了。

有什么解释吗?

如何强制立即阻止 youtube?

linux firefox dns iptables ubuntu

2
推荐指数
1
解决办法
2万
查看次数

标签 统计

linux ×2

dns ×1

firefox ×1

iptables ×1

kernel ×1

linux-kernel ×1

nat ×1

networking ×1

ubuntu ×1