By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,724 Members | 863 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,724 IT Pros & Developers. It's quick & easy.

Network IP Address

P: n/a
How do I find out what the network IP address is?

For example if I have a cable modem with 68.57.200.50 as the IP address and the linksys router assigns PC's on the network 192.168.1.1 how do I find out that the address is 68.57.200.50 running my code on the PC with the IP address assigned to it by the router of 192.168.1.1 ?

Make sense what I'm asking? I like using WMI but if there is another way I'm willing to listen.
Nov 15 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Demetri

I don't think it is possible to determine the outbound IP address. What you
could do is call up an external page, such as http://www.whatismyip.com/ and
spider that page's content to determine the IP address your connection
actually went out as. However, if there is a transparent proxy involved (at
your ISP for example), you'll get the IP address of the proxy server, and
not the linksys router.

Another approach is that you could determine your gateway address (not sure
how) and then call up the gateway's webpage. This of course would need to be
able to login to the router's web interface, and also navigate to the
correct page. It would be heavily dependant on the router's manufacturer and
version of the software and not all routers have a web interface.


"Demetri" <an*******@discussions.microsoft.com> wrote in message
news:38**********************************@microsof t.com...
How do I find out what the network IP address is?

For example if I have a cable modem with 68.57.200.50 as the IP address and the linksys router assigns PC's on the network 192.168.1.1 how do I find
out that the address is 68.57.200.50 running my code on the PC with the IP
address assigned to it by the router of 192.168.1.1 ?
Make sense what I'm asking? I like using WMI but if there is another way

I'm willing to listen.
Nov 15 '05 #2

P: n/a
A third possibility (if the router supports so) ould be using UPnP to query
for the outside IP address.

But these three are all methods possible.

--
Regards

Thomas Tomiczek
THONA Software & Consulting Ltd.
(Microsoft MVP C#/.NET)
(CTO PowerNodes Ltd.)
---

Still waiting for ObjectSpaces? Try the EntityBroker today - more versatile,
more powerfull.
And something in use NOW. for the projects you have to deliver - NOW.
"Steve Lutz" <sl***@NOSPAMPLEASEcomcast.net> wrote in message
news:eL**************@TK2MSFTNGP10.phx.gbl...
Demetri

I don't think it is possible to determine the outbound IP address. What you could do is call up an external page, such as http://www.whatismyip.com/ and spider that page's content to determine the IP address your connection
actually went out as. However, if there is a transparent proxy involved (at your ISP for example), you'll get the IP address of the proxy server, and
not the linksys router.

Another approach is that you could determine your gateway address (not sure how) and then call up the gateway's webpage. This of course would need to be able to login to the router's web interface, and also navigate to the
correct page. It would be heavily dependant on the router's manufacturer and version of the software and not all routers have a web interface.


"Demetri" <an*******@discussions.microsoft.com> wrote in message
news:38**********************************@microsof t.com...
How do I find out what the network IP address is?

For example if I have a cable modem with 68.57.200.50 as the IP address and the linksys router assigns PC's on the network 192.168.1.1 how do I

find out that the address is 68.57.200.50 running my code on the PC with the IP
address assigned to it by the router of 192.168.1.1 ?

Make sense what I'm asking? I like using WMI but if there is another way

I'm willing to listen.

Nov 15 '05 #3

P: n/a
How universal is UPnP? I use the following with success to create a
connection and get external address on a system using XP Internet connection
sharing. Does it work with a LinkSys router or other commonly used home
setups?

Add reference to NATUPNPLib.dll

using NATUPNPLib;
IPEndPoint external;
IPEndPoint local;
public void PrepareForNAT( int publicPort )
{
NATUPNPLib.UPnPNATClass nat = new NATUPNPLib.UPnPNATClass();
IStaticPortMappingCollection spmc = nat.StaticPortMappingCollection;

// make sure not there
try
{
spmc.Remove( local.Port, "TCP" );
}
catch( System.IO.FileNotFoundException )
{
// ok
}

IStaticPortMapping spm = spmc.Add( publicPort, "TCP", local.Port,
"MyLocalName", true, "id for display" );

external = new IPEndPoint( IPAddress.Parse( spm.ExternalIPAddress ),
spm.External Port );
}

// worth having a Dispose method to do a spmc.Remove( local.Port, "TCP" ) to
clean up...

You can check the results by right clicking internet connection, choosing
properties, and pressing the settings button. It takes a bit of time to
load.

"Thomas Tomiczek [MVP]" <t.********@thona-consulting.com> wrote in message
news:uv****************@tk2msftngp13.phx.gbl...
A third possibility (if the router supports so) ould be using UPnP to query for the outside IP address.


"Demetri" <an*******@discussions.microsoft.com> wrote in message
news:38**********************************@microsof t.com...
How do I find out what the network IP address is?

For example if I have a cable modem with 68.57.200.50 as the IP
address and the linksys router assigns PC's on the network 192.168.1.1 how do I

find
out that the address is 68.57.200.50 running my code on the PC with the IP address assigned to it by the router of 192.168.1.1 ?

Make sense what I'm asking? I like using WMI but if there is another
way I'm willing to listen.


Nov 15 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.