473,394 Members | 1,817 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,394 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 7554
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.