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
  • [ QUOTE ]
    That is the way I used to do it. But since I do not want to stay up late just to reboot a company's machine, I'd prefer to do a skript.

    Furthermore my VPN access into our LAN doesn't work anymore from my home PC and those M$ suckers won't help me resolve it...  

    I could sleep better at night with this skript!  [;)] 

    [/ QUOTE ]

    Well if they truly disconnect you every 24 hours..you should only ahve to reboot once no?..

    Owner:  Emmanuel Technology Consulting

    http://etc-md.com

    Former Sophos SG(Astaro) advocate/researcher/Silver Partner

    PfSense w/Suricata, ntopng, 

    Other addons to follow

  • That would be right, if our provider didn't disconnect from time to time...  
  • Hi guys,

    to shorten this threat and looking forward to a solution I suggest THoehne is doing the testing of his cronjob and providing us the result - I´m positive that it will work like supposed to... 3:00 AM disconnection and a reconnection about 60 seconds later...

    techno.kid
  • Hi THoehne,

    my proposal is not touching the firewall. 
    Why don't you buy a cheep digital switching clock and power off your dsl-modem at your given time for 1 minute. As soon, as your modem is up again ASL will reconnect and you will have a new ip-address for the next 24 hours.
  • [ QUOTE ]
    Hi THoehne,

    my proposal is not touching the firewall. 
    Why don't you buy a cheep digital switching clock and power off your dsl-modem at your given time for 1 minute. As soon, as your modem is up again ASL will reconnect and you will have a new ip-address for the next 24 hours. 

    [/ QUOTE ]

    Hey...that's an excellent idea!..

    I would still change the reconnect timeout from 15 minutes to 60 seconds..but if you wnted to have a 'pure" firewall yes don't mess with it at all and use the clock..the untimate KISS solution..

    Owner:  Emmanuel Technology Consulting

    http://etc-md.com

    Former Sophos SG(Astaro) advocate/researcher/Silver Partner

    PfSense w/Suricata, ntopng, 

    Other addons to follow

  • OK, strange result.

    I had a chat with the Astaro Support and they told me, that the  ip-down script is called after the connection has been disconnected. It's not the script that disconnects the PPPOE line at all. They proposed me to change the status of the connection in the /etc/wfe/conf/itf.conf file from 1 to 0 and back to bring up the interface again.

    Nevertheless I sticked to my plan...

    And voilá: DynDns.org tells me, that our IP got updated this night! But at 4:20...
  • Hi, I have the same problem mentioned here.

    I have tested both solutions, kill the pppoe-process via cron, and disconnect pppoe by changing the interface-status parameter in itf.conf.

    Using the kill-command brings up "middleware not running"-mails every day. In the past I did not get those mails, why?

    Changing the parameter in itf.conf works fine, but I don't know how to integrate it in crontab. Any hints?

    Besides that I want to know why all pptp-connections are killed when I disconnect my pppoe with one of the method mentioned above???
  • For all the ASL users in Germany with the same problem: ALDI Sued offers a digital switching clock on 24th February for 3,99 EUR. 

    Ip-Down solution doesn't seem to work out well...
  • So here is my solution:

    create a crontab.reconnect file under /etc with

    0 5 * * *       root    kill -1 `ps -x | grep "/usr/sbin/pppoe" | grep -v "/usr/sbin/pppd-pppoe call" | awk '{print $1}'`

    and reboot. That worked for me, my pppoe reconnects every night at 5 o'clock without any problems.
Reply
  • So here is my solution:

    create a crontab.reconnect file under /etc with

    0 5 * * *       root    kill -1 `ps -x | grep "/usr/sbin/pppoe" | grep -v "/usr/sbin/pppd-pppoe call" | awk '{print $1}'`

    and reboot. That worked for me, my pppoe reconnects every night at 5 o'clock without any problems.
Children