Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

A router exposes itself to outside by IP like and many hosts can connect to it to form a Local Area Network.

My question :

Is there a way to identify a specific host in that LAN?

All I tried is some guessing work which fails with no doubt:

ping host_lan_ip@
Ping request could not find host host_lan_ip@ Please check the name and try again.

I think since each host in LAN can get their packets from outside the router,there MUST be a way to identify each host,but what's that?

UPDATE How to achieve Port forwarding except configuring it in the router?


Now I think UPnP is the way to go,but is there a working sample for this?

share|improve this question

migrated from Oct 13 '10 at 6:11

This question came from our site for professional and enthusiast programmers.

I don't think your ping command (Windows) is valid: host_lan_ip@ – eee Oct 11 '10 at 6:49
Yeah, but so far no working demo yet. – justnobody Oct 11 '10 at 6:55

You cannot initiate a connection into a router. The internal host must begin by forwarding a port to itself, and then listening on that port.

UPnP is the way to go for setting up the port forwards. Then you have to address the problem of which port, if you want to talk to several clients behind the same NAT they can't all use the same port so you need some way to know which client is using which port. A central server which the clients can list themselves on is usually the way to do this (like games servers being listed in a lobby, the master server keeps track of IP/port so everyone else can connect)

A quick google search turned up a C++ UPnP library which might be worth giving a go:

and the windows UPnP API:

share|improve this answer
Is there a working sample of UPnP available? – justnobody Oct 12 '10 at 2:51
I had a look for one. I found a couple of ok looking ones, proper googling might find some better ones. See my answer for the links. – Martin Oct 12 '10 at 10:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.