schedule an action on a router

Discussion in 'Cisco' started by vsakel, Jan 24, 2007.

  1. vsakel

    vsakel Guest

    Hello everyone,

    has anybody an idea how can i schedule an interface on a router to be shut
    down, after a specific period of time or periodically?

    thanks in advance
     
    vsakel, Jan 24, 2007
    #1
    1. Advertising

  2. In article <1169672219.668220@athprx04>, vsakel <> wrote:

    >has anybody an idea how can i schedule an interface on a router to be shut
    >down, after a specific period of time or periodically?


    Do you need it to be shut down (i.e., drop carrier, remove the
    connected routes from the routing tables, stop sending BDPUs, etc.),
    or do you need it to stop permitting traffic through? Also, should
    the time it goes down be relative to whenever it was put up
    (e.g., "stay up for 30 minutes and then shut yourself down"), or should
    it be absolute times (e.g., "stay up from 02:30 to 03:00") ?

    If what you need is to stop passing traffic, then you can use time-
    based access lists, available since about 12.0T:
    http://www.cisco.com/univercd/cc/td/doc/product/software/ios120/120newft/120t/120t1/timerang.htm

    time-based access-lists are, if I recall correctly, not available with
    all switches, and may require some kind of Enhanced Image on other
    switches. They are supported on a fairly wide variety of routers, but
    I do not know if they are supported on -all- Cisco routers; you
    could check the feature navigator http://www.cisco.com/go/fn
     
    Walter Roberson, Jan 24, 2007
    #2
    1. Advertising

  3. vsakel

    vsakel Guest

    I want ''physicaly'' to be shut down (a serial interface) in order the other
    end's router to realise this as a line disconnection. Actually it is a
    complex X25 reroute implementation which must be happened every day at
    night.


    "Walter Roberson" <> wrote in message
    news:UYPth.781830$1T2.679422@pd7urf2no...
    >
    > In article <1169672219.668220@athprx04>, vsakel <> wrote:
    >
    >>has anybody an idea how can i schedule an interface on a router to be shut
    >>down, after a specific period of time or periodically?

    >
    > Do you need it to be shut down (i.e., drop carrier, remove the
    > connected routes from the routing tables, stop sending BDPUs, etc.),
    > or do you need it to stop permitting traffic through? Also, should
    > the time it goes down be relative to whenever it was put up
    > (e.g., "stay up for 30 minutes and then shut yourself down"), or should
    > it be absolute times (e.g., "stay up from 02:30 to 03:00") ?
    >
    > If what you need is to stop passing traffic, then you can use time-
    > based access lists, available since about 12.0T:
    > http://www.cisco.com/univercd/cc/td/doc/product/software/ios120/120newft/120t/120t1/timerang.htm
    >
    > time-based access-lists are, if I recall correctly, not available with
    > all switches, and may require some kind of Enhanced Image on other
    > switches. They are supported on a fairly wide variety of routers, but
    > I do not know if they are supported on -all- Cisco routers; you
    > could check the feature navigator http://www.cisco.com/go/fn
    >
     
    vsakel, Jan 24, 2007
    #3
  4. In article <1169674358.714438@athnrd02>, vsakel <> wrote:
    >I want ''physicaly'' to be shut down (a serial interface) in order the other
    >end's router to realise this as a line disconnection. Actually it is a
    >complex X25 reroute implementation which must be happened every day at
    >night.


    Perhaps a tcl script? And/or something using kron ?
    I haven't investigated either, so I don't know their limitations
    or what IOS versions support them.
     
    Walter Roberson, Jan 24, 2007
    #4
  5. vsakel

    vsakel Guest

    Yes a tcl script maybe but i don't know how. i didn't find any example ...

    anyway thanks Walter

    "Walter Roberson" <> wrote in message
    news:mmQth.783414$5R2.614911@pd7urf3no...
    >
    > In article <1169674358.714438@athnrd02>, vsakel <> wrote:
    >>I want ''physicaly'' to be shut down (a serial interface) in order the
    >>other
    >>end's router to realise this as a line disconnection. Actually it is a
    >>complex X25 reroute implementation which must be happened every day at
    >>night.

    >
    > Perhaps a tcl script? And/or something using kron ?
    > I haven't investigated either, so I don't know their limitations
    > or what IOS versions support them.
    >
     
    vsakel, Jan 24, 2007
    #5
  6. vsakel

    stephen Guest

    "vsakel" <> wrote in message
    news:1169674358.714438@athnrd02...
    > I want ''physicaly'' to be shut down (a serial interface) in order the

    other
    > end's router to realise this as a line disconnection. Actually it is a
    > complex X25 reroute implementation which must be happened every day at
    > night.


    Basic one - try a mains power timer on the DSU or whatever drives the serial
    line (if its powered separately). No bits will move if the link is dead....

    or if the link uses a routing protocol, maybe you can use Walters idea and
    block the routing packets?

    (i have a vague memory that sometimes routing packets go around filtering,
    so you need to test this on your box / IOS version).
    >
    >
    > "Walter Roberson" <> wrote in message
    > news:UYPth.781830$1T2.679422@pd7urf2no...
    > >
    > > In article <1169672219.668220@athprx04>, vsakel <>

    wrote:
    > >
    > >>has anybody an idea how can i schedule an interface on a router to be

    shut
    > >>down, after a specific period of time or periodically?

    > >
    > > Do you need it to be shut down (i.e., drop carrier, remove the
    > > connected routes from the routing tables, stop sending BDPUs, etc.),
    > > or do you need it to stop permitting traffic through? Also, should
    > > the time it goes down be relative to whenever it was put up
    > > (e.g., "stay up for 30 minutes and then shut yourself down"), or should
    > > it be absolute times (e.g., "stay up from 02:30 to 03:00") ?
    > >
    > > If what you need is to stop passing traffic, then you can use time-
    > > based access lists, available since about 12.0T:
    > >

    http://www.cisco.com/univercd/cc/td/doc/product/software/ios120/120newft/120t/120t1/timerang.htm
    > >
    > > time-based access-lists are, if I recall correctly, not available with
    > > all switches, and may require some kind of Enhanced Image on other
    > > switches. They are supported on a fairly wide variety of routers, but
    > > I do not know if they are supported on -all- Cisco routers; you
    > > could check the feature navigator http://www.cisco.com/go/fn
    > >

    Also dont forget you will need the router clock to be accurate - NTP?

    And pick a box with battery backed clock - otherwise things will go crazy
    for a while after a power cut :)

    --
    Regards

    - replace xyz with ntl
     
    stephen, Jan 24, 2007
    #6
  7. In article <1169675492.573544@athnrd02>, vsakel <> wrote:

    >"Walter Roberson" <> wrote in message
    >news:mmQth.783414$5R2.614911@pd7urf3no...


    >> In article <1169674358.714438@athnrd02>, vsakel <> wrote:
    >>>I want ''physicaly'' to be shut down (a serial interface) in order the
    >>>other
    >>>end's router to realise this as a line disconnection. Actually it is a
    >>>complex X25 reroute implementation which must be happened every day at
    >>>night.


    >> Perhaps a tcl script? And/or something using kron ?


    >Yes a tcl script maybe but i don't know how. i didn't find any example ...


    Here's some pointers for kron:

    http://www.cisco.com/univercd/cc/td/doc/product/software/ios124/124tcr/tnm_r/nmg_03ht.htm#wp1262401

    http://www.cisco.com/univercd/cc/td/doc/product/software/ios124/124tcr/tnm_r/nmg_01ht.htm#wp1257330

    kron allows the scheculing of cli EXEC level commands. "tclsh" is an
    EXEC level command so possibly you could trigger the start of a tcl
    script. tcl can be used to submit configuration mode commands such as
    selecting an interface and "shutdown" it.

    http://www.cisco.com/univercd/cc/td/doc/product/software/ios123/123newft/123t/123t_2/gt_tcl.htm


    This is probably a hack approach to someone who knows what they are
    doing with this stuff ;-) But it isn't clear that there is a meaningful
    event loop in tcl itself unless you happen to have the Embedded
    System Monitor module installed.
     
    Walter Roberson, Jan 24, 2007
    #7
  8. vsakel

    Uto cen Guest

    Maybe you could use a script in conjunction with snmpset?
    Something like :
    snmpset <ip> <rwcommunity> interfaces.ifTable.ifEntry.ifAdminStatus.<x> i 2

    make sure proper security is in place for snmp write.


    "vsakel" <> wrote in message
    news:1169672219.668220@athprx04...
    > Hello everyone,
    >
    > has anybody an idea how can i schedule an interface on a router to be shut
    > down, after a specific period of time or periodically?
    >
    > thanks in advance
    >
     
    Uto cen, Jan 25, 2007
    #8
  9. vsakel

    Guest

    On 25 Jan, 04:54, "Uto cen" <> wrote:
    > Maybe you could use a script in conjunction with snmpset?
    > Something like :
    > snmpset <ip> <rwcommunity> interfaces.ifTable.ifEntry.ifAdminStatus.<x> i 2
    >
    > make sure proper security is in place for snmp write.
    >
    > "vsakel" <> wrote in messagenews:1169672219.668220@athprx04...
    >
    >
    >
    > > Hello everyone,

    >
    > > has anybody an idea how can i schedule an interface on a router to be shut
    > > down, after a specific period of time or periodically?

    >
    > > thanks in advance- Hide quoted text -- Show quoted text -


    I like the snmp one all controlled externally.

    Regarding Cisco tcl examples, where were you looking,
    under the bed? Did you try google?

    [cisco tcl example] in google returns what looks to me
    like some excellent examples as the first hit and
    the second and third look rather promising.

    There are also tools for remotely controlling
    routers (and anything else that you can telnet to)
    via the command line. Expect, Perl Expect extensions.
    Terraterm, kiwi tools, Cisco Open Source Initiative
    on Sourceforge.

    I think that you need a least the Enterprise feature set to
    get TCL and Cron (Kron? or is that Korn?:).
     
    , Jan 25, 2007
    #9
  10. In article <>,
    <> wrote:

    >Regarding Cisco tcl examples, where were you looking,
    >under the bed? Did you try google?


    >[cisco tcl example] in google returns what looks to me
    >like some excellent examples as the first hit and
    >the second and third look rather promising.


    None of the first couple of pages of google hits even hints at
    how a timed event might be executed. It appears that a couple of
    Cisco (or ex-Cisco) employees have written books about using tcl,
    but the ones I find were written a decade ago and thus do not
    describe what is possible for IOS.

    Here's a source that -maybe- would help:
    http://tcllib.sourceforge.net/
     
    Walter Roberson, Jan 25, 2007
    #10
  11. vsakel

    Guest

    On 25 Jan, 16:01, (Walter Roberson) wrote:
    > In article <>,
    >
    > <> wrote:
    > >Regarding Cisco tcl examples, where were you looking,
    > >under the bed? Did you try google?
    > >[cisco tcl example] in google returns what looks to me
    > >like some excellent examples as the first hit and
    > >the second and third look rather promising.None of the first couple of pages of google hits even hints at

    > how a timed event might be executed. It appears that a couple of
    > Cisco (or ex-Cisco) employees have written books about using tcl,
    > but the ones I find were written a decade ago and thus do not
    > describe what is possible for IOS.
    >
    > Here's a source that -maybe- would help:http://tcllib.sourceforge.net/


    The missing piece was that I assumed that the timing and the
    operations carried out were seperate functions. I have not tried it but
    I have heard that Enterpries IOS supports "cron" which
    provides in some way the scheduling leaving tcl for the
    operations.

    Maybe I am mistaken.

    I had a look at the first example that google
    returned and it looked as if there was enough to get going with.

    If there really is a cron lookalike and a seperate tcl then
    I would certainly use them in that way and would not consider
    rolling my own scheduller in tcl, even if the tools were provided.
    But then I am not really a programmer.
     
    , Jan 25, 2007
    #11
  12. In article <>,
    <> wrote:

    >I have heard that Enterpries IOS supports "cron" which
    >provides in some way the scheduling leaving tcl for the
    >operations.


    >If there really is a cron lookalike and a seperate tcl then
    >I would certainly use them in that way and would not consider
    >rolling my own scheduller in tcl, even if the tools were provided.
    >But then I am not really a programmer.


    I already posted pointers to Cisco's kron facility. I might have missed
    something, but it appears that kron is restricted to EXEC mode commands.
    Invoking the tcl shell is an EXEC mode command, but does not look to
    take arguments (such as a single command or a script name). As I do
    not happen to have anything close to an appropriate device on hand,
    I cannot experiment to see what can be hacked together.

    I like the external SNMP Set idea, but I am wondering if the
    administrative status of an interface is settable via SNMP ? If not,
    then the SNMP used might have to be to set the name of a configuration
    file and then to trigger a tftp of that configuration file, with
    the configuration file having the appropriate "shutdown" or "no shut"
    command.

    Possibly there is an approach in the "cli cns" kron command.

    Oh wait -- is copying in a file from tftp an EXEC mode command
    or a config mode command?
     
    Walter Roberson, Jan 25, 2007
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff Specoli

    Re: schedule Pix Access-list

    Jeff Specoli, Apr 1, 2004, in forum: Cisco
    Replies:
    0
    Views:
    496
    Jeff Specoli
    Apr 1, 2004
  2. Sir Kal

    Exam Schedule

    Sir Kal, Oct 2, 2004, in forum: MCSD
    Replies:
    1
    Views:
    577
    Oyvind
    Oct 6, 2004
  3. Harindra Devadiga
    Replies:
    6
    Views:
    4,924
    Mike T.
    May 10, 2004
  4. =?Utf-8?B?RnJhbmNpcw==?=

    Reboot / Restart Server in Schedule Task

    =?Utf-8?B?RnJhbmNpcw==?=, May 11, 2004, in forum: MCSE
    Replies:
    7
    Views:
    9,632
  5. bigal
    Replies:
    126
    Views:
    10,829
    Jyoti Ballabh
    Nov 26, 2009
Loading...

Share This Page