473,811 Members | 2,971 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

UPnP NAT Traversal

I'm writing a VB app in Visual Studio 2005 where I'd like to automatically
setup inbound port mappings for the user on their home router. I've been
playing with trying to use the NATUPnP 1.0 Type Library (hnetcfg.dll) and
have had no luck. From what I've read the library is friendly enough that
it should be as simple as adding the reference to the NATUPnP 1.0 Type
Library and doing some pretty mindless code (for example):

Private Function GetPortMappingC ount() as Integer
Dim Router as New UPnPNAT()

' Obviously in real life, I'd do some error checking here :)

Return Router.StaticPo rtMappingCollec tion.Count
End Function

However, the StaticPortMappi ngCollection (as well as the NATEventManager )
ends up as Nothing and so throws an exception.

Anyone who is even vaguely familiar with this stuff? I've seen sample code
in C# that I've compiled with similar results. I know I have a UPnP
capable router. A packet sniff shows that the router isn't being queried
at all, so I'm obviously doing something wrong here and hopefully it's just
a simple oversight!
Sep 2 '06 #1
1 3342
I'm obviously doing something wrong here and
hopefully it's just a simple oversight!
Doh! My Windows based firewall was blocking UDP port 1900 traffic from my
router. Now that the traffic is allowed, the NAT traversal is working
fine. And it really _is_ easy!
Sep 2 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1704
by: Ben Last | last post by:
I've been messing around with my Netgear MP101 and alternate servers. I like the MP101, but the server that comes with it leaves a lot to be desired (like you need to have it running on a logged-in Windows machine. Gag me with a spoon). So my thought naturally turned to whether it's feasible to write a replacement in Python. After all, UPnP is really just XML via HTTP over UDP... Half-an-hour's Googling later, it looks like it's a...
0
1686
by: Geoff Aukett | last post by:
Hello, Does anyone know of any .NET code to deal Upnp. I would like to create a windows service that will communicate with a wireless Upnp device. I have been to the Upnp forum but its all very low level I was looking for a starter for 10! Any help appreciated Geoff.
0
1719
by: bsimaie | last post by:
Hello, could somebody help me to convert the below UPnP service filr to WSDL web servive file: <serviceList> <service> <serviceType> urn:schemas-upnp-org:service:PowerSwitch:1 </serviceType> <serviceId> urn:upnp-org:service:PowerSwitch:1 </serviceId>
1
3568
by: Robert S | last post by:
Hello, could somebody help me to convert the below UPnP service file to WSDL web service file: <serviceList> <service> <serviceType> urn:schemas-upnp-org:service:PowerSwitch:1 </serviceType> <serviceId> urn:upnp-org:service:PowerSwitch:1
0
1731
by: Robert S | last post by:
Hello group, I tried to combine UPnP servive and blenderpowerSCPD.xml and come up with WSDL web service file as below: UPnP services: <serviceList>
0
27059
by: nezoat | last post by:
Here is some working code to open the specified TCP port on the gateway nat device or firewall, and forward it to the calling machine. Great for p2p apps. The newsgroups are such a great resource and have helped me so much, I hope this helps others. Let me know if you find it useful! Lee Carlson Lee (at) Carlson (dot) net -----------------------------------
6
4068
by: GrispernMix | last post by:
//ques and and level order traversal file name: lab6_build_leaf_up.cpp Instructions:
1
20454
by: xlar54 | last post by:
Ive searched around and Im hazy on what is needed to develop media server code. Is there a UPnP library for C#? Linux apparently has many, and I even found a Java one, but can't locate anything yet for dotNET.
2
2983
by: Svinja | last post by:
Hello, I am using UPnP in c# to communicate with my router. So far i have managed to do this: 1. Get router info(xml) 2. Get external(public) IP address 3. Add and delete port mapping Is there any way to see which ports are forwarded? I think it is possible with eventing but my router doesnt support it. I tried with queryStateVariable action but with no success. I am not using NAT traversal.
0
9728
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10648
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10402
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7670
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5554
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5692
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3867
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3018
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.