PurpleI2P / i2pd

🛡 I2P: End-to-End encrypted and anonymous Internet
https://i2pd.website
BSD 3-Clause "New" or "Revised" License
3.22k stars 415 forks source link

Upnp is not working in windows and Android i2pd. #1900

Closed Sdash24 closed 1 year ago

Sdash24 commented 1 year ago

I've used i2pd in both windows and Android (prebuilt binary). In both cases I got this error: UPnP: Unable to find valid Internet Gateway Device: error 2. The Upnp feature is turned on in my home router because my torrent client can utilize it without any problem.The network status is always Firewalled. That's why I can't make my i2pd router floodfill although I've some spare bandwidth.

Vort commented 1 year ago

It is possible to try using IGD despite error 2. I made such changes in my fork, binaries will be available for download here in ~15 minutes.

r4sas commented 1 year ago

@Vort this is bad idea...

Vort commented 1 year ago

this is bad idea...

At least it is possible in such way to get further information about the problem. What are the alternatives? Try to build debug version of miniupnp? Collect Wireshark dumps of interactions both from i2pd and libtorrent/qBittorrent?

r4sas commented 1 year ago

Only way to fix this - change router with something that uses correct IGD specification order real (white) IP address.

https://github.com/miniupnp/miniupnp/blob/e439318cf782e30066d430f27a1365e013a5ab94/miniupnpc/src/miniupnpc.c#L537-L538

There is no reason in forwarding ports if router has grey IP address on WAN interface.

Vort commented 1 year ago

The question is why qBittorrent do not complain about it.

<Sdash> the thing is my qbittorrent client can successfully map port but i2pd can't

r4sas commented 1 year ago

The answer is: Since miniupnpc believes that if there is no real IP-address in the WAN interface, it returns code 2, which means that “IGD is found, but there is no connection to the Internet or no real IP”. In our current code, this result leads with the cessation of an attempt to make a port mapping.

Vort commented 1 year ago

<Sdash> the build can successfully map port <Sdash> but the network status is still firewalled :( <Sdash> btw it's an application in java named port mapper

PortMapper application also can show External address. https://www.raymond.cc/wp-content/uploads/2014/08/portmapper.png What it shows for you? Your actual external IP or something like 0.0.0.0, 192.168.*, 10.0.* ?

Sdash24 commented 1 year ago
the build can successfully map port but the network status is still firewalled :( btw it's an application in java named port mapper

PortMapper application also can show External address. https://www.raymond.cc/wp-content/uploads/2014/08/portmapper.png What it shows for you? Your actual external IP or something like 0.0.0.0, 192.168., 10.0. ?

It shows 10.101.1.67 in external address.

r4sas commented 1 year ago

It shows 10.101.1.67 in external address.

Q.E.D., that's why UPnP returns error 2.

Sdash24 commented 1 year ago

It shows 10.101.1.67 in external address.

Q.E.D., that's why UPnP returns error 2.

so is it fixable or not?

Vort commented 1 year ago

It is, most likely, fixable only by asking ISP for public IP address or by changing ISP.