Junos OS

last person joined: 6 days ago 

Ask questions and share experiences about Junos OS.
  • 1.  op script for forced disconnect of internet connection

    Posted 07-03-2009 08:22

    Hello,

     

    I have a problem with a vpn between several j-series routers. The devices are connected to the internet via dsl and the provider forces a disconnect every 24 hours.

    When the forced disconnect happens during the working hours there are sometimes problems with clients reconnecting to sessions on the server.

    So I want to schedule a disconnect with a script every day at 3:00 am.

    How can I do this?

     

    Any solution would be nice,

     

    Best regards,

     

    Michael



  • 2.  RE: op script for forced disconnect of internet connection

    Posted 07-04-2009 06:49
    Is it possible to achieve what you want manually through CLI commands or configuration changes?  If so then it would be possible to automate those same commands through an event script at a certain time of day.  What commands would you use to disconnect them?


  • 3.  RE: op script for forced disconnect of internet connection

    Posted 07-09-2009 05:48

    When I disconnect the connection I enter the following commands:

     

    edit interfaces pp0.0

    set disable

    commit

     

    To activate the connection again I enter the following commands:

     

    edit interfaces pp0.0

    delete disable

    commit

     

    Would it be possible to do this steps in two op scripts where the first is started at 3:00 am and the second is started at 3:01 am?



  • 4.  RE: op script for forced disconnect of internet connection
    Best Answer

    Posted 07-09-2009 06:21

    Try the attached script.  It disables pp0.0 at 3:00am, pauses for a minute, and then removes the disable statement.  The pause length can be lowered by decreasing the second count within jcs:sleep() if you decide that a minute is too long.

     

    To enable first copy it to your event script directory:

    /var/db/scripts/event

     

    Then enable it:

    set event-options event-script file bounce-pp.slax

     

    Minimum JUNOS version is 9.3.

     

    You can test it by altering the time to right before 3:00am and then reloading the event scripts (so they adjust to the new time):

     

     jnpr@R2D2-RE0> set date 200907090259.50
    Thu Jul  9 02:59:50 PDT 2009

    jnpr@R2D2-RE0> request system scripts event-scripts reload
    Event scripts loaded



  • 5.  RE: op script for forced disconnect of internet connection

    Posted 07-22-2009 00:01

    Hello,

     

    I have updated the devices to the requested JunOS version and installed the script. Everything is working fine.

     

    Thanks for the quick and easy solution!

     

    Michael