Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

实现Full Cone NAT的iptables要如何设置 #161

Closed
liamcos opened this issue Jan 12, 2021 · 5 comments
Closed

实现Full Cone NAT的iptables要如何设置 #161

liamcos opened this issue Jan 12, 2021 · 5 comments
Labels
documentation Improvements or additions to documentation

Comments

@liamcos
Copy link

liamcos commented Jan 12, 2021

首先感谢开发者。之前自行将xray1.1.4替换了Netch里的v2ray,NAT等级由udpblocked提升到了NAT2,这次更新至1.2.1后NAT2又提升至了NAT1,但有一个问题,服务器设置了iptables规则,NAT等级就会由NAT1(Full Cone NAT)降为NAT4(Symmetric NAT),现在只好在游戏前先开放端口,游戏完后再去恢复规则。请问Full Cone NAT和iptables两者可以兼顾吗?如果可以要怎样设置规则?

@RPRX
Copy link
Member

RPRX commented Jan 12, 2021

@liamcos 我记得 Linux 的 iptables 都是 Symmetric,不支持 FullCone

另外 VLESS 和 VMess 暂时只能 NAT 4,怎么测出 NAT 1 的(误测也最多 NAT 2)

@liamcos
Copy link
Author

liamcos commented Jan 12, 2021

用的Trojan协议测出来是NAT 1,设置了iptables规则再测就NAT 4了,VLESS 和 VMess没测。

@KazamaSion
Copy link

KazamaSion commented Jan 12, 2021

You can patch the iptables and kernel by using Chion82/netfilter-full-cone-nat.
FYI, if using the patch mentioned above, even the proxy protocol itself technically not supporting FULLCONE, some FULLCONE detectors, including Netch and tindy2013/stairspeedtest-reborn, the detector will return "type: FULLCONE" as the result. The developer claims that this is the false report due to software design error.
According to the statement given by the developer, which means the detector itself might not work correctly, I can not say the solution above can help you achieve your goal, because the detector will always say FULLCONE even actually not if applying this patch. I only suggest that you can have a try.

@liamcos
Copy link
Author

liamcos commented Jan 12, 2021

暂时找到一个办法,发现商家提供了一个外置的防火墙可供设置,不设置iptables改用这个经测试依旧可以达到NAT1,楼上说的补丁就不试了。

@liamcos liamcos closed this as completed Jan 12, 2021
@RPRX RPRX added the documentation Improvements or additions to documentation label Jan 16, 2021
@badO1a5A90
Copy link
Member

已加入文档 FAQ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants