Your forum username:
Do you already have an account?
Forgot your password?
  • Log in or Sign up


    Welcome to Sky User - The Unofficial Support Forum for everything Sky! - Proudly helping over 65k members.


    Advertisement

    Results 1 to 1 of 1

    [How-to] D-Link DSL-2640S renew IP address, 1-click

    This is a discussion on [How-to] D-Link DSL-2640S renew IP address, 1-click within the Sky Router forums, part of the Sky Broadband help category; Downloading from sites like rapidshare / hotfile / megaupload can be frustrating if you keep getting "download limit exceed, wait ...

    1. #1
      t-bon3's Avatar
      t-bon3 is offline Sky User Member
      Exchange: WWHELS
      Broadband ISP: Sky Fibre Unlimited
      Router: Netgear D7000
      Sky TV: Other
      Join Date
      Nov 2010
      Location
      Helston
      Posts
      34
      Thanks
      0
      Thanked 2 Times in 2 Posts

      Lightbulb [How-to] D-Link DSL-2640S renew IP address, 1-click

      Downloading from sites like rapidshare / hotfile / megaupload can be frustrating if you keep getting "download limit exceed, wait X hours" messages.

      Using the router's web interface to disconnect and reconnect will renew the IP address and get around the limits but it's a lot of clicking!
      So I decided to make a windows .bat script to renew the address with a single click.

      I am using cURL to interact with the router web-interface from the command line. Download the windows version of cURL from http://www.paehl.com/open_source/?do...curl_721_3.zip

      Extract curl.exe and the 2 .bat files from the attachment below into the same folder.
      The 2 .bat files contain the following commands:

      1. session.bat
      Code:
      @echo off
      %~dp0curl.exe http://192.168.0.1/constatus.html -s -u "admin:sky" | find "var sessionKey"
      N.B If you have changed the router default username or password then replace "admin:sky" with yours.

      2. renew.bat
      Code:
      FOR /F "tokens=2 delims='" %%G IN ('"%~dp0session.bat"') DO set session=%%G
      %~dp0curl.exe "http://192.168.0.1/wanpppconnect.cmd?action=stop&sessionKey=%session%"
      choice /T 5 /N /D y
      FOR /F "tokens=2 delims='" %%G IN ('"%~dp0session.bat"') DO set session=%%G
      %~dp0curl.exe "http://192.168.0.1/wanpppconnect.cmd?action=start&sessionKey=%session%"
      Running renew.bat will give you a new public IP address.

      Linux version
      renew.sh
      Code:
      #!/bin/bash
      t=`curl http://192.168.0.1/constatus.html -s -u "admin:sky" | grep "var sessionKey" | cut -d"'" -f2`
      curl "http://192.168.0.1/wanpppconnect.cmd?action=stop&sessionKey=$t"
      sleep 5
      t=`curl http://192.168.0.1/constatus.html -s -u "admin:sky" | grep "var sessionKey" | cut -d"'" -f2`
      curl "http://192.168.0.1/wanpppconnect.cmd?action=start&sessionKey=$t"
      Attached Files Attached Files
      Last edited by t-bon3; 18-01-11 at 12:58 PM. Reason: added Linux version


    2. Advertisement
     

     

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •  
    SkyUser - Copyright © 2006-2017. SatDish and NewsreadeR | SkyUser is in no way affiliated with Sky Broadband / BSkyB
    RIPA NOTICE: NO CONSENT IS GIVEN FOR INTERCEPTION OF PAGE TRANSMISSION