473,324 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Network IP Address

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
3 7547
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Alphamacaroon | last post by:
All, I'm wondering if anyone can help me with a strange problem I'm having. First off, here's what I'm trying to do: I'm developing a UDP network application that should allow the end user to...
1
by: david.kao | last post by:
Hi All: Yesterday, we released our first .NET window based program on company’s network. In order to make our .NET program run correctly from a shared network driver, we also installed a...
8
by: rongchaua | last post by:
Hi all, i would like now to disable and enable network adapter programmatically with c#. I have searched but found nothing useful. There's no topic about this problem. Has someone done with this...
0
by: Kyle Freeman | last post by:
Ive been experimenting with ways to discover computers on the network. Most of what I have tried is centered around looping through our network address ranges to discover the names of the...
11
by: weird0 | last post by:
I am a beginner to socket programming to in c#. I know the concepts as to how to program them. I get the above exception when i tried writing the code for the server side on the line...
2
by: martin lanny | last post by:
Simple network scanner is a part of my dotnet solution. It pings ip addresses in a selected network range and gives me the response time for each computer it finds. Anyhow, I would need to...
6
by: Tony | last post by:
Hello! This is the scenarion that we want to implement. We have a computer called A which register itself on a superviser server about it's existence so other computer can get the...
6
by: BA | last post by:
Hi Everyone, I have an application that sits behind a server farm, the application needs to pass its NLB IP address in the message that it sends to another service. From C# code, how can I...
0
by: nancylife | last post by:
When developing web report, many developers use VMware to simulate different operating systems on a same server. Then, they can realize cross-platform deployment and debug of web report. According to...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.