cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2013
Views
0
Helpful
3
Replies
Highlighted
Beginner

Macro: Enable FastEthernet 1/0/1-10 if FastEthernet 1/0/48 is going down

Hello,

I would like to know, if it is possible to set the interface range FastEthernet 1/0/1-10 to "no shutdown" via marco, if Interface FastEthernet 1/0/48 changes state to down (e.g. Networkcable unplugged).

If it ist possilbe could you provide the macro here?

Kind regards

3 REPLIES 3
Highlighted
Beginner

Kai -

You absoultely can script items like this with Cisco devices - they are standard telnet/SSH.  However you have to take a few things into consideration.

1. The device is a switching/routing operating system, meaning it has limited adminsitrative tools; in your case, there is no way on the device to have it recognize if an interface went down and to executive a script.

2. What you're wanting to accomplish can easily be handled by some SNMP monitoring software and having that software run a script which logs into the device, and issues the appropriate commands.

The key to accomplishing what you want to do is the fact that it cannot be handled internally, but my be handled by a third-party device.

Thanks,

Sean Brown

http://www.sleepyshark.com

(Rate me, if i'm helpful)

Highlighted

Hi Sean,

Thank you for your quit answer. Please tell if I'm wrong. The the Switch can recognize, if an interface changes his state to up. After this a macro will be executed.

Like this for example

configure terminal

         macro name changevlan

         switchport access vlan $access

         @

         !=== Create macro

         interface FastEthernet 0/1

         macro apply changevlan $access 100

         !=== Apply macro - variable = 100 - put interface in vlan 100

So, if I understood you correctly, the switch can not execute an macro on port down only on port up like in my sample?

Kind Regard

Highlighted

I got a few steps closer to my target, currently I'm trying this

function MyFunction () {

  if [[ $LINKUP -eq NO ]]; then

     interface  $INTERFACE

       no shutdown

     exit

  fi

}

But now I'v to setup, that $LINKUP tracks the port state of GigabitEthernet 0/48 and $INTERFACE hast to be raplaced with interface range gigabitEthernet 0/1-10

Content for Community-Ad