Help us enhance your Sophos Community experience. Share your thoughts in our Sophos Community survey.

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 ]
    The problem is, my line isn't disconnected every midnight. It disconnects every 24 hours! So when I do an reboot e.g. because of an Up2Date packet at 10:00, I get a new IP avery day at 10:00!
    But I don't want to get a new IP every day at 10:00 when normal work is in progress. I want the disconnect happen at night! So I have to force a disconnect at night, that I get a new IP when nobody's in the office.
    You understand my problem? 

    [/ QUOTE ]

    Yes but it is not a problem.  The transistion would be hardly noticeable.  What i would do instead of hacking the box.  Stay late one night and force a reboot(or login remotly from home via webadmin) and force a reboot.  That would reset your timer..then everything would take place during the time you want it to.  

    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 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 ]
    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???
Reply
  • 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???
Children