找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
楼主: LGA1150

[12/8更新]OpenWrt 上实现 NAT1 (Full cone NAT) 的方法,无需 DMZ/UPnP

 火... [复制链接]
发表于 2018-5-16 08:40 | 显示全部楼层
好贴,收藏了。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-5-16 10:07 | 显示全部楼层

我把补丁修改了一下,试试这个补丁




本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×

点评

已提交 Pull Request  详情 回复 发表于 2018-5-16 16:28
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2018-5-16 16:28 | 显示全部楼层
ekenchan 发表于 2018-5-16 10:07
我把补丁修改了一下,试试这个补丁

已提交 Pull Request

点评

用lede17.01编译不过啊 master可以 GNUmakefile:111: recipe for target 'libipt_FULLCONENAT.oo' failed make[6]: *** [libipt_FULLCONENAT.oo] Error 1 make[6]: Leaving directory '/home/moxx/lede/source/bu  详情 回复 发表于 2018-5-18 14:39
请问下这两个patch是如何生成的呢,我看作者的github已经merge了  详情 回复 发表于 2018-5-18 14:04
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-5-18 14:04 | 显示全部楼层
LGA1150 发表于 2018-5-16 16:28
已提交 Pull Request

请问下这两个patch是如何生成的呢,我看作者的github已经merge了

点评

git diff  详情 回复 发表于 2018-5-18 17:05
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-5-18 14:39 | 显示全部楼层
LGA1150 发表于 2018-5-16 16:28
已提交 Pull Request

用lede17.01编译不过啊 master可以
GNUmakefile:111: recipe for target 'libipt_FULLCONENAT.oo' failed
make[6]: *** [libipt_FULLCONENAT.oo] Error 1
make[6]: Leaving directory '/home/moxx/lede/source/build_dir/target-mips_24kc_musl-1.1.16/linux-ar71xx_generic/iptables-1.4.21/extensions'
Makefile:435: recipe for target 'all-recursive' failed
make[5]: *** [all-recursive] Error 1
make[5]: Leaving directory '/home/moxx/lede/source/build_dir/target-mips_24kc_musl-1.1.16/linux-ar71xx_generic/iptables-1.4.21'
Makefile:363: recipe for target 'all' failed
make[4]: *** [all] Error 2
make[4]: Leaving directory '/home/moxx/lede/source/build_dir/target-mips_24kc_musl-1.1.16/linux-ar71xx_generic/iptables-1.4.21'
Makefile:561: recipe for target '/home/moxx/lede/source/build_dir/target-mips_24kc_musl-1.1.16/linux-ar71xx_generic/iptables-1.4.21/.built' failed
make[3]: *** [/home/moxx/lede/source/build_dir/target-mips_24kc_musl-1.1.16/linux-ar71xx_generic/iptables-1.4.21/.built] Error 2
make[3]: Leaving directory '/home/moxx/lede/source/package/network/utils/iptables'
package/Makefile:105: recipe for target 'package/network/utils/iptables/compile' failed
make[2]: *** [package/network/utils/iptables/compile] Error 2
make[2]: *** Waiting for unfinished jobs....

点评

在libipt_FULLCONENAT.c中加入  详情 回复 发表于 2018-5-18 16:04
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-5-18 16:04 | 显示全部楼层
ade2548 发表于 2018-5-18 14:39
用lede17.01编译不过啊 master可以
GNUmakefile:111: recipe for target 'libipt_FULLCONENAT.oo' faile ...

在libipt_FULLCONENAT.c中加入
  1. #define NF_NAT_RANGE_PROTO_RANDOM_FULLY         (1 << 4)
复制代码


点评

成功了,万分感谢  详情 回复 发表于 2018-5-18 17:09
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2018-5-18 17:05 来自手机 | 显示全部楼层
helllkz 发表于 2018-5-18 14:04
请问下这两个patch是如何生成的呢,我看作者的github已经merge了

git diff  

点评

原谅本小白,毕竟不是程序员,git用的不熟,我运行了git diff,没看到任何效果呢  详情 回复 发表于 2018-5-23 14:49
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-5-18 17:09 | 显示全部楼层
ekenchan 发表于 2018-5-18 16:04
在libipt_FULLCONENAT.c中加入

成功了,万分感谢
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-5-18 23:11 | 显示全部楼层
本帖最后由 helllkz 于 2018-5-18 23:18 编辑

不行呢,按照这个操作了,make menuconfig会报错,而且看不到kmod



重新编辑了下那2个文件,把排版改了下好像就对了。。。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-5-19 12:58 | 显示全部楼层
已经编译成功,并且运行,在 网络-防火墙 基本设置中去掉 WAN 区域的“IP 动态伪装”选项,并且已经添加
iptables -t nat -A zone_wan_prerouting -j FULLCONENAT
iptables -t nat -A zone_wan_postrouting -j FULLCONENAT

设置了这些步骤后无法上网,请问是什么原因?


  245 root         0 IW   [kworker/u2:2]
  288 root         0 IW<  [ipv6_addrconf]
  296 root         0 IW<  [kworker/0:1H]
  415 root         0 SWN  [jffs2_gcd_mtd6]
  418 root         0 IW   [kworker/0:2]
  499 root      1192 S    /sbin/ubusd
  500 root       900 S    /sbin/askfirst /usr/libexec/login.sh
  776 root         0 IW<  [xt_FULLCONENAT]

点评

是否安装了酸酸、去广告、UPnP 等依赖 PREROUTING DNAT 的程序?可能与它们带的防火墙脚本的执行先后顺序有关。FULLCONENAT 正常应该在最后面 要保证 FULLCONENAT 在最后执行,可以把这两行规则写在单独的文件中  详情 回复 发表于 2018-5-19 17:00
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-5-19 15:46 | 显示全部楼层
本帖最后由 琳琅 于 2018-5-19 15:54 编辑

记得openwrt默认就不是Symmetric NAT吧,我电信宽带直接拨号是nat3,过op测试还是nat3啊


哦,看了下blog,貌似op检测nat3是通过upnp实现的?就是说op包括Linux都没有实现nat1?

点评

详情去看我链接里的文章  详情 回复 发表于 2018-5-19 16:46
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2018-5-19 16:46 来自手机 | 显示全部楼层
琳琅 发表于 2018-5-19 15:46
记得openwrt默认就不是Symmetric NAT吧,我电信宽带直接拨号是nat3,过op测试还是nat3啊



详情去看我链接里的文章
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2018-5-19 17:00 来自手机 | 显示全部楼层
本帖最后由 LGA1150 于 2018-6-8 02:23 编辑
futon 发表于 2018-5-19 12:58
已经编译成功,并且运行,在 网络-防火墙 基本设置中去掉 WAN 区域的“IP 动态伪装”选项,并且已经添加
i ...

是否安装了酸酸、去广告、UPnP 等依赖 PREROUTING DNAT 的程序?可能与它们带的防火墙脚本的执行先后顺序有关。FULLCONENAT 正常应该在最后面

要保证 FULLCONENAT 在最后执行,可以把这两行规则写在单独的文件中,比如 /etc/fullconenat.include ,然后编辑 /etc/config/firewall ,在最后添加:
config include 'fullconenat'
  option type 'script'
  option path '/etc/fullconenat.include'
  option reload '1'

然后重启防火墙即可
还可以修改 fw3 源码让它调用 FULLCONENAT 而不是原来的 MASQUERADE,<删掉>不过我没试过</删掉> 已写好补丁替换

点评

18.06.4,没打luci补丁(打也失败),加入自定义规则应用后起效,重启就失效,又需要去自定义规则按一下重启规则才能起效。用你说的这个办法,依然重启无效。没任何报错。  详情 回复 发表于 2019-10-26 12:54
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-5-20 13:13 来自手机 | 显示全部楼层
关注。。。。。。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-5-20 15:30 | 显示全部楼层
请问哪位大神有编译好的有mleaf1.7.2的k2p,能否提供一下
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-16 18:07

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表