Reputation: 149
I'm not good in networking so for some people my question can look silly. I'm trying to connect to my ip camera from outside of my local network. I know that I need to do port forwarding. I read that ssh could be good idea. Imagine that my outside ip is 10.20.30.40 and my camera ip local ip is 1.2.3.4. When port forwarding will work I think that I will connect to camera using this address "http://10.20.30.40/index1.htm". So all I need is port forwarding. Client can't do this on his own. I need to write an app to do this automatically. How can I do this using c# and am I going in right direction?
Upvotes: 0
Views: 855
Reputation: 149
Ok, problem solved, when I turn upnp on my router on web pages didnt load. It turns out that camera had default port set to 80. I've changed it to 1001 and then set upnp enable on router and camera automatically forwarded port 1001 to it self. All I have to do programaticaly is set port on camera.
Upvotes: 0
Reputation: 9660
You can accomplish this on most home routers in their default configuration using UPnP - Universal Plug and Play.
This is a standardised mechanism for applications behind a NAT router to programmatically request ports to be forwarded to them.
See this question for details on accessing UPnP functionality from .NET. You need to persuade the router to forward TCP port 80 (standard port for HTTP) to your camera's LAN IP address.
Upvotes: 3
Reputation: 23300
Only way you can accomplish correctly configured port forwarding is through manual router configuration.
There is no way around it, for logical and obvious security reasons.
Upvotes: 0