Chion82 / netfilter-full-cone-nat

A kernel module to turn MASQUERADE into full cone SNAT
GNU General Public License v2.0
427 stars 121 forks source link

你好,armbian平台编译成功,但好像无效? #26

Closed PHCSJC closed 4 years ago

PHCSJC commented 5 years ago

之前是在debian9平台编译安装的,没有任何问题,测试也是fullcone。

这次是在N1上,刷的armbian,内核5.0.2,也同样是按官方教程编译安装成功,iptables里也可以设置FULLCONENAT规则,但是在设置iptables后,部分网络不通,部分可以通,比如浏览网页是正常的,但windows上的ssh客户端去连接外面的服务器又不通,我现在还没找到规律。

我设置为MASQUERADE就都正常了。

大佬这该怎么排查呢?

shikkoku commented 5 years ago

可能对高版本内核不支持。我用的Openwrt 是官方Master分支的内核4.19.57,用的是LGA1150的makefile,无法生效(但log没有任何错误提示。)已经打了内核patch了。你可以看到refactor: support for 4.18.x这一条committ

edward-p commented 5 years ago

之前是在debian9平台编译安装的,没有任何问题,测试也是fullcone。

这次是在N1上,刷的armbian,内核5.0.2,也同样是按官方教程编译安装成功,iptables里也可以设置FULLCONENAT规则,但是在设置iptables后,部分网络不通,部分可以通,比如浏览网页是正常的,但windows上的ssh客户端去连接外面的服务器又不通,我现在还没找到规律。

我设置为MASQUERADE就都正常了。

大佬这该怎么排查呢?

lsmod 看下模块有没有正常加载? 以及 dmesg看下有没有错误

Chion82 commented 5 years ago

For compatibility between kernel versions, please refer to #20. However I have not yet tested the module on a 5.0 or higher kernel.

I'm not sure whether your kernel is patched with some device-specific modifications, so maybe you can try it out on a standard x86 distribution with the same kernel version and then we can make a diagnosis.

shikkoku commented 5 years ago

之前是在debian9平台编译安装的,没有任何问题,测试也是fullcone。 这次是在N1上,刷的armbian,内核5.0.2,也同样是按官方教程编译安装成功,iptables里也可以设置FULLCONENAT规则,但是在设置iptables后,部分网络不通,部分可以通,比如浏览网页是正常的,但windows上的ssh客户端去连接外面的服务器又不通,我现在还没找到规律。 我设置为MASQUERADE就都正常了。 大佬这该怎么排查呢?

lsmod 看下模块有没有正常加载? 以及 dmesg看下有没有错误

平台OpenWrt X86_64 内核4.19.57 lsmod显示已经加载,dmesg也无错误提示。但是无效果。

已经在防火墙加了这两条

iptables -t nat -A zone_wan_prerouting -j FULLCONENAT iptables -t nat -A zone_wan_postrouting -j FULLCONENAT

切换openwrt v18.06.4标签编译https://github.com/LGA1150/openwrt-fullconenathttps://github.com/LGA1150/fullconenat-fw3-patch 可以正常用了。可能真的对新内核支持不好。

PHCSJC commented 5 years ago

大佬你好,我已经在armbian上成功了,可以正常使用了,目前唯一的一个问题是不支持单臂路由,不知道这个大佬会不会去解决呢? 谢谢!