Solved

Retrieve Wan Address

Posted on 2004-11-02
456 Views
Last Modified: 2008-01-16
Hello,
On my home computer I have an ADSL connection behind a router to go on the internet. On each systemstart I become a dynamic IP address from my ISP.  Since I often have to make connection from the office to my home computer, I always have to ring home ans ask to verify the Wan Ip.
So, it it possible to retrieve the Wan IP address and store it into a file.
If thats possible, i can (at system start), retrieve the address and send the file automatically to the ftp server on the office.
I'll already have a batch routine to send the file.
What I need now is a batch routine to retrieve the Wan IP address and to store that information in a file.
Could someone help me?
Thanks
Frank
0
Question by:fvg
    15 Comments
     
    LVL 57

    Expert Comment

    by:PeteLong
    0
     
    LVL 57

    Expert Comment

    by:PeteLong
    ah you want to script it sorry there is a utility you can use called "CmdNET" to discover your public ip the syntax is CmdNET /p

    (how to script it) Your Home IP Address
    http://avwebserver.mit.edu/avdb/how_to_find_ip.htm

    download
    ---------------------------------------------------------------
    CmdNET is a command line tool capable of retrieving information about your currently assigned local and public/WAN IP address. Furthermore it can display your NICs MAC address. Errorlevel and redirection of output to file is also supported.
    http://www.software4win.com/php/browse.php?Submit=Select&Category=80&Page=1
    -----------------------------------------------------------------
    or here is a VB solution http://cwashington.netreach.net/depo/view.asp?Index=526&XcriptType=vbXcript

    0
     
    LVL 49

    Expert Comment

    by:sunray_2003
    Check this out .
    http://www.experts-exchange.com/Operating_Systems/MSDOS/Q_20743821.html#9399250

    I am not well versed in batch files but I guess you can understand and implement the same.
    you should be able to use that and get the IP address to a text file on your machine and then whatever method you use , you should be get that to your office and then dial in

    post back if you need more assistance

    SR
    0
     
    LVL 57

    Expert Comment

    by:PeteLong
    afternoon Ash :0)

    that will only return the local IP address mate, the poster need his WAN address :)
    0
     
    LVL 49

    Expert Comment

    by:sunray_2003
    Good Morning ,Pete..

    I thought so. I forgot the point that he is behind router. if he is not then he should be able to use ipconfig /all and get the IP..

    0
     
    LVL 57

    Expert Comment

    by:PeteLong
    sunray_2003,
    :)
    Pete
    0
     
    LVL 49

    Expert Comment

    by:sunray_2003
    Pete,

    I am stepping into the less experienced TA when the big cats are around..LOL !!

    I am thinking about this idea

    a) I am behind a router. Is there a command that can give me my WAN IP.. If I am not behind a router , i can give ipconfig /all and get it but why cant I get when I behind a router..

    b) Technically , why wouldn't be possible to telnet to my router (telnet 192.168.0.1) and then get the WAN IP..
    0
     
    LVL 32

    Accepted Solution

    by:
    Hi fvg,

    Maybe a simple idea... why not using a Dynamic DNS like http://www.dyndns.org/services/dyndns/
    It's free, very easy to manage and you'll never have to remember your IP address, all you need is your hostname.

    Greetings,

    LucF
    0
     
    LVL 1

    Expert Comment

    by:UNS-Tech
    hi

    remember though, that sometimes ( and periodically ) your ISP changes your IP, unless you request a 'sticky' or a true fixed

    hope this helps


    0
     
    LVL 6

    Expert Comment

    by:kapes
    tell me what commands you run on your machine to find out your WAN IP?

    if feasible, I will help you write a batch file for that !!
    0
     
    LVL 4

    Expert Comment

    by:thribhu
    u can run a bach file with text saying "ipconfig /all"  at command prompt.

    but u have to think of saving this into a file....

    Or better, give your system MAC adress to the ISP to bing it to a reserved Public  IP adress if possible......
    0
     
    LVL 1

    Expert Comment

    by:UNS-Tech
    isn't a reserved public the same as 'sticky'

    ;o)


    0
     

    Author Comment

    by:fvg
    Thanks everyone for their answers.
    First of all the CMDnet comment (PeteLong) is the one I have always used before. But since i'm behind a router it gives no return as public address.
    Thanks to LucF for his idee concerning the dynamic dns servers.
    It was the first time I've heared from it.
    So I done some search and found a small service thats runs quite well under WinXP.
    This service called DNSer V1.3.2 is freeware.
    On a user intervalvalue it check's the current Wan IP eigther from an Internet server or directly from your Router.
    When the address is changed it sends the new IP to a dynamic Dns server.
    I had problems doing it with dyndns.org but it works very good with no-ip.com.
    So my problem is solved.
    Since LucF gives me the original idee I want to give my points to him.
    Thanks
    Frank

    0
     
    LVL 32

    Expert Comment

    by:Luc Franken
    Glad to help :)

    LucF
    0
     
    LVL 57

    Expert Comment

    by:PeteLong
    Glad you are fixed Frank

    take a look at no-ip.com I use them for my website www.petenetlive.com they are very good :)
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Suggested Solutions

    I wrote this article to explain some important DNS concepts that should be known to avoid some typical configuration errors I often see in forums. I assume that what is described here is the typical behavior of Microsoft DNS client. I don't know …
    There have been a lot of times when we have seen the need to enter a large number of DNS entries in a forward lookup zone. The standard procedure would be to launch the DNS Manager console, create the Zone and start adding new hosts using the New…
    Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
    After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

    856 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now