alanmcgovern / Mono.Nat

UPNP and NAT-PMP port forwarding for .NET
https://github.com/mono/Mono.Nat
MIT License
160 stars 156 forks source link

Port mapping not working until router reload #37

Open 14ttran opened 1 year ago

14ttran commented 1 year ago

After creating a port mapping just like this:

device.CreatePortMap(new Mapping(Protocol.Ucp, Port, Port));

and verifying it's in the devices map with:

foreach (Mapping portMap in device.GetAllMappings())
{
     Console.WriteLine(portMap.ToString());
}

My port listener won't pick up any incoming messages from a client I have connected to the public IP of my router and the same port until I go into my router network manager and reload the firewall settings.

Same thing if the maps are deleted, it won't take effect until the router settings are reloaded.

I have an ARRIS TG1682G gateway with Xfinity (Comcast) ISP.

afaik there's no real way to programmatically solve this but I thought I'd at least put this out there for others to know