Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Is local IP Addresses viewable to remote IP Address?

0 views
Skip to first unread message

Agendum

unread,
Jun 4, 2008, 9:59:02 PM6/4/08
to
I have an issue where I have a remote IP Address, and I need to discover the
local network interface IP Address which is viewable to the remote IP Address
(for UPnP document purposes). For example, if I have the remote IP Address
10.0.0.4, and I know all of the local IP Addresses:

127.0.0.1
10.0.0.5
10.1.0.20
192.168.0.5
157.54.185.126

How can I determine which of these IP addresses, without connecting to the
remote machine, that if broadcast over that network interface, the remote
device could see the broadcast and also connect to the local machine at that
IP address. I was looking at some properties in the NetworkInterface class
and stuff, but nothing was obvious to me. I hope I am explaining the problem
well enough.

Thanks

Peter Duniho

unread,
Jun 4, 2008, 10:43:23 PM6/4/08
to
On Wed, 04 Jun 2008 18:59:02 -0700, Agendum
<Age...@discussions.microsoft.com> wrote:

> [...]


> How can I determine which of these IP addresses, without connecting to
> the
> remote machine, that if broadcast over that network interface, the remote
> device could see the broadcast and also connect to the local machine at
> that
> IP address.

Well, given your remote IP address, you should be able to apply your local
subnet mask to the remote address and each of your local addresses, and if
they result is equal then those addresses are on the same subnet.

But, you really shouldn't need to do this. Just broadcast to
IPAddress.Any, and assuming the remote machine is reachable, it will
receive the broadcast and can use the origin IP address to determine how
to connect back. There should be no reason for your local process to know
or care what the configured IP address is.

Pete

0 new messages