offbynull / portmapper

Java library that maps ports on NAT-enabled routers (supported protocols: UPnP-IGD/NAT-PMP/PCP).
Apache License 2.0
88 stars 17 forks source link

Not finding any PortMappers #35

Open minecreatr opened 7 years ago

minecreatr commented 7 years ago

Hello. I was trying to use this library to setup some port forwarding, but I found out that that PortMapperFactory.discover is not returning any PortMappers. I dont know if that is just something about the network I am on, or a problem with the library, but I wanted to ask just in case.

Here is the log https://gist.github.com/minecreatr/def8b7c6362a4d12740521805acc2371 .

My code is the same as your example, as I just wanted to check if it was working first.

Thank you`

offbynull commented 7 years ago

I'm at work but I can take a look when I get home in a few hours. Can you set logging level to debug and post the full logs? It'll show network traffic.

That error is superfluous. It's just the library trying to run some Linux commands. Since you're not running Linux, you're seeing errors for those Linux commands. The equivalent Windows commands are being run as well and succeeding, so you aren't seeing errors for those.

adam-law commented 7 years ago

Hi again,

I understand that you closed my previous ticket, and I'm sorry for being late on this. Since this issue is the same as mine, I'll post my logs here: https://gist.github.com/adam-law/f219ddecf7ca9ffc749463a219d98fb9

I had time to trace through the source, and as far as I can tell, while the correct service descriptor for the router was collected, the accompanying collection of identified services, was empty. While running through its processes, PortMapper was able to open a (random?) port on the router, though no mapper was added to the identification list.

As for your question about the jar drop-in, I got it through maven, & I believe all the dependencies exist within our project already.

Thanks :)

Edit: On 2nd thought, I'm not sure if PM got the correct descriptor, after all. Looking at the log, I see it identify the Roku device, which is being used as a booster in another part of this building. I'm hooked up by ethernet to a Netgear router, so I'm wondering why I'm not seeing it on the logs.

offbynull commented 7 years ago

What's the name of the network interface the Netgear router is attached to. What's the IP of that network interface?

adam-law commented 7 years ago

Just the default. From ipconfig: Ethernet Ethernet Adapter 192.168.0.5

InzeNL commented 2 years ago

@offbynull I am experiencing this same issue. UPnP is definitely available (I tested with weupnp), so it find at least one mapper

offbynull commented 2 years ago

Hey, I don't have the capacity to keep up with this project anymore. There are too many routers out there / too many configurations to keep up with.

Your best bet is to migrate to miniupnpc. It's a native library but you can make Java bindings to it (if some don't exist already).

On Wed, 17 Nov 2021 at 05:54, Inze Bielderman @.***> wrote:

@offbynull https://github.com/offbynull I am experiencing this same issue. UPnP is definitely available (I tested with weupnp), so it find at least one mapper

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/offbynull/portmapper/issues/35#issuecomment-971460755, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQPQIXTSG4LFG643LH4I7DUMOCVHANCNFSM4DNQUHDA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.