Not much to share with this module.
_________
ICMP Echo use a Type 8 (Sending)
ICMP Echo use a Type 0 (Replying)
Default Timeout: 2 Seconds
Ping Size: 100 Bytes
_________
access-list 100 permit icmp any any
debug ip packet 100 detail
_________
Tuesday, September 28, 2010
Lab Notes - Misc 9.27.2010
interface FastEthernet0/0.26
encapsulation dot1Q 26
ip dhcp client client-id ascii VLAN26_R6
ip dhcp client hostname VLAN26_R6
ip address dhcp
SW4#sh ip proto
*** IP Routing is NSF aware ***
Routing Protocol is "eigrp 56"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Default networks flagged in outgoing updates
Default networks accepted from incoming updates
Redistributing: eigrp 56
Address Family Protocol EIGRP-IPv4:(56)
EIGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0
EIGRP maximum hopcount 100
EIGRP maximum metric variance 1
EIGRP NSF-aware route hold timer is 240
Topologies : 0(base)
Automatic network summarization is in effect
Maximum path: 4
Routing for Networks:
148.49.56.0/24
Routing Information Sources:
Gateway Distance Last Update
148.49.56.9 90 00:45:39
Gateway Distance Last Update
148.49.56.6 90 00:46:01
Distance: internal 90 external 170
SW4#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW4(config)#
Routing Protocol is "rip"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Outgoing routes will have 2 added to metric if on list Rip_metric_2
Sending updates every 30 seconds, next due in 26 seconds
Invalid after 180 seconds, hold down 180, flushed after 240
Redistributing: ospf 1, rip
Default version control: send version 2, receive version 2
Interface Send Recv Triggered RIP Key-chain
FastEthernet0/0.26 2 2
Automatic network summarization is not in effect
Maximum path: 4
Routing for Networks:
148.49.0.0
Passive Interface(s):
FastEthernet0/1
Serial0/1/0
Serial0/1/0.98
Serial0/1/0.99
Serial0/3/0
Serial0/3/1
Loopback102
Passive Interface(s):
VoIP-Null0
Routing Information Sources:
Gateway Distance Last Update
148.49.26.6 120 00:00:17
Distance: (default is 120)
SW1(config)#ip arp inspection filter oscar ?
vlan Vlans to apply the filter
SW1(config)#ip arp inspection filter oscar vl
SW1(config)#ip arp inspection filter oscar vlan 500 ?
static Apply the ACL statically
<cr>
SW1(config)#ip arp inspection filter oscar vlan 500 s
SW1(config)#ip arp inspection filter oscar vlan 500 static
SW1(config)#ip arp in
SW1(config)#ip arp inspection
% Incomplete command.
SW1(config)#ip arp inspection ?
filter Specify ARP acl to be applied
log-buffer Log Buffer Configuration
validate Validate addresses
vlan Enable/Disable ARP Inspection on vlans
SW1(config)#ip arp inspection v
SW1(config)#ip arp inspection vA
SW1(config)#ip arp inspection vAlidate ?
dst-mac Validate destination MAC address
ip Validate IP addresses
src-mac Validate source MAC address
SW1(config)#ip arp inspection vAlidate sr
SW1(config)#ip arp inspection vAlidate src-mac ip
SW1(config)#ip arp inspection vAlidate src-mac ip ?
allow Specify exceptions to IP address validation
dst-mac Validate destination MAC address
<cr>
SW1(config)#ip arp inspection vAlidate src-mac ip
SW1(config)#do sh ip arp ins vla 500
Source Mac Validation : Enabled
Destination Mac Validation : Disabled
IP Address Validation : Enabled
Vlan Configuration Operation ACL Match Static ACL
---- ------------- --------- --------- ----------
500 Enabled Active oscar Yes
Vlan ACL Logging DHCP Logging Probe Logging
---- ----------- ------------ -------------
500 Deny Deny Off
SW1(config)#
encapsulation dot1Q 26
ip dhcp client client-id ascii VLAN26_R6
ip dhcp client hostname VLAN26_R6
ip address dhcp
SW4#sh ip proto
*** IP Routing is NSF aware ***
Routing Protocol is "eigrp 56"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Default networks flagged in outgoing updates
Default networks accepted from incoming updates
Redistributing: eigrp 56
Address Family Protocol EIGRP-IPv4:(56)
EIGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0
EIGRP maximum hopcount 100
EIGRP maximum metric variance 1
EIGRP NSF-aware route hold timer is 240
Topologies : 0(base)
Automatic network summarization is in effect
Maximum path: 4
Routing for Networks:
148.49.56.0/24
Routing Information Sources:
Gateway Distance Last Update
148.49.56.9 90 00:45:39
Gateway Distance Last Update
148.49.56.6 90 00:46:01
Distance: internal 90 external 170
SW4#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW4(config)#
Routing Protocol is "rip"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Outgoing routes will have 2 added to metric if on list Rip_metric_2
Sending updates every 30 seconds, next due in 26 seconds
Invalid after 180 seconds, hold down 180, flushed after 240
Redistributing: ospf 1, rip
Default version control: send version 2, receive version 2
Interface Send Recv Triggered RIP Key-chain
FastEthernet0/0.26 2 2
Automatic network summarization is not in effect
Maximum path: 4
Routing for Networks:
148.49.0.0
Passive Interface(s):
FastEthernet0/1
Serial0/1/0
Serial0/1/0.98
Serial0/1/0.99
Serial0/3/0
Serial0/3/1
Loopback102
Passive Interface(s):
VoIP-Null0
Routing Information Sources:
Gateway Distance Last Update
148.49.26.6 120 00:00:17
Distance: (default is 120)
SW1(config)#ip arp inspection filter oscar ?
vlan Vlans to apply the filter
SW1(config)#ip arp inspection filter oscar vl
SW1(config)#ip arp inspection filter oscar vlan 500 ?
static Apply the ACL statically
<cr>
SW1(config)#ip arp inspection filter oscar vlan 500 s
SW1(config)#ip arp inspection filter oscar vlan 500 static
SW1(config)#ip arp in
SW1(config)#ip arp inspection
% Incomplete command.
SW1(config)#ip arp inspection ?
filter Specify ARP acl to be applied
log-buffer Log Buffer Configuration
validate Validate addresses
vlan Enable/Disable ARP Inspection on vlans
SW1(config)#ip arp inspection v
SW1(config)#ip arp inspection vA
SW1(config)#ip arp inspection vAlidate ?
dst-mac Validate destination MAC address
ip Validate IP addresses
src-mac Validate source MAC address
SW1(config)#ip arp inspection vAlidate sr
SW1(config)#ip arp inspection vAlidate src-mac ip
SW1(config)#ip arp inspection vAlidate src-mac ip ?
allow Specify exceptions to IP address validation
dst-mac Validate destination MAC address
<cr>
SW1(config)#ip arp inspection vAlidate src-mac ip
SW1(config)#do sh ip arp ins vla 500
Source Mac Validation : Enabled
Destination Mac Validation : Disabled
IP Address Validation : Enabled
Vlan Configuration Operation ACL Match Static ACL
---- ------------- --------- --------- ----------
500 Enabled Active oscar Yes
Vlan ACL Logging DHCP Logging Probe Logging
---- ----------- ------------ -------------
500 Deny Deny Off
SW1(config)#
Lab Notes - Misc 9.26.2010
w2(config-if)#mls qos ?
cos cos keyword
dscp-mutation dscp-mutation keyword
ipe ipe keyword
trust trust keyword
vlan-based vlan-based keyword
sw2(config-if)#mls qos
sw2(config)#mls qos ?
aggregate-policer Named aggregate policer
map qos map keyword
queue-set Choose a queue set for this queue
rewrite Rewrite Packet/Frame
srr-queue Configure SRR receive queues
<cr>
sw2(config)#mls qos ma
sw2(config)#mls qos map ?
cos-dscp cos-dscp map: eight dscp values for cos 0-7
dscp-cos dscp-cos map keyword
dscp-mutation dscp-mutation map keyword
ip-prec-dscp dscp values for ip precedences 0 - 7
policed-dscp policed-dscp map keyword
sw2(config)#mls qos map
interface Port-channel1
switchport trunk encapsulation dot1q
switchport mode trunk
link state group 1 downstream
link state track 1
interface FastEthernet0/23
switchport trunk encapsulation dot1q
switchport mode trunk
link state group 1 downstream
channel-group 1 mode on
!
interface FastEthernet0/24
switchport trunk encapsulation dot1q
switchport mode trunk
link state group 1 downstream
channel-group 1 mode on
!
interface fa 0/23
sw1(config-if)#mls qos vlan-based
sw1(config-if)#mls
sw1(config-if)#mls qo
sw1(config-if)#mls qos tr
sw1(config-if)#mls qos trust dscp
port is vlan-based for interface FastEthernet0/23
sw1(config-if)#inter fa 0/24
sw1(config-if)#mls qos tr
sw1(config-if)#mls qos trust dscp
sw1(config-if)#
!
class-map match-all cm-dscp-ef
match ip dscp ef
class-map match-all cm-24
match input-interface FastEthernet0/24
!
!
policy-map vlan10
class cm-dscp-ef
trust dscp
policy-map vlan30
class class-default
trust dscp
policy-map vlan20
class class-default
trust dscp
policy-map port24ef
class cm-dscp-ef
police 80000 8000 exceed-action policed-dscp-transmit
class cm-24
police 80000 8000 exceed-action drop
interface Vlan10
no ip address
service-policy input vlan10
!
interface Vlan20
no ip address
service-policy input vlan20
!
interface Vlan30
no ip address
service-policy input vlan30
sw1(config)#do sh policy-map interface
Vlan10
Service-policy input: vlan10
Class-map: cm-dscp-ef (match-all)
0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: ip dscp ef (46)
Class-map: class-default (match-any)
0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: any
0 packets, 0 bytes
5 minute rate 0 bps
Vlan20
Service-policy input: vlan20
Class-map: class-default (match-any)
0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: any
0 packets, 0 bytes
5 minute rate 0 bps
Vlan30
Service-policy input: vlan30
Class-map: class-default (match-any)
0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: any
0 packets, 0 bytes
5 minute rate 0 bps
sw1(config)#
sw2(config)#mls qos
sw2(config-if)#do sh mls qos inter fa 0/24 queu
FastEthernet0/24
Egress Priority Queue : disabled
Shaped queue weights (absolute) : 4 4 0 0
Shared queue weights : 1 1 7 3
The port bandwidth limit : 100 (Operational
Bandwidth:100.0)
The port is mapped to qset : 1
sw2(config-if)#srr-queue bandwidth ?
limit Configure bandwidth-limit for this interface
shape Configure shaping on transmit queues
share Configure shared bandwidth
sw2(config-if)#srr-queue bandwidth
sw2(config-if)#srr-queue bandwidth share 4 4 1 4
sw2(config-if)#srr-queue bandwidth shape 0 0 3 0
sw2(config-if)#do sh mls qos interfa fa 0/23 q
FastEthernet0/23
Egress Priority Queue : disabled
Shaped queue weights (absolute) : 0 0 3 0
Shared queue weights : 4 4 1 4
The port bandwidth limit : 100 (Operational
Bandwidth:100.0)
The port is mapped to qset : 1
r2#sh event manager policy available detailed
sl_intf_down.tcl
::cisco::eem::event_register_syslog occurs 1 pattern
$_syslog_pattern maxrun 90
#----------------------------------
# EEM policy to monitor for a specified syslog message.
# Designed to be used for syslog interface-down messages.
# When event is triggered, the given config commands will be
run.
#
#
# July 2005, Cisco EEM team
#
# Copyright (c) 2005-2006 by cisco Systems, Inc.
# All rights reserved.
#----------------------------------
### The following EEM environment variables are used:
###
### _syslog_pattern (mandatory) - A regular
expression pattern match string
### that is used to
compare syslog messages
### to determine when policy runs
### Example: _syslog_pattern
.*UPDOWN.*FastEthernet0/0.*
###
### _email_server (mandatory) - A Simple Mail
Transfer Protocol (SMTP)
### mail server used to send e-mail.
### Example: _email_server
mailserver.customer.com
###
### _email_from (mandatory) - The address from
which e-mail is sent.
### Example: _email_from
devtest@customer.com
###
### _email_to (mandatory) - The address to
which e-mail is sent.
### Example: _email_to
engineering@customer.com
###
### _email_cc (optional) - The address to
which the e-mail must
### be copied.
### Example: _email_cc
manager@customer.com
###
### _config_cmd1 (optional) - The first
configuration command that
### is executed.
### Example: _config_cmd1 interface
Ethernet1/0
###
### _config_cmd2 (optional) - The second
configuration command that
### is executed.
### Example: _config_cmd2 no shutdown
###
# check if all the env variables we need exist
# If any of them doesn't exist, print out an error msg and
quit
if {![info exists _email_server]} {
set result \
"Policy cannot be run: variable _email_server has
not been set"
error $result $errorInfo
}
if {![info exists _email_from]} {
set result \
"Policy cannot be run: variable _email_from has not
been set"
error $result $errorInfo
}
if {![info exists _email_to]} {
set result \
"Policy cannot be run: variable _email_to has not
been set"
error $result $errorInfo
}
if {![info exists _email_cc]} {
#_email_cc is an option, must set to empty string if
not set.
set _email_cc ""
}
namespace import ::cisco::eem::*
namespace import ::cisco::lib::*
# 1. query the information of latest triggered eem event
array set arr_einfo [event_reqinfo]
if {$_cerrno != 0} {
set result [format "component=%s; subsys err=%s; posix
err=%s;\n%s" \
$_cerr_sub_num $_cerr_sub_err $_cerr_posix_err
$_cerr_str]
error $result
}
set msg $arr_einfo(msg)
set config_cmds ""
# 2. execute the user-defined config commands
if [catch {cli_open} result] {
error $result $errorInfo
} else {
array set cli1 $result
}
if [catch {cli_exec $cli1(fd) "en"} result] {
error $result $errorInfo
}
if [catch {cli_exec $cli1(fd) "config t"} result] {
error $result $errorInfo
}
if {[info exists _config_cmd1]} {
if [catch {cli_exec $cli1(fd) $_config_cmd1} result] {
error $result $errorInfo
}
append config_cmds $_config_cmd1
}
if {[info exists _config_cmd2]} {
if [catch {cli_exec $cli1(fd) $_config_cmd2} result] {
error $result $errorInfo
}
append config_cmds "\n"
append config_cmds $_config_cmd2
}
if [catch {cli_exec $cli1(fd) "end"} result] {
error $result $errorInfo
}
if [catch {cli_close $cli1(fd) $cli1(tty_id)} result] {
error $result $errorInfo
}
after 60000
# 3. send the notification email
set routername [info hostname]
if {[string match "" $routername]} {
error "Host name is not configured"
}
if [catch {smtp_subst [file join $tcl_library
email_template_cfg.tm]} result] {
error $result $errorInfo
}
if [catch {smtp_send_email $result} result] {
error $result $errorInfo
}
r2#
r2#show event manager policy available detailed
tm_cli_cmd.tcl
::cisco::eem::event_register_timer cron name crontimer2
cron_entry $_cron_entry maxrun 240
#----------------------------------
# EEM policy that will periodically execute a cli command
and email the
# results to a user.
#
# July 2005, Cisco EEM team
#
# Copyright (c) 2005-2006 by cisco Systems, Inc.
# All rights reserved.
#----------------------------------
### The following EEM environment variables are used:
###
### _cron_entry (mandatory) - A CRON
specification that determines
### when the policy
will run. See the
### IOS Embedded Event Manager
### documentation for
more information
### on how to specify a cron entry.
### Example: _cron_entry 0-59/1 0-23/1 * *
0-7
###
### _log_file (mandatory without _email_....)
### - A filename to
append the output to.
### If this variable is
defined, the
### output is appended
to the specified
### file with a timestamp added.
### Example: _log_file disk0:/my_file.log
###
### _email_server (mandatory without _log_file)
### - A Simple Mail
Transfer Protocol (SMTP)
### mail server used to
send e-mail.
### Example: _email_server
mailserver.customer.com
###
### _email_from (mandatory without _log_file)
### - The address from
which e-mail is sent.
### Example: _email_from
devtest@customer.com
###
### _email_to (mandatory without _log_file)
### - The address to which e-mail is
sent.
### Example: _email_to
engineering@customer.com
###
### _email_cc (optional) - The address to
which the e-mail must
### be copied.
### Example: _email_cc
manager@customer.com
###
### _show_cmd (mandatory) - The CLI command to
be executed when
### the policy is run.
### Example: _show_cmd show version
###
# check if all the env variables we need exist
# If any of them doesn't exist, print out an error msg and
quit
if {![info exists _log_file]} {
if {![info exists _email_server]} {
set result \
"Policy cannot be run: variable _log_file or
_email_server has not been set"
error $result $errorInfo
}
if {![info exists _email_from]} {
set result \
"Policy cannot be run: variable _log_file or
_email_from has not been set"
error $result $errorInfo
}
if {![info exists _email_to]} {
set result \
"Policy cannot be run: variabl _log_file ore
_email_to has not been set"
error $result $errorInfo
}
if {![info exists _email_cc]} {
#_email_cc is an option, must set to empty string if
not set.
set _email_cc ""
}
}
if {![info exists _show_cmd]} {
set result \
"Policy cannot be run: variable _show_cmd has not
been set"
error $result $errorInfo
}
namespace import ::cisco::eem::*
namespace import ::cisco::lib::*
#query the event info and log a message
array set arr_einfo [event_reqinfo]
if {$_cerrno != 0} {
set result [format "component=%s; subsys err=%s; posix
err=%s;\n%s" \
$_cerr_sub_num $_cerr_sub_err $_cerr_posix_err
$_cerr_str]
error $result
}
global timer_type timer_time_sec
set timer_type $arr_einfo(timer_type)
set timer_time_sec $arr_einfo(timer_time_sec)
set routername [info hostname]
#log a message
set msg [format "timer event: timer type %s, time expired
%s" \
$timer_type [clock format $timer_time_sec]]
action_syslog priority info msg $msg
if {$_cerrno != 0} {
set result [format "component=%s; subsys err=%s; posix
err=%s;\n%s" \
$_cerr_sub_num $_cerr_sub_err $_cerr_posix_err
$_cerr_str]
error $result
}
# 1. execute the command
if [catch {cli_open} result] {
error $result $errorInfo
} else {
array set cli1 $result
}
if [catch {cli_exec $cli1(fd) "en"} result] {
error $result $errorInfo
}
# save exact execution time for command
set time_now [clock seconds]
# execute command
if [catch {cli_exec $cli1(fd) $_show_cmd} result] {
error $result $errorInfo
} else {
set cmd_output $result
# format output: remove trailing router prompt
set prompt [format
"(.*\n)(%s)(\\(config\[^\n\]*\\))?(#|>)" $routername]
if [regexp "[set prompt]" $result dummy cmd_output] {
# do nothing, match will be in $cmd_output
} else {
# did not match router prompt so use original output
set cmd_output $result
}
}
if [catch {cli_close $cli1(fd) $cli1(tty_id)} result] {
error $result $errorInfo
}
# 2. log the success of the CLI command
set msg [format "Command \"%s\" executed successfully"
$_show_cmd]
action_syslog priority info msg $msg
if {$_cerrno != 0} {
set result [format "component=%s; subsys err=%s; posix
err=%s;\n%s" \
$_cerr_sub_num $_cerr_sub_err $_cerr_posix_err
$_cerr_str]
error $result
}
# 3. if _log_file is defined, then attach it to the file
if {[info exists _log_file]} {
# attach output to file
if [catch {open $_log_file a+} result] {
error $result
}
set fileD $result
# save timestamp of command execution
# (Format = 00:53:44 PDT Mon May 02 2005)
set time_now [clock format $time_now -format "%T %Z %a
%b %d %Y"]
puts $fileD "%%% Timestamp = $time_now"
puts $fileD $cmd_output
close $fileD
}
# 4. if _email_server is defined send the email out
if {[info exists _email_server]} {
if {[string match "" $routername]} {
error "Host name is not configured"
}
if [catch {smtp_subst [file join $tcl_library
email_template_cmd.tm]} \
result] {
error $result $errorInfo
}
if [catch {smtp_send_email $result} result] {
error $result $errorInfo
}
}
r2#
cos cos keyword
dscp-mutation dscp-mutation keyword
ipe ipe keyword
trust trust keyword
vlan-based vlan-based keyword
sw2(config-if)#mls qos
sw2(config)#mls qos ?
aggregate-policer Named aggregate policer
map qos map keyword
queue-set Choose a queue set for this queue
rewrite Rewrite Packet/Frame
srr-queue Configure SRR receive queues
<cr>
sw2(config)#mls qos ma
sw2(config)#mls qos map ?
cos-dscp cos-dscp map: eight dscp values for cos 0-7
dscp-cos dscp-cos map keyword
dscp-mutation dscp-mutation map keyword
ip-prec-dscp dscp values for ip precedences 0 - 7
policed-dscp policed-dscp map keyword
sw2(config)#mls qos map
interface Port-channel1
switchport trunk encapsulation dot1q
switchport mode trunk
link state group 1 downstream
link state track 1
interface FastEthernet0/23
switchport trunk encapsulation dot1q
switchport mode trunk
link state group 1 downstream
channel-group 1 mode on
!
interface FastEthernet0/24
switchport trunk encapsulation dot1q
switchport mode trunk
link state group 1 downstream
channel-group 1 mode on
!
interface fa 0/23
sw1(config-if)#mls qos vlan-based
sw1(config-if)#mls
sw1(config-if)#mls qo
sw1(config-if)#mls qos tr
sw1(config-if)#mls qos trust dscp
port is vlan-based for interface FastEthernet0/23
sw1(config-if)#inter fa 0/24
sw1(config-if)#mls qos tr
sw1(config-if)#mls qos trust dscp
sw1(config-if)#
!
class-map match-all cm-dscp-ef
match ip dscp ef
class-map match-all cm-24
match input-interface FastEthernet0/24
!
!
policy-map vlan10
class cm-dscp-ef
trust dscp
policy-map vlan30
class class-default
trust dscp
policy-map vlan20
class class-default
trust dscp
policy-map port24ef
class cm-dscp-ef
police 80000 8000 exceed-action policed-dscp-transmit
class cm-24
police 80000 8000 exceed-action drop
interface Vlan10
no ip address
service-policy input vlan10
!
interface Vlan20
no ip address
service-policy input vlan20
!
interface Vlan30
no ip address
service-policy input vlan30
sw1(config)#do sh policy-map interface
Vlan10
Service-policy input: vlan10
Class-map: cm-dscp-ef (match-all)
0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: ip dscp ef (46)
Class-map: class-default (match-any)
0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: any
0 packets, 0 bytes
5 minute rate 0 bps
Vlan20
Service-policy input: vlan20
Class-map: class-default (match-any)
0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: any
0 packets, 0 bytes
5 minute rate 0 bps
Vlan30
Service-policy input: vlan30
Class-map: class-default (match-any)
0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: any
0 packets, 0 bytes
5 minute rate 0 bps
sw1(config)#
sw2(config)#mls qos
sw2(config-if)#do sh mls qos inter fa 0/24 queu
FastEthernet0/24
Egress Priority Queue : disabled
Shaped queue weights (absolute) : 4 4 0 0
Shared queue weights : 1 1 7 3
The port bandwidth limit : 100 (Operational
Bandwidth:100.0)
The port is mapped to qset : 1
sw2(config-if)#srr-queue bandwidth ?
limit Configure bandwidth-limit for this interface
shape Configure shaping on transmit queues
share Configure shared bandwidth
sw2(config-if)#srr-queue bandwidth
sw2(config-if)#srr-queue bandwidth share 4 4 1 4
sw2(config-if)#srr-queue bandwidth shape 0 0 3 0
sw2(config-if)#do sh mls qos interfa fa 0/23 q
FastEthernet0/23
Egress Priority Queue : disabled
Shaped queue weights (absolute) : 0 0 3 0
Shared queue weights : 4 4 1 4
The port bandwidth limit : 100 (Operational
Bandwidth:100.0)
The port is mapped to qset : 1
r2#sh event manager policy available detailed
sl_intf_down.tcl
::cisco::eem::event_register_syslog occurs 1 pattern
$_syslog_pattern maxrun 90
#----------------------------------
# EEM policy to monitor for a specified syslog message.
# Designed to be used for syslog interface-down messages.
# When event is triggered, the given config commands will be
run.
#
#
# July 2005, Cisco EEM team
#
# Copyright (c) 2005-2006 by cisco Systems, Inc.
# All rights reserved.
#----------------------------------
### The following EEM environment variables are used:
###
### _syslog_pattern (mandatory) - A regular
expression pattern match string
### that is used to
compare syslog messages
### to determine when policy runs
### Example: _syslog_pattern
.*UPDOWN.*FastEthernet0/0.*
###
### _email_server (mandatory) - A Simple Mail
Transfer Protocol (SMTP)
### mail server used to send e-mail.
### Example: _email_server
mailserver.customer.com
###
### _email_from (mandatory) - The address from
which e-mail is sent.
### Example: _email_from
devtest@customer.com
###
### _email_to (mandatory) - The address to
which e-mail is sent.
### Example: _email_to
engineering@customer.com
###
### _email_cc (optional) - The address to
which the e-mail must
### be copied.
### Example: _email_cc
manager@customer.com
###
### _config_cmd1 (optional) - The first
configuration command that
### is executed.
### Example: _config_cmd1 interface
Ethernet1/0
###
### _config_cmd2 (optional) - The second
configuration command that
### is executed.
### Example: _config_cmd2 no shutdown
###
# check if all the env variables we need exist
# If any of them doesn't exist, print out an error msg and
quit
if {![info exists _email_server]} {
set result \
"Policy cannot be run: variable _email_server has
not been set"
error $result $errorInfo
}
if {![info exists _email_from]} {
set result \
"Policy cannot be run: variable _email_from has not
been set"
error $result $errorInfo
}
if {![info exists _email_to]} {
set result \
"Policy cannot be run: variable _email_to has not
been set"
error $result $errorInfo
}
if {![info exists _email_cc]} {
#_email_cc is an option, must set to empty string if
not set.
set _email_cc ""
}
namespace import ::cisco::eem::*
namespace import ::cisco::lib::*
# 1. query the information of latest triggered eem event
array set arr_einfo [event_reqinfo]
if {$_cerrno != 0} {
set result [format "component=%s; subsys err=%s; posix
err=%s;\n%s" \
$_cerr_sub_num $_cerr_sub_err $_cerr_posix_err
$_cerr_str]
error $result
}
set msg $arr_einfo(msg)
set config_cmds ""
# 2. execute the user-defined config commands
if [catch {cli_open} result] {
error $result $errorInfo
} else {
array set cli1 $result
}
if [catch {cli_exec $cli1(fd) "en"} result] {
error $result $errorInfo
}
if [catch {cli_exec $cli1(fd) "config t"} result] {
error $result $errorInfo
}
if {[info exists _config_cmd1]} {
if [catch {cli_exec $cli1(fd) $_config_cmd1} result] {
error $result $errorInfo
}
append config_cmds $_config_cmd1
}
if {[info exists _config_cmd2]} {
if [catch {cli_exec $cli1(fd) $_config_cmd2} result] {
error $result $errorInfo
}
append config_cmds "\n"
append config_cmds $_config_cmd2
}
if [catch {cli_exec $cli1(fd) "end"} result] {
error $result $errorInfo
}
if [catch {cli_close $cli1(fd) $cli1(tty_id)} result] {
error $result $errorInfo
}
after 60000
# 3. send the notification email
set routername [info hostname]
if {[string match "" $routername]} {
error "Host name is not configured"
}
if [catch {smtp_subst [file join $tcl_library
email_template_cfg.tm]} result] {
error $result $errorInfo
}
if [catch {smtp_send_email $result} result] {
error $result $errorInfo
}
r2#
r2#show event manager policy available detailed
tm_cli_cmd.tcl
::cisco::eem::event_register_timer cron name crontimer2
cron_entry $_cron_entry maxrun 240
#----------------------------------
# EEM policy that will periodically execute a cli command
and email the
# results to a user.
#
# July 2005, Cisco EEM team
#
# Copyright (c) 2005-2006 by cisco Systems, Inc.
# All rights reserved.
#----------------------------------
### The following EEM environment variables are used:
###
### _cron_entry (mandatory) - A CRON
specification that determines
### when the policy
will run. See the
### IOS Embedded Event Manager
### documentation for
more information
### on how to specify a cron entry.
### Example: _cron_entry 0-59/1 0-23/1 * *
0-7
###
### _log_file (mandatory without _email_....)
### - A filename to
append the output to.
### If this variable is
defined, the
### output is appended
to the specified
### file with a timestamp added.
### Example: _log_file disk0:/my_file.log
###
### _email_server (mandatory without _log_file)
### - A Simple Mail
Transfer Protocol (SMTP)
### mail server used to
send e-mail.
### Example: _email_server
mailserver.customer.com
###
### _email_from (mandatory without _log_file)
### - The address from
which e-mail is sent.
### Example: _email_from
devtest@customer.com
###
### _email_to (mandatory without _log_file)
### - The address to which e-mail is
sent.
### Example: _email_to
engineering@customer.com
###
### _email_cc (optional) - The address to
which the e-mail must
### be copied.
### Example: _email_cc
manager@customer.com
###
### _show_cmd (mandatory) - The CLI command to
be executed when
### the policy is run.
### Example: _show_cmd show version
###
# check if all the env variables we need exist
# If any of them doesn't exist, print out an error msg and
quit
if {![info exists _log_file]} {
if {![info exists _email_server]} {
set result \
"Policy cannot be run: variable _log_file or
_email_server has not been set"
error $result $errorInfo
}
if {![info exists _email_from]} {
set result \
"Policy cannot be run: variable _log_file or
_email_from has not been set"
error $result $errorInfo
}
if {![info exists _email_to]} {
set result \
"Policy cannot be run: variabl _log_file ore
_email_to has not been set"
error $result $errorInfo
}
if {![info exists _email_cc]} {
#_email_cc is an option, must set to empty string if
not set.
set _email_cc ""
}
}
if {![info exists _show_cmd]} {
set result \
"Policy cannot be run: variable _show_cmd has not
been set"
error $result $errorInfo
}
namespace import ::cisco::eem::*
namespace import ::cisco::lib::*
#query the event info and log a message
array set arr_einfo [event_reqinfo]
if {$_cerrno != 0} {
set result [format "component=%s; subsys err=%s; posix
err=%s;\n%s" \
$_cerr_sub_num $_cerr_sub_err $_cerr_posix_err
$_cerr_str]
error $result
}
global timer_type timer_time_sec
set timer_type $arr_einfo(timer_type)
set timer_time_sec $arr_einfo(timer_time_sec)
set routername [info hostname]
#log a message
set msg [format "timer event: timer type %s, time expired
%s" \
$timer_type [clock format $timer_time_sec]]
action_syslog priority info msg $msg
if {$_cerrno != 0} {
set result [format "component=%s; subsys err=%s; posix
err=%s;\n%s" \
$_cerr_sub_num $_cerr_sub_err $_cerr_posix_err
$_cerr_str]
error $result
}
# 1. execute the command
if [catch {cli_open} result] {
error $result $errorInfo
} else {
array set cli1 $result
}
if [catch {cli_exec $cli1(fd) "en"} result] {
error $result $errorInfo
}
# save exact execution time for command
set time_now [clock seconds]
# execute command
if [catch {cli_exec $cli1(fd) $_show_cmd} result] {
error $result $errorInfo
} else {
set cmd_output $result
# format output: remove trailing router prompt
set prompt [format
"(.*\n)(%s)(\\(config\[^\n\]*\\))?(#|>)" $routername]
if [regexp "[set prompt]" $result dummy cmd_output] {
# do nothing, match will be in $cmd_output
} else {
# did not match router prompt so use original output
set cmd_output $result
}
}
if [catch {cli_close $cli1(fd) $cli1(tty_id)} result] {
error $result $errorInfo
}
# 2. log the success of the CLI command
set msg [format "Command \"%s\" executed successfully"
$_show_cmd]
action_syslog priority info msg $msg
if {$_cerrno != 0} {
set result [format "component=%s; subsys err=%s; posix
err=%s;\n%s" \
$_cerr_sub_num $_cerr_sub_err $_cerr_posix_err
$_cerr_str]
error $result
}
# 3. if _log_file is defined, then attach it to the file
if {[info exists _log_file]} {
# attach output to file
if [catch {open $_log_file a+} result] {
error $result
}
set fileD $result
# save timestamp of command execution
# (Format = 00:53:44 PDT Mon May 02 2005)
set time_now [clock format $time_now -format "%T %Z %a
%b %d %Y"]
puts $fileD "%%% Timestamp = $time_now"
puts $fileD $cmd_output
close $fileD
}
# 4. if _email_server is defined send the email out
if {[info exists _email_server]} {
if {[string match "" $routername]} {
error "Host name is not configured"
}
if [catch {smtp_subst [file join $tcl_library
email_template_cmd.tm]} \
result] {
error $result $errorInfo
}
if [catch {smtp_send_email $result} result] {
error $result $errorInfo
}
}
r2#
Monday, September 27, 2010
Trouble Shooting VOD 1-2
Here are just a few notes from c360 TS 1-2...
You can use the pipe as an "OR":
show run | <include | exclude | section> ospf
_______________
This will include the characters "ip" anything can be in between with the ".*" and "34 or 45"
show run | include (ip.*34|ip.*45)
_______________
If you do a show run and it comes to the <more> prompt you can add a "/router" and it will start back at the word "router".
_______________
These (3) commands will see all of the output to the buffer where you can view it then search for desired output.
#logging buffered 100000
#no logging console
#no terminal monitor
You can use the pipe as an "OR":
show run | <include | exclude | section> ospf
_______________
This will include the characters "ip" anything can be in between with the ".*" and "34 or 45"
show run | include (ip.*34|ip.*45)
_______________
If you do a show run and it comes to the <more> prompt you can add a "/router" and it will start back at the word "router".
_______________
These (3) commands will see all of the output to the buffer where you can view it then search for desired output.
#logging buffered 100000
#no logging console
#no terminal monitor
Subscribe to:
Posts (Atom)