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

options: ext_ip_reserved_ignore support #511

Closed
wants to merge 1 commit into from

Conversation

ptpt52
Copy link
Contributor

@ptpt52 ptpt52 commented Nov 25, 2020

add an option to ignore even if ext_ip is reserved

this make the port forwarding force to work when the router is behind NAT

This make the port forwarding force to work even
when the router is behind NAT

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
@pali
Copy link
Contributor

pali commented Dec 2, 2020

Function addr_is_reserved checks if address is external public or not and based on it construct reply for GetExternalIPAddress UPnP XML function. So this patch breaks GetExternalIPAddress function and it returns nonsense/incorrect reply.

Have you tested this change? I'm guess that not because miniupnpc at the first stage checks that GetExternalIPAddress returns correct value which results that miniupnpc would be confused or not work.

And even that port forwarding obviously does not work behind NAT (with small exception when full cone NAT 1:1 is used).

I do not know what @miniupnp thinks about it, but this patch does not make sense at all.

@pali
Copy link
Contributor

pali commented Feb 25, 2021

@miniupnp: maybe you should comment this pull request...

@miniupnp miniupnp self-requested a review February 26, 2021 14:35
@miniupnp miniupnp self-assigned this Feb 26, 2021
@miniupnp
Copy link
Owner

addr_is_reserved() behavior should not be changed.

@pali
Copy link
Contributor

pali commented Mar 25, 2021

Any updates in this pull request? Based on my above comments, I do not think that pull request should be merged... so it can be closed?

@ptpt52
Copy link
Contributor Author

ptpt52 commented Mar 25, 2021

so there is no possible to add DNAT rule if router has no public ip? this seems not true in real world

@pali
Copy link
Contributor

pali commented Mar 28, 2021

See my comment, it is working fine if you are behind Full Cone NAT 1:1. Just you need to supply public IP address which is required by UPnP protocol. It can be done either automatically by reading it from wan interface or by discovery via stun code when ext_perform_stun=yes is set or manually by command line argument -o or by config option ext_ip.

@pali
Copy link
Contributor

pali commented Apr 27, 2021

@miniupnp I think you should close this pull request. People now started reporting bugs against this patch (like this) as openwrt already expressed that do not maintain this custom patch. It looks like that openwrt has misconfigured iptables/routing (like can be seen in this patch and links from it) which caused issues in miniupnpd and they are trying to hack them by patch like this one.

@pali
Copy link
Contributor

pali commented Jun 5, 2021

Patch in this pull request is causing more issues (e.g. openwrt/packages#15258 or #546 openwrt/packages#14031 (comment)) and OpenWRT now decided to disable this option by default due to lot of bug reports openwrt/packages#15759

@ptpt52
Copy link
Contributor Author

ptpt52 commented Jul 2, 2021

close this.

addr_is_reserved() behavior should not be changed.

@ptpt52 ptpt52 closed this Jul 2, 2021
BKPepe added a commit to BKPepe/packages that referenced this pull request Jul 19, 2021
This patch is causing several issues [1], which then were reported to
upstream [2] and it was not accepted by upstream [3]. This results that
nobody maintain this custom patch and it is not useful as it is changing
addr_is_reserved behavior.

[1] openwrt#15258
[2] miniupnp/miniupnp#542
[3] miniupnp/miniupnp#511

This reverts commit b76aa99.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
BKPepe added a commit to openwrt/packages that referenced this pull request Jul 20, 2021
This patch is causing several issues [1], which then were reported to
upstream [2] and it was not accepted by upstream [3]. This results that
nobody maintain this custom patch and it is not useful as it is changing
addr_is_reserved behavior.

[1] #15258
[2] miniupnp/miniupnp#542
[3] miniupnp/miniupnp#511

This reverts commit b76aa99.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
(cherry picked from commit 107f337)
nirizr pushed a commit to nirizr/packages that referenced this pull request Jul 20, 2021
This patch is causing several issues [1], which then were reported to
upstream [2] and it was not accepted by upstream [3]. This results that
nobody maintain this custom patch and it is not useful as it is changing
addr_is_reserved behavior.

[1] openwrt#15258
[2] miniupnp/miniupnp#542
[3] miniupnp/miniupnp#511

This reverts commit b76aa99.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
@sky96111
Copy link

sky96111 commented Aug 3, 2021

addr_is_reserved() behavior should not be changed.

@miniupnp Double NAT are quite common in China. Because optical modem provided by ISP are defaulted with router function and can not be disabled by us. Though we can config DMZ or port forwarding to expose the second router to the public net, miniupnpd can only get Intranet IP and return "addr_is_reserved".

BKPepe added a commit to openwrt/packages that referenced this pull request Aug 28, 2021
This patch is causing several issues [1], which then were reported to
upstream [2] and it was not accepted by upstream [3]. This results that
nobody maintain this custom patch and it is not useful as it is changing
addr_is_reserved behavior.

[1] #15258
[2] miniupnp/miniupnp#542
[3] miniupnp/miniupnp#511

This reverts commit b76aa99.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
(cherry picked from commit 107f337)
@choyri
Copy link

choyri commented Sep 8, 2021

Especially for China Mobile, the IP obtained by household PPPoE is all private address. 😞 so sad

@sky96111
Copy link

sky96111 commented Sep 8, 2021

Especially for China Mobile, the IP obtained by household PPPoE is all private address. so sad

In that case, UPnP still cannot work enen if miniUPnP allow this behaviour. Or you will need to ask ISP to forward your port, but actually it is impossible.
This change only breaks double NAT. For those who can only get a private address from ISP... This breaks nothing.

如果你的光猫也只能从运营商得到一个内网IP,即使这个软件不限制,你的UPnP是不成功的。
那个commit对中国用户有影响,但影响的用户是:光猫拨号能获得外网IP,在光猫上通过端口转发或DMZ把二级路由暴露在了公网上,但是二级路由只能获得光猫分配的内网IP导致miniUPnP拒绝了UPnP。
如果打电话给运营商也不提供公网IP,那换联通电信吧。

@miniupnp
Copy link
Owner

miniupnp commented Sep 8, 2021

If you only have a Private address, you have not a routable address so using UPnP IGD is pointless.
I hope you still have a routable IPv6 address.

@pali
Copy link
Contributor

pali commented Sep 16, 2021

Obviously if you have only private IPv4 address from CGNAT then UPnP IGD services for port forwarding (like miniupnpd) will never work. To make it work you have to run miniupnpd on that CGNAT machine.

So if you do not have publicly routable IPv4 address then ask for block of routable IPv6 addresses.

But note that IPv4 multi-NAT setup with miniupnpd in cascade (when on every IPv4 CG/NAT router is running miniunpd) is not supported yet by miniupnpd yet, there is open feature request for it #299

@Neustradamus
Copy link

There is a new patch from @ptpt52:

It replaces the old OpenWrt patch: 301-ext_ip_reserved_ignore.patch.

Tested by @openips!

@openips
Copy link

openips commented Sep 16, 2021

if you use miniupnpd as router with more than one isp like me , you can get private ip and public ip at same time.
so miniupnpd work with the public ip and not work with the private ip is necessary.
the new patch let miniupnpd can work in this situation and tested by me.
great work and thanks a lot

utoni pushed a commit to utoni/openwrt-packages that referenced this pull request Jan 21, 2022
This patch is causing several issues [1], which then were reported to
upstream [2] and it was not accepted by upstream [3]. This results that
nobody maintain this custom patch and it is not useful as it is changing
addr_is_reserved behavior.

[1] openwrt#15258
[2] miniupnp/miniupnp#542
[3] miniupnp/miniupnp#511

This reverts commit b76aa99.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants