Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Dynamic IP

  1. #11
    Senior Member comtux's Avatar
    Join Date
    Sep 2004
    Location
    Wilkes Barre Pa
    Posts
    342

    Dynamic IP

    On my router the ip is 192.168.0.1
    and let say my 1st computers ip is 192.168.0.100
    and the on after that is 192.168.0.102 ect.
    Plus you could use http://www.no-ip.com/ with there linux ip/dns update tools.
    found here http://www.no-ip.com/downloads.php?page=linux
    that will update your routers ip on to there servers to keep everything in sync.

    This is the setup i used untill i got a
    T1 and a static ip
    Wenn Sie Spaß meines Englisch mich Willensfuckingtötung Sie bilden.

  2. #12
    Mentor jro's Avatar
    Join Date
    May 2004
    Location
    Pennsylvania, USA
    Posts
    1,206
    Ahh yes, that paramount goal of every geek. Their very own T1 with a static IP. Nirvana, really.

    Until then I still have to put up with a cable modem. So as promised here is my Perl code that updates ZoneEdit with my current IP.

    Code:
    #!/usr/bin/perl
    
    use LWP::UserAgent;
    use LWP::Simple;
    
    #### README: change these to match the zones you want
    
    $zones     = ''; #comma delimited list of zones
    $pass      = '';
    $login     = '';
    
    #### README: (optional) change these to a directory where you want them to be... ie: /var/log or c:/temp
    $logfile   = 'ze-ip.log';
    $ipfile    = 'ze-ip.txt';
    
    mark("START",100,"Starting dynamic IP program");
    
    #read the previous ip address
    open S, "$ipfile";
    $prev_ip = ;
    close S;
    
    #Setup a file on a public html server that returns your external IP
    #In this case I just used an Apache SSI: REMOTE_ADDR
    $ip = get("http://");
    
    mark("READ",100,"Determined ip to be: ".$ip);
    
    if (!($ip eq $prev_ip)) {
        #report the current ip address to zoneedit.com
        $ua = new LWP::UserAgent;
    
        $ua->credentials('dynamic.zoneedit.com:80', 'ZoneEdit Access', $login, $pass);
    
        $request = new HTTP::Request('GET', "http://dynamic.zoneedit.com/auth/dynamic.html?zones=$zones");
    
        $response = $ua->request($request);
    
        if ($response->is_success) {
            #record successful update of the ip address
            open S, ">$ipfile";
            print S $ip;
            close S;
        } else {
            mark("ERROR", $response->code, $response->message);
        }
    } else {
        mark("NOCHNG",100,"No change was detected in the external ip.");
    }
    
    sub mark {
        my ($type, $code, $message) = @_;
    
        open  E, ">>$logfile";
        print localtime()."\t$type\t".$code."\t".$message."\n";
        print E localtime()."\t$type\t".$code."\t".$message."\n";
        close E;
    }
    May not be the most elegant solution, but its totally free and does what I need it to. The base code was originally done by Erik Aronesty of ZoneEdit, then I modified it to work with the external page idea brought up by Wildheart.

    Let me know if you have any questions about this.
    jro - http://jeff.robbins.ws
    Linux counter#:213782
    GnuPG ID: 406238E7

  3. #13
    Advisor beezlebubsbum's Avatar
    Join Date
    May 2004
    Location
    Australia
    Posts
    735
    I wish I had T1 I just moved to an area that is considered rural, which means I am stuck with 512kbps ADSL.
    My Website: http://ttgale.com
    My Website Uptime: http://img.uptimeprj.com/holastickbo...dee9bae2e2.png
    My Server Specs: AMD Athlon X2 3800+, 2gb DDR2 RAM, 1.5TB HDD, Ubuntu 9.10
    My Gaming PC: Intel Core 2 Duo 2.93ghz, 4gb DDR2 RAM, 9800GTX+

  4. #14
    Mentor jro's Avatar
    Join Date
    May 2004
    Location
    Pennsylvania, USA
    Posts
    1,206
    Thats good enough to host a small site off of beez. If you want some help implimenting my script I would be happy to answer any questions you might have.
    jro - http://jeff.robbins.ws
    Linux counter#:213782
    GnuPG ID: 406238E7

Similar Threads

  1. Document for setup networking - Dynamic IP, DYNDNS domain
    By satimis in forum Linux - Hardware, Networking & Security
    Replies: 1
    Last Post: 11-25-2006, 06:38 AM
  2. NIC With Static IP Assigning Itself Dynamic IP
    By Pleiades in forum Linux - Hardware, Networking & Security
    Replies: 6
    Last Post: 05-30-2006, 05:14 AM
  3. Webserver on dynamic IP
    By gmoreno in forum Linux - Hardware, Networking & Security
    Replies: 9
    Last Post: 08-18-2002, 04:32 PM
  4. Apache and dynamic dns
    By Jeepsta in forum Linux - Hardware, Networking & Security
    Replies: 3
    Last Post: 12-13-2001, 05:49 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
  •