Real IP Address Tracker

  • Thread starter Thread starter Steven Nagy
  • Start date Start date
S

Steven Nagy

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
 
Hi,

Steven Nagy said:
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
 
Steven said:
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
 
Steven Nagy said:
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.
 
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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top