# Get modem IP through cmd behind router?



## Doomsday123 (Jul 1, 2002)

Is there any command that will get me the modem IP when I am behind a router? When i use IPconfig it just gives me my local ip on the network. Any help would be appreciated. Thanks.


----------



## StumpedTechy (Jul 7, 2004)

Theres a few ways you can get it. Go to http://www.whatsmyip.org/ or you can connect into the router and look at its WAn configuration and it should give you the IP there.


----------



## Doomsday123 (Jul 1, 2002)

Yeah i know these two methods but I am trying to get it throught the command prompt. The reason being is because I want to write the output to a file and then send it to my email at work so I always know my home IP address to remote desktop if it ever changes during the work day.


----------



## brendandonhu (Jul 8, 2002)

I don't know of anything that will run from the command-line, but your routers status page should tell you the IP.


----------



## Doomsday123 (Jul 1, 2002)

All i need is an automatic utility that will write my ip to a text file so I can send the text file to my email. Any ideas?


----------



## StumpedTechy (Jul 7, 2004)

see this link....

http://forums.techguy.org/networking/433351-connecting-server-net-residential-dsl.html

Much easier to get a DNS Service and not have to worry about your IP.


----------



## StumpedTechy (Jul 7, 2004)

if your into perl you can do this I guess -

http://cwashington.netreach.net/depo/view.asp?Index=716&ScriptType=perl


----------



## Doomsday123 (Jul 1, 2002)

Thanks. I decided to go with the DynDNS. I put the updater on my computer and created a domain with them. Now all I am going to do is take my current domain and get godaddy(my domain manager) and just forward it to the free domain i got through DynDNS so now i dont have to worry about typing in that weird domain name. Thanks!


----------



## TerryNet (Mar 23, 2005)

Sorry I didn't see your thread earlier.

ping -r 1 any_valid_internet_name_or_IP_address

After each reply will be a line:
Route: your WAN IP (or, as you called it, your modem IP)


----------



## brendandonhu (Jul 8, 2002)

This will not necessarily give your external IP, it may return one of your ISP's servers instead. You'll have to see if it works for your connection.


----------



## TerryNet (Mar 23, 2005)

brendandonhu, does it depend on whether the computer has DNS = real DNS or router's IP? If so, then using internet IP instead of internet name should work?


----------



## brendandonhu (Jul 8, 2002)

I tried it both ways, neither work for my connection (Comcast behind a router.)


----------



## TerryNet (Mar 23, 2005)

"The reason being is because I want to write the output to a file and then send it to my email at work so I always know my home IP address to remote desktop if it ever changes during the work day."

Addressing the above desire, just use the full email header. I tested this using yahoo.com, hotmail.com and Netscape Communicator as my mail client for my ISP email and for netscape.net. In all cases my actual IP was included. For example, the following is an edited line from mail sent from netscape.net, using Netscape Communicator to send and receive (192.168.2.2 is my LAN address):

Received: from [192.168.2.2] (MY.IP.IS.HERE.client.MYISP.com [MY.IP.IS.HERE]) by air-in04.mx.aol.com (v108_r1_b1.2) with ESMTP id MAILININ44-589b43c6e93722c; Thu, 12 Jan 2006 18:41:44 -0500


----------



## JohnWill (Oct 19, 2002)

Doesn't work for me either.


----------



## StumpedTechy (Jul 7, 2004)

Didn't work for me either.... sheesh I thought I learned a new trick


----------



## TerryNet (Mar 23, 2005)

OK already! 

For me it works great for ping -r 1 www.yahoo.com

For www.google.com I get just the responses, no Route at all.

So, I guess some sites don't include the route in their ping reply, and some (maybe most) ISPs strip the originating IP from the pings.

How about your emails--is your IP included in the headers?


----------



## brendandonhu (Jul 8, 2002)

I believe mine does include it in the headers, but not all mail servers do.


----------



## JohnWill (Oct 19, 2002)

No joy here.

C:\>ping -r 1 www.yahoo.com

Pinging www.yahoo.akadns.net [216.109.117.207] with 32 bytes of data:

Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 216.109.117.207:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

C:\>

However, a standard ping of the same site works just fine.

C:\>ping www.yahoo.com

Pinging www.yahoo.akadns.net [216.109.117.110] with 32 bytes of data:

Reply from 216.109.117.110: bytes=32 time=20ms TTL=47
Reply from 216.109.117.110: bytes=32 time=22ms TTL=47
Reply from 216.109.117.110: bytes=32 time=35ms TTL=47
Reply from 216.109.117.110: bytes=32 time=20ms TTL=47

Ping statistics for 216.109.117.110:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 20ms, Maximum = 35ms, Average = 24ms

C:\>


----------

