Sunday, July 18, 2010

EIGRP Stub Leak

EIGRP Stub Leak is a feature on Cisco router which allows EIGRP stub routers to leak route to peer routers.  This is achieved by leak-map, which is a route map that permit specific route to leak through.  A video is recorded to demonstrate how it works:

English version:

Chinese (Cantonese) version:

Monday, April 12, 2010

Learning Nexus 7000 QoS by Example

My environment: Nexus 7010, NX-OS 4.2

Just got a chance to play with the Nexus 7000 NX-OS QoS, the “mls qos” syntax has gone and now all the commands are based on MQC.

 

In the following example, I’m going to configure 2 ingress ports, one with high priority traffic and one with normal traffic, and at egress port high priority traffic will be assigned to PQ to dequeue first.

 

Classification

N7K# conf t

class-map type queuing match-any 1p3q4t-out-pq1

  match cos 5

It can only be done via the main VDC.  It can’t be done on child VDC.  And you can ONLY match cos in the class-map.

Marking

Now let’s mark the ingress traffic, I will do this at the port assigned to the vdc “test”.

N7K# switchto vdc test

N7K-test#

policy-map type queuing highpriority-in-policy

   class type queuing 2q4t-in-q-default

     set cos 5

Scheduling and Queuing

Finally, I want to assign the high priority traffic (cos=5) to PQ

N7K-test#

policy-map type queuing highpriority-out-policy

  class type queuing 1p3q4t-out-pq1

    priority level 1

Last step is to assign service policy to the interface:

N7K-test#

int e3/1

description - High Priority – Ingress -

service-policy type queuing input highpriority-in-policy

!

int e3/2

description – Low Priority – Ingress -

!

int e3/3

description – Egress Port -

service-policy type queuing output highpriority-out-policy

!

Tuesday, March 30, 2010

Create tftp bindings for phone firmware automatically on CME

My environment:  IOS 12.4(24)T1, CME 7.1, Cisco 2821
You can create automatic tftp bindings for all phone firmware instead of doing it manually one by one by using the “load” command under “telephony-service”.  Make sure you include the firmware file suffix in order to make the tftp binding automatically.  Without the suffix you need to configure it manually with the command “tftp-server flash:xxxx.loads”, etc.
Example:
telephony-service
load 7962 SCCP42.8-4-2S.loads
You might see this error after issuing the above load command:
LOAD COMMAND ERROR:cnf-file location system is not supported for creating automatic tftp bindings. Please use file location flash | slot0 | tftp OR create tftp bindings manually
Make sure you’ve entered the command “cnf-file location flash:” under “telephony-service” to specify the firmware location, then the error will go away!

An iPhone app for CME Config Generation:
http://itunes.apple.com/us/app/cme-config-generator/id453025819?ls=1&mt=8

Monday, December 28, 2009

Script to turn off PoE power using Energywise

My environment: Cisco 3560E

Besides shutting down the switchport, you can turn off the PoE power via the Energywise command.  Before you run this script, setup your energywise domain with the command “energywise domain panda security shared-secret eatsbamboo”

#!/usr/bin/expect

set timeout 5
log_user 1
set hostlist "pandasw01"
set prompt "pandasw01"
foreach host $hostlist {
#set prompt [append $host "#"]
set promptcfg [append $prompt "(config)#"]
spawn telnet $host
expect $prompt
send "conf t\r"
expect $promptcfg
send "int range fa0/1 - 23\r"
expect $promptcfg
send "energywise level 0\r"
expect $promptcfg
send "end\r"
expect $prompt
send "exit\r"
}

Script to Turn off Cisco Autonomous Access Point radio interface

My environment: Cisco 861W

You can turn off the radio interface of the autonomous AP when you don’t use it to save power.

#!/usr/bin/expect

set timeout 5
log_user 1
set hostlist "pandaap01"
foreach host $hostlist {
set prompt [append $host "#"]
set promptcfg [append $prompt "(config)#"]
spawn telnet $host
expect $prompt
send "conf t\r"
expect $promptcfg
send "int dot11radio0\r"
expect $promptcfg
send "shut\r"
expect $promptcfg
send "end\r"
}

Friday, December 18, 2009

Script to backup Cisco Device Config

A handy expect script on Linux to backup your routers, switches, AP, or other IOS devices configuration.  Make sure you have “expect” installed on your Linux box.

#!/usr/bin/expect

set timeout 5
log_user 1

# Include your hosts in the hostlist
set hostlist "rt01 rt02 sw01 sw02"
foreach host $hostlist {
set prompt [append $host "#"]
spawn telnet $host
expect $prompt
send "term len 0\r"
expect $prompt
set time [exec date \+\%y\%m\%dT\%H\%MJ]
set filename [append host "-" $time]

# The config file storage location
log_file /home/pandaeatsbamboo/cfgbackup/$filename
send "show run\r"
expect $prompt
send "exit\r"
log_file
}

Latest Cisco Collaboration Demo by John and Jim

Cisco vs Aruba – 60-client High Density Test

Auto Smartports Macros

My environment: Cisco 3560E, IOS 12.2(53)SE

Auto Smartports Macros is a feature that provide easy and automatic way in deploying switchport configuration based on the endpoint types.  The device is identified based on CDP, MAC address, OUI etc.

To enable Auto Smartports:

macro auto global processing

You might want to change the Auto Smarport Macro default value say for example the access and voice vlan, say for example if you want to change the IP phone access vlan to 10 and voice vlan to 20:

macro auto device phone ACCESS_VLAN=10 VOICE_VLAN=20

to verify the change, type:

show macro auto device

 

If the end device doesn’t support CDP, you can classify the device based on OUI (the first 3 bytes of the MAC address) or full MAC address.  Say for example you want to use mac address trigger for your digital media player (DMP) which is not defined in the default OUI list.

macro auto mac-address group DMP-MAC-GROUP

mac-address list 000f.1234.5678

macro auto execute DMP-MAC-GROUP built-in CISCO_DMP_AUTO_SMARTPORT ACCESS_VLAN=10

to verify, type:

show macro auto address-group

To see which port applies what macros:

show macro auto interface

image

show run interface gi0/16

image

Tuesday, December 15, 2009

CIFS Mounted Drive for Apache

My environment: Apache 2.2.9 on Fedora Core 10 x86_64

Although it is not a good idea to do something like this, I’ve come across a case that I need to mount a CIFS drive and serve the content inside for an apache web server on Linux.  After some googling, the trick to make this work is to turn off a parameter called EnableSendfile in httpd.conf

#
# EnableSendfile: Control whether the sendfile kernel support is
# used to deliver files (assuming that the OS supports it).
# The default is on; turn this off if you serve from NFS-mounted
# filesystems.  Please see
#
http://httpd.apache.org/docs/2.2/mod/core.html#enablesendfile
#
EnableSendfile off