Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to get the cable modems DHCP IP address  RSS feed

 
Alan Shiers
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

I have a method that obtains the users local IP address. See code below. Which is fine. But more importantly, if the users computer is behind a cable modem and router, I want to be able to get the IP address that has been assigned to the modem by the service provider (AT&T, or whoever). I know that if an IP address starts with 192.168.#.#, that its really just the address assigned by the router to one of the computers inside the network. That's not what I'm really after. Does someone know how to correctly identify and obtain the DHCP IP address that was assigned to the modem?

Alan

 
Paul Clapham
Sheriff
Posts: 22472
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I usually use one of the web sites like this one: http://whatismyipaddress.com/.
 
Winston Gutkowski
Bartender
Posts: 10573
65
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alan Shiers wrote:I know that if an IP address starts with 192.168.#.#, that its really just the address assigned by the router...

There are others too. Google "RFC 1918".

That's not what I'm really after. Does someone know how to correctly identify and obtain the DHCP IP address that was assigned to the modem?

I guess the first question would be: Why? In general, you don't need to know, so if it's for something nefarious, don't expect any help here. If it's for some sort of geographical pinpointing, there are already services for that, and companies that have forgotten more than you or I will ever know about that sort of stuff.

Winston
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!