469,579 Members | 1,161 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,579 developers. It's quick & easy.

Real IP Address Tracker

Howdy,

I want to write an application, with some functionality that will
detect my "Real World" ip address, ie that of my router, as opposed to
the actual IP it is running on which is a 192.168.1.x address.

So the .NET app needs to some how find out what real world IP address
it is running on.
There are web pages (such as www.mywanip.com) that can tell me, and I
suppose I could write my application to connect to that page, and parse
the IP address that it posts on that page. It seems to always be in the
same spot, and always enclosed by Paragraph tags with a css class
reference. That seems pretty unique so I could always find my IP
address posted on that page.

But I am also interested if there is an easier way of doing it. I can't
think of anyway that would not required "hitting" some external
resource... I am guessing that because when my PC sends out a request
(say HTTP for example), the real IP isn't ammended until it reaches my
router. Then my router handles where the returned packets need to go
internally.

Cheers,
Steven

Jun 6 '06 #1
6 3042
Hi,

"Steven Nagy" <le*********@hotmail.com> wrote in message
news:11**********************@y43g2000cwc.googlegr oups.com...
Howdy,

I want to write an application, with some functionality that will
detect my "Real World" ip address, ie that of my router, as opposed to
the actual IP it is running on which is a 192.168.1.x address.
Why you need this?
So the .NET app needs to some how find out what real world IP address
it is running on.
There are web pages (such as www.mywanip.com) that can tell me, and I
suppose I could write my application to connect to that page, and parse
the IP address that it posts on that page. It seems to always be in the
same spot, and always enclosed by Paragraph tags with a css class
reference. That seems pretty unique so I could always find my IP
address posted on that page.
This is the way to go, the only other possibility is to establish your own
"echo" server
But I am also interested if there is an easier way of doing it. I can't
think of anyway that would not required "hitting" some external
resource... I am guessing that because when my PC sends out a request
(say HTTP for example), the real IP isn't ammended until it reaches my
router. Then my router handles where the returned packets need to go
internally.


You have to make an external request. that is the only way
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Jun 6 '06 #2
Steven Nagy wrote:
I want to write an application, with some functionality that will
detect my "Real World" ip address, ie that of my router, as opposed to
the actual IP it is running on which is a 192.168.1.x address.


Steven,

I don't think there is an easy way to get your IP address without
querying an external resource. If you do decide to just use a webpage,
I would recommend www.whatismyip.org - The only content displayed on the
page is the IP address, so it will be extremely easy to parse. ;-)

Hope this helps.

Dan Manges
Jun 6 '06 #3

"Steven Nagy" <le*********@hotmail.com> wrote in message
news:11**********************@y43g2000cwc.googlegr oups.com...
Howdy,

I want to write an application, with some functionality that will
detect my "Real World" ip address, ie that of my router, as opposed to
the actual IP it is running on which is a 192.168.1.x address.

So the .NET app needs to some how find out what real world IP address
it is running on.
There are web pages (such as www.mywanip.com) that can tell me, and I
suppose I could write my application to connect to that page, and parse
the IP address that it posts on that page. It seems to always be in the
same spot, and always enclosed by Paragraph tags with a css class
reference. That seems pretty unique so I could always find my IP
address posted on that page.

But I am also interested if there is an easier way of doing it. I can't
think of anyway that would not required "hitting" some external
resource... I am guessing that because when my PC sends out a request
(say HTTP for example), the real IP isn't ammended until it reaches my
router. Then my router handles where the returned packets need to go
internally.
Unless your router supports UPnP and you're willing to live with the
security holes in the MS UPnP service, an external request is the way to go.
Note that on some systems, your so-called "real" IP is different from
different perspectives. For example, my workstation has one internal IP, a
NAT-ted IP on the Internet, and a different NAT-ted IP when accessing NASA
servers because the office network has a dedicated connection to the NASA
network.

Cheers,
Steven

Jun 6 '06 #4
Steven,

I don't agree with all of the other posts that indicate you need to make
an external connection. Most routers have a web server in it that you can
use to find the current status of the router, and it wouldn't force an
external connection (it would be between you and your router).

I would connect to that page, and scrape the IP address from the page
returned.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Steven Nagy" <le*********@hotmail.com> wrote in message
news:11**********************@y43g2000cwc.googlegr oups.com...
Howdy,

I want to write an application, with some functionality that will
detect my "Real World" ip address, ie that of my router, as opposed to
the actual IP it is running on which is a 192.168.1.x address.

So the .NET app needs to some how find out what real world IP address
it is running on.
There are web pages (such as www.mywanip.com) that can tell me, and I
suppose I could write my application to connect to that page, and parse
the IP address that it posts on that page. It seems to always be in the
same spot, and always enclosed by Paragraph tags with a css class
reference. That seems pretty unique so I could always find my IP
address posted on that page.

But I am also interested if there is an easier way of doing it. I can't
think of anyway that would not required "hitting" some external
resource... I am guessing that because when my PC sends out a request
(say HTTP for example), the real IP isn't ammended until it reaches my
router. Then my router handles where the returned packets need to go
internally.

Cheers,
Steven

Jun 6 '06 #5
Hi All,

Thanks for the responses.

I hadn't thought of the Router's WAN config page. I could use that.
The page is never likely to change while I use that router, but if I
change routers, I need to change the parsing code.

I guess if I want to know my real IP but there is a link downage
between say here (Australia) and the US (as there was a couple days
ago) then I wouldn't be able to access a page such as www.mywanip.com
etc. But my router would still have its real world IP saved.

Thanks again for all the responses. I have a clear direction now.

Cheers,
Steven

Jun 7 '06 #6

Damn. I woulda never thought of that :)

--
Saad Rehmani / Prodika / Dallas / TX / USA
Steven,

I don't agree with all of the other posts that indicate you need
to make an external connection. Most routers have a web server in it
that you can use to find the current status of the router, and it
wouldn't force an external connection (it would be between you and
your router).

I would connect to that page, and scrape the IP address from the
page returned.

"Steven Nagy" <le*********@hotmail.com> wrote in message
news:11**********************@y43g2000cwc.googlegr oups.com...
Howdy,

I want to write an application, with some functionality that will
detect my "Real World" ip address, ie that of my router, as opposed
to the actual IP it is running on which is a 192.168.1.x address.

So the .NET app needs to some how find out what real world IP address
it is running on.
There are web pages (such as www.mywanip.com) that can tell me, and I
suppose I could write my application to connect to that page, and
parse
the IP address that it posts on that page. It seems to always be in
the
same spot, and always enclosed by Paragraph tags with a css class
reference. That seems pretty unique so I could always find my IP
address posted on that page.
But I am also interested if there is an easier way of doing it. I
can't think of anyway that would not required "hitting" some external
resource... I am guessing that because when my PC sends out a request
(say HTTP for example), the real IP isn't ammended until it reaches
my router. Then my router handles where the returned packets need to
go internally.

Cheers,
Steven

Jun 7 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Jerrykhan | last post: by
1 post views Thread by jcharth | last post: by
reply views Thread by Stephen Walther | last post: by
158 posts views Thread by Giovanni Bajo | last post: by
reply views Thread by Brett Cannon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.