简体   繁体   中英

c# WCF UPNP mapping router configuration

I have written ac# code to do a port mapping by Upnp to my router in order to make acessible a WCF service to the internet

the upnp script is here

                        object[] loObj = new object[] { "", port, "TCP", port, adresse_ip, true, "Custom Mapping", 0 };
                    lsService.InvokeAction("AddPortMapping", loObj);

the in-port is 87 and the out-port is 87 too

the mapping is sucessfully registred on my Netgear DGN1000 ( i can see it in the upnp table )

Actif   Protocole   Port Interne    Port Externe    Adresse IP
YES     TCP       87                  87              192.168.0.12

I can access to my webservice via localhst:87/servicemodelsamples/service and via 192.168.0.12:87/servicemodelsamples/service

but y can't acess via MY_PUBLIC_IP:87/servicemodelsamples/service .

i have disactivated Windows 8 firewall

when i am using a manual rule that i have created in my router i works , but via upnp nerver

thank you for your help

Note that a portmapping doesn't mean that inbound traffic on that port is allowed too.

Port 87 is below 1000. Some (older) routers block inbound traffic to ports < 1000 by default regardless of undp

Check the rules on the router to allow inbound traffic (udp/tcp) on port 87

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM