Professional Web Applications Themes

find outside ipadress of router with perl - PERL Beginners

Dear All, is it possible in Perl to find the outside ip-address from an adsl-router without using an outside box. i need to restart a script when the outside address of the router changes Greetings thx in advance --------------------------------- Do you Yahoo!? SBC Yahoo! - Internet access at a great low price....

  1. #1

    Default find outside ipadress of router with perl

    Dear All,

    is it possible in Perl to find the outside ip-address from an adsl-router
    without using an outside box.

    i need to restart a script when the outside address of the router changes


    Greetings

    thx in advance


    ---------------------------------
    Do you Yahoo!?
    SBC Yahoo! - Internet access at a great low price.
    Bert Guest

  2. #2

    Default Re: find outside ipadress of router with perl

    bert huygens wrote: 

    Yeah, use LWP to goto 'http://privacy.net/' and run the following regex against
    the results:

    /Your IP address is (\d+\.\d+\.\d+\.\d+)<br>/

    The router's outside IP should be in $1.

    --
    Andrew Gaffney
    Network Administrator
    Skyline Aeronautics, LLC.
    636-357-1548

    Andrew Guest

  3. #3

    Default Re: find outside ipadress of router with perl



    Not sure what you mean by "using an outside box"? Do you mean beyond the
    router? or off the local machine? Don't think there is a way to do this
    from the local machine only, since that would defeat the purpose of the
    router. If you mean getting the info from the router you might want to
    look at "ddclient", you can find its homepage on freshmeat or probably
    with a google search.

    http://danconia.org
    Wiggins Guest

  4. #4

    Default Re: find outside ipadress of router with perl

    bert huygens <com> writes:
     

    Don't think you can get it without hitting a remote machine. Unless
    the router itself can be queriedd for it.

    You could put the small cgi script on a web server somewhere and hit
    it with:

    lynx -dump http://remote.server.com/remadd.cgi

    cat remadd.cgi

    #!/usr/bin/perl
    print "Content-type: text/html\n\n";
    print "REMOTE_ADDR = $ENV{'REMOTE_ADDR'}";

    print <<EOM;

    </BODY></HTML>
    EOM

    lynx -dump http://remote.server.com/remadd.cgi
    should return something like:

    REMOTE_ADDR = 69.44.143.256

    Harry Guest

Similar Threads

  1. Question find and replacing the xml tags, using perl script.
    By Unregistered in forum Brainstorming Area
    Replies: 0
    Last Post: February 18th, 09:14 AM
  2. Collect IPadress on register??
    By btn in forum Dreamweaver AppDev
    Replies: 2
    Last Post: May 5th, 02:44 PM
  3. Perl unable to find modules
    By babumovva@hotmail.com in forum PERL Modules
    Replies: 1
    Last Post: August 12th, 07:42 PM
  4. perl Makefile.PL can't find pod2man
    By M_F_H in forum PERL Modules
    Replies: 2
    Last Post: August 2nd, 09:17 PM
  5. where to find perl pm
    By jjliu in forum PERL Modules
    Replies: 2
    Last Post: October 10th, 05:39 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139