This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Midnight IP renewal

Hi!

We have an T-DSL Business ADSL line, that disconnects every 24 hours. Since we are using DynDNS services, we want that disconnect to happen at a time, when noone is using our webservices.

Is it possible to write a cron-job that reconnects at 3:00 for example?

Thanks,
Thorsten


This thread was automatically locked due to age.
Parents
  • What "disconnects"?
    Your DHCP lease terminates?
    pppoe?
  • Oh, I'm sorry! It's a PPPoE-DSL connection.

    I want the script to disconnect the interface and reconnect it afterwards.

    The provider really cuts of our line, so that we have to reconnect. But at this time we get an new IP, what's not that good when providing web services...

    When the script disconnects our line, we can be sure, that there won't be an IP change for the next 24 hours. So during a normal work day, our IP we be the same all the time.

    At the moment, we get a new IP at 14:00. To change this, I'd have to restart the firewall at night. I normally sleep at this time...  [;)]

    But I think, I'm not the only one with this problem, am I?

    Thorsten
  • Best to put it in a script (though I suspect you can do the two commands using a bash && operator; but you might have to include the path to the bash interpreter...); here is a thread where they discuss the editing of cron entries:

    IPSec with bothside dyn. IP´s

    [I'm surprised there wasn't an example at the Astaro Hacker's website]
  • I´m surprised too ;-)

    Maybe they do not know about it... so I will put the esentials of the thread into the Astaro Hacker´s website.

    techno.kid
  • Thanks from us and those yet to come...
  • Can you post a link to that thread?

    And just to put it right:

    I'll then create a script called "crontab.dslreconnect" in /etc with this content:
    0 3 * * *  root /var/chroot-pppoe/etc/ppp/ip-down

    Is this right for the PPPoE to reconnect at 3:00?

    Thanks,
    Thorsten
  • Am I getting this right or am I mistaking???
  • At least the "time" part though I do not know if the pppoe interface will come up automatically after the "down".

    techno.kid
  • At least that's what you wrote on the ASL hacker page:
     How can I reset my DSL/pppoe interface?
  • [ QUOTE ]
    Oh, I'm sorry! It's a PPPoE-DSL connection.

    I want the script to disconnect the interface and reconnect it afterwards.

    The provider really cuts of our line, so that we have to reconnect. But at this time we get an new IP, what's not that good when providing web services...

    When the script disconnects our line, we can be sure, that there won't be an IP change for the next 24 hours. So during a normal work day, our IP we be the same all the time.

    At the moment, we get a new IP at 14:00. To change this, I'd have to restart the firewall at night. I normally sleep at this time...  [;)]

    But I think, I'm not the only one with this problem, am I?

    Thorsten 

    [/ QUOTE ]

    If they disconnect you just decrease the reconnect that astaro uses to redial. No need to add another script as Astaro has one built in for redialing. By default the redial time is 15 minutes.  The mods below make it 60 seconds. I have changed it as follows:
    If you are using pppoe (ie DSL) to connect to the net and you reset your modem Astaro takes 15 minutes to reconnect. I traced this to the DSL.sh file in /var/chroot-pppoe/bin/DSL.sh where the timeouts are set to 900 seconds. These to me seem to be way too high. I changed mine as follows:


    Code:


    # timeouts in seconds
    MINTIME=60
    ACRETRY=10
    PPPOERETRY=60
  • OK, since you guys do not seem to get my point, I created the ""crontab.dslreconnect" file as mentioned above and modified the "DSL.sh" file according to your values. I'll then check the PPPOE logfiles and tell you, what happened...
  • Hi THoehne,

    that would be great - I then will "put" this all together at the aslhackers faq.
    Besides: you are right - in fact I did write about the pppoe down script but forgot it :-)

    techno.kid
Reply Children
No Data