|
-
November 7th, 2002, 01:03 PM
#1
Need home router's external dynamic IP address. How get it?
Anyone know how to query (via a C or MFC program) a home router's status to get its external publically viewable IP addresses (that the ISP assigned to it dynamically) or can it be done by somehow pinging a remote server and sending back the real ip addresses assigned to the router. thanks.
-
November 7th, 2002, 01:21 PM
#2
I am not an expert but this is better than nothing i think:
1. You can use the tracert.exe command, parse its output to extract the primary gateway address (router IP).
2. You may use the recently posted article about a custom "trace route" program, which also has the ability to extract the gateway IP.
3. You need to get familiar with the DHCP protocol - this is what router client (OS) uses to communicate with DHCP enabled router. DHCP protocl impl. shoudl be available on the Internet.
4. You may use a workaround, which involves parsing the HTTP_REFERER HTTP variable returned from a webserver. This will involve asking internet explorer to connect to 127.0.0.1:80 (or other for that matter) and retrieve and save the variable which contains the IP address of the client requesting the HTTP resource.
In my opinion, the #3 is the best solution.
-
November 7th, 2002, 01:35 PM
#3
Re: router's ip address
Thanks AMn
But I know the dhcp protocol very well. It does not publish the external router's ip address to the client.
-
November 7th, 2002, 01:38 PM
#4
Re: router's ip address
can you give me a link to the trace route program you mentioned? tks
-
November 7th, 2002, 05:14 PM
#5
sure =)
here it is :
http://www.codeguru.com/network/tracert.html
Regarding the DHCP - like i said i am not expert at this but i know this: router reports its address to the nodes it comunicates with, and if you are one of them then you know it too BEsides, why shouldnt it report the address to you ?
-
November 7th, 2002, 05:21 PM
#6
router
Amn
The router reports its INTERNAL ip address to the internal clients (not its external ip address which is what I want).
tks
-
November 8th, 2002, 11:08 AM
#7
pschiff,
Many routers use a web interface and/or telnet for administration of the router. You can usually read the external IP address from there.
Other than that, you'll need to use an internet resource to read your external IP address such as http://whatismyip.com/ .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|