cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2361
Views
0
Helpful
3
Replies

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

Kai Onken
Level 1
Level 1

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

sleepyshark
Level 1
Level 1

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)

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

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

Review Cisco Networking for a $25 gift card