Lab Objective:
The focus of this lab is to understand Embedded Event Manager (EEM) implementation and configuration in Cisco IOS routers. Additional technologies include Cisco IOS ERM.
Lab Topology:
This lab requires only a single router running, at a minimum, Cisco IOS Software 12.4 Mainline. The router should have at least one Ethernet interface. The primary purpose of this lab is to reinforce configuration knowledge of the stated chapter.
|
IMPORTANT NOTE If you have multiple devices and servers / hosts in your home lab and you would like to test solutions for topics such as Syslog, SNMP and NetFlow by setting up host and viewing charts or logging information, for example, please feel free to do so. While these labs include logging to ‘supposed’ hosts, there are no SNMP or Syslog servers in the http://www.howtonetwork.net racks and so you will not be able to test the solutions in those racks. If you only have a single router, you can bring up the Ethernet interface by implementing the following configuration: ! |
Task 1
Configure the router with a hostname of R1. Next, enable the LAN interface of the router and assign it the IP address 150.1.1.1/24. Ensure that this interface is in an up / up state.
Task 2
Configure a Cisco IOS Embedded Resource Manager (ERM) policy for critical CPU and memory utilization. The router should generate a critical Syslog message when the CPU and memory utilization exceeds 80% within a 15 second interval. Additionally, a Syslog message should also be generated when the CPU and memory utilization falls below 50% within a 15 second interval. Verify the Embedded Resource Manager configuration using appropriate commands.
Task 3
Management is worried about someone accidentally shutting down and interface and locking themselves (and every one) out of the router. They have requested that you configure an EEM script so that if the FastEthernet0/0 interface is shut down, the router will automatically re-enable the interface. Verify and testing your configuration using the appropriate commands.
Task 4
Configure the following static routes on the router (NOTE: ensure that interface Fa0/0 is up):
- 10.0.0.0/24 via 150.1.1.254
- 10.0.1.0/24 via 150.1.1.254
Management has requested that until they get the Cisco ACS server installed, the router should not allow anyone to delete the static routes. Write an EEM applet that prevents these, and any other, static routes from being deleted until AAA is configured on the router. The router should print the message ‘ACTION NOT ALLOWED’ . Verify your EEM configuration and test the applet by attempting to delete a static route.
Lab Validation
Task 1
If your routers interface is not connected to a switch or hub, you need to complete this task as is shown below. If you do have a hub or switch, you can omit the loopback and no keepalive commands under the LAN interface. This example assumes a standalone router.
| Router(config)#hostname R1 R1(config)#interface fastethernet 0/0 R1(config-if)#ip address 150.1.1.1 255.255.255.0 R1(config-if)#loopback Loopback is a traffic-affecting operation R1(config-if)#no keepalive R1(config-if)#no shutdown R1(config-if)#exit |
Next, verify your configuration using the show ip interface brief command:
| R1#show ip interface brief Interface IP-Address OK? Method Status Protocol FastEthernet0/0 150.1.1.1 YES manual up up Serial0/0 unassigned YES unset administratively down down Serial0/1 unassigned YES unset administratively down down |
Task 2
Embedded Resource Manager (ERM), while technically beyond the scope of the CCNP course, is an important tool that can be used to leverage additional monitoring tools in the real world. ERM allows you to monitor internal system resource utilization for specific resources such as the buffer, memory, and CPU. ERM monitors resource utilization from the perspective of various subsystems within the Cisco IOS software such as resource owners (ROs) and resource users (RUs). Additionally, ERM allows you to configure threshold values for system resources which allows alarm or Syslog generation when these thresholds are exceeded or fall belong specified values. Additional information on ERM can be found on the Cisco website. The URL for this information is located below (at the time of the writing of this guide):
http://www.cisco.com/en/US/docs/ios/12_3t/12_3t14/feature/guide/gt_rmimg.html
This task is completed on the router as follows:
| R1(config)#resource policy R1(config-erm)#policy HIGH-CPU-AND-MEMORY global R1(config-erm-policy)#system R1(config-policy-node)#cpu total R1(config-owner-cpu)#critical rising 80 interval 15 falling 50 interval 15 R1(config-owner-cpu)#exit R1(config-policy-node)#memory processor R1(config-owner-memory)#critical rising 80 interval 15 falling 50 interval 15 R1(config-owner-memory)#exit R1(config-erm-policy)#exit R1(config-erm)#user global HIGH-CPU-AND-MEMORY R1(config-erm)#exit |
Next, verify ERM configuration using the show running-config command:
| R1#show run | section resource policy resource policy policy HIGH-CPU-AND-MEMORY global system cpu total critical rising 80 interval 15 falling 50 interval 15 ! memory processor critical rising 80 interval 15 falling 50 interval 15 ! ! ! user global HIGH-CPU-AND-MEMORY ! |
Task 3
| R1(config)#event manager applet NO-SHUT R1(config-applet)#$”FastEthernet0/0, changed state to administratively down” R1(config-applet)#action 1.0 cli command “enable” R1(config-applet)#action 1.1 cli command “configure terminal” R1(config-applet)#action 1.2 cli command “interface fastethernet 0/0” R1(config-applet)#action 1.3 cli command “no shutdown” R1(config-applet)#action 1.4 cli command “end” R1(config-applet)#exit |
Following this, verify the EEM configuration using the show event manager command:
| R1#show event manager policy registered No. Class Type Event Type Trap Time Registered Name 1 applet user syslog Off Sat Jun 4 18:43:26 2011 NO-SHUT pattern {FastEthernet0/0, changed state to administratively down} action 1.0 cli command “enable” action 1.1 cli command “configure terminal” action 1.2 cli command “interface fastethernet 0/0” action 1.3 cli command “no shutdown” action 1.4 cli command “end” |
Finally, test the applet by attempting to shut down the FastEthernet0/0 interface on the router:
| R1(config)#interface fastethernet 0/0 R1(config-if)#shutdown R1(config-if)# *Jun 4 18:45:14.945: %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to administratively down *Jun 4 18:45:15.133: %SYS-5-CONFIG_I: Configured from console by on vty0 (EEM:NO-SHUT) *Jun 4 18:45:17.113: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up R1(config-if)#do sh interfaces fastethernet 0/0 FastEthernet0/0 is up, line protocol is up Hardware is AmdFE, address is 000f.235e.ec80 (bia 000f.235e.ec80) Internet address is 150.1.1.1/24 MTU 1500 bytes, BW 100000 Kbit/sec, DLY 100 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ARPA, loopback set Keepalive not set [Truncated Output] |
Task 4
| R1(config)#ip route 10.0.0.0 255.255.255.0 fastethernet 0/0 150.1.1.254 R1(config)#ip route 10.0.1.0 255.255.255.0 fastethernet 0/0 150.1.1.254 R1(config)#event manager applet NO-DELETING-ROUTES R1(config-applet)#event cli pattern “no ip route *” sync no skip yes R1(config-applet)#action 1.0 syslog msg “ACTION NOT ALLOWED” R1(config-applet)#exit |
Next, verify the EEM applet configuration using the show event manager command:
| R1#show event manager policy registered No. Class Type Event Type Trap Time Registered Name 1 applet user syslog Off Sat Jun 4 18:43:26 2011 NO-SHUT pattern {FastEthernet0/0, changed state to administratively down} action 1.0 cli command “enable” action 1.1 cli command “configure terminal” action 1.2 cli command “interface fastethernet 0/0” action 1.3 cli command “no shutdown” action 1.4 cli command “end” 2 applet user cli Off Sat Jun 4 18:48:47 2011 NO-DELETING-ROUTES |
Next, verify that the static routes are installed into the IP routing table:
| R1#show ip route static 10.0.0.0/24 is subnetted, 2 subnets S 10.0.0.0 [1/0] via 150.1.1.254, FastEthernet0/0 S 10.0.1.0 [1/0] via 150.1.1.254, FastEthernet0/0 |
Finally, test your solution by attempting to delete a static route:
| R1(config)#no ip route 10.0.1.0 255.255.255.0 fastethernet 0/0 150.1.1.254 R1(config)# *Jun 4 18:51:52.113: %HA_EM-6-LOG: NO-DELETING-ROUTES: ACTION NOT ALLOWED R1(config)#no ip route 10.0.0.0 255.255.255.0 fastethernet 0/0 150.1.1.254 R1(config)#do show ip route static |
Final Router Configurations
R1
|
R1#term len 0 Current configuration : 1607 bytes R1# |