Documente Academic
Documente Profesional
Documente Cultură
BRKNMS-2464
@ciscoliveeurope, #CLEUR
Housekeeping
We value your feedback- don't forget to complete your online session evaluations after each session & the Overall Conference Evaluation which will be available online from Thursday
Visit the World of Solutions and Meet the Engineer
BRKNMS-2464
Cisco Public
Abstract
Is there too much manual configuration going on in your network? Have you ever accidentally locked yourself out of a remote device? Need to deploy a few hundred branch routers across the globe? Want to quickly apply maintenance config updates to a handful of devices running various different IOS releases? Your Cisco IOS Network provides a wealth of advanced device manageability instrumentation (DMI) and Embedded Automation Systems (EASy) to design and implement your own Network Automations. Learn how Network Automation allows you to automate manual tasks, better operate existing network services and even enable new and innovative networking solutions.
This Breakout Session uncovers embedded Network Automation capabilities you can use to interact with your network elements for the purpose of (re-)configuring them in a more effective, efficient and robust way. Network Automation fundamentals as well as the choice and use of appropriate practices are illustrated through a combination of presentation and best practice examples.
The topic is relevant for network planners and administrators, engineers and system integrators for both enterprises and service providers.
BRKNMS-2464 2012 Cisco and/or its affiliates. All rights reserved. Cisco Public
Welcome Aboard
This Session IS About: HOW to get Configuration into a Device
Practical Examples
This Session Is NOT About: WHAT to configure on a Device An Introduction to NMS Concepts An In-Depth Session on One Single Feature Engineering Details of IOS NMS applications
BRKNMS-2464 2012 Cisco and/or its affiliates. All rights reserved. Cisco Public
Agenda
1 2 3 4 5 6 7 8 9 10 11
12
13
BRKNMS-2464 2012 Cisco and/or its affiliates. All rights reserved. Cisco Public
From: Detailed control by a single central authority Towards: Collaborative operations of a partially autonomic system
BRKNMS-2464 2012 Cisco and/or its affiliates. All rights reserved. Cisco Public
network engineer
support staff
applications
*.mdf
*.tcl
config
IOS images
xDM files
device groups
individual devices
large scale
BRKNMS-2464
Cisco Public
Deployment Commissioning
hostname pe-south ! enable password c ! mpls ip ! interface Loopbac ip address 10.10
Move physical network equipment into its operating location Make new network equipment ready for use and reachable by operations, NMS Configure a network element depending on its role and function in the network Configure portions of a network for the purpose of a specific user and/or service
Configuration
Provisioning Activation
BRKNMS-2464
Cisco Public
Focus
The Basics
interface
Running Configuration
...
conf t
See: www.cisco.com/en/US/docs/ios/preface/usingios.html
BRKNMS-2464 2012 Cisco and/or its affiliates. All rights reserved. Cisco Public
do ..
...
Startup Configuration
enable
Config Register
10
Command Aliases
Pre-defines Aliases are available on the CLI
Custom Aliases can be defined per (Sub-)Mode
router# conf t Enter configuration commands, one per line. End with CNTL/Z. router(config)# alias exec shib show ip interface brief router(config)# alias exec shru show running-config router(config)# alias exec shrb show running-config | begin router(config)# alias configure h hostname Router(config)# alias interface nsh no shutdown
11
Consequtive Range
router(config)# define interface-range mylist FastEthernet 2 , FastEthernet 4 - 6 router(config)# interface range macro mylist router(config-if-range)# no shut
Arbitrary Group
router(config)# interface range FastEthernet 5/1.1 FastEthernet 5/1.4 router(config-if-range)# encapsulation dot1Q 220 router(config-if-range)# no shut Works on
This will apply: VLAN ID 220 FastEthernet 5/1.1 VLAN ID 221 FastEthernet 5/1.2 VLAN ID 222 FastEthernet 5/1.3 VLAN ID 223 FastEthernet 5/1.4
BRKNMS-2464 2012 Cisco and/or its affiliates. All rights reserved. Cisco Public
12
13
More Basics
Dad: One has to prevent the other from doing stupid things
Son: Which one is doing the stupid things?
BRKNMS-2464
Cisco Public
15
Tracks config commands entered per user, per session Notification sent indicating config change has taken placechanges can be retrieved via SNMP
Replace running config with any saved configuration (only the diffs are applied) to return to previous state Automatically save configs locally or off box Config Rollback Confirmed Change
(from 12.4(23)T, 12.2(33)S) (from 12.3(14)T, 12.2(25)S)
Configuration locking
Ensures exclusive configuration change access
BRKNMS-2464 2012 Cisco and/or its affiliates. All rights reserved. Cisco Public
16
Solution: replace the running configuration with the latest good archive after two minutes unless the change made is confirmed
router# show archive There are currently 4 archive configurations saved. The next archive file will be named disk0:/config-archive-4 Archive # Name 0 1 disk0:/config-archive-1 2 disk0:/config-archive-2 3 disk0:/config-archive-3 <- Most Recent router# config replace disk0:/config-archive-3 time 120 : ... your Config Change work here ... : router# no config replace disk0:/config-archive-3
Available from: IOS 12.3(7)T, 12.2(25)S
BRKNMS-2464 2012 Cisco and/or its affiliates. All rights reserved. Cisco Public
17
Solution: revert the running configuration after two minutes unless the change made is confirmed
router# config terminal revert time 2 Rollback Confirmed Change: Backing up current running config to flash:bk-2 Enter configuration commands, one per line. End with CNTL/Z. : ... your Config Change work here ... : router# hostname oops oops(config)# end oops# Rollback Confirmed Change: Rollback will begin in one minute. Enter "configure confirm" if you wish to keep what you've configured oops# Rollback Confirmed Change: rolling to:flash:bk-2 Total number of passes: 1 Rollback Done router# Available from: IOS 12.4(23)T, 12.2(33)S
BRKNMS-2464 2012 Cisco and/or its affiliates. All rights reserved. Cisco Public
or
18
Automated Staging I
?
BRKNMS-2464 2012 Cisco and/or its affiliates. All rights reserved. Cisco Public
20
See: http://www.cisco.com/en/US/docs/ios/12_1t/12_1t5/feature/guide/dt_dhcpa.html Available from: IOS 12.1(5)T, IOS-XE 2.1.0 Platforms: ASR 1000, x8xx ISR, x9xx ISR, 37xx, ME3400, ME4900, Cat4k, Cat6k, 76xx, 10k, UC520 See also: Smart Install
BRKNMS-2464 2012 Cisco and/or its affiliates. All rights reserved. Cisco Public
21
0.
1. 2. 3. 4. 5. 6.
22
No
No
No
AutoInstall Fails
No
AutoInstall Completes
AutoInstall Fails
AutoInstall Completes
23
Automated Staging II
BRKNMS-2464
Cisco Public
25
Cisco Integrated Customization Services (CICS) New Service from Cisco Open to all Cisco customers Tiered Service Integrated with Ordering Systems
Helps customers
- reduce cost - increase operational efficiency
26
Template management initially via existing CX interface, from mid-2012 onward also via CCW
BRKNMS-2464 2012 Cisco and/or its affiliates. All rights reserved. Cisco Public
27
?
29
BRKNMS-2464
Cisco Public
Logistics
Provisioning
IOIO
- Target Configlets
- Data and Physical flow interwoven - everything happens on the critical path - multiple manual interactions - no closed-loop feedback - inflexible logistics Robustness ? Authentication, privacy ?
Customer Premise Manual activation feedback
package slip
BRKNMS-2464
Cisco Public
30
Solution: Preconfigure Routers with a generic boostrap config via AutoInstall or CICS. This config ensures initial IP connectivity, identifies the device and communicates back to Configuration Engine for appropriate target config. Router# Router# Router# Router# cns cns cns cns id hardware-serial config initial MyConfigEngine 80 event no-persist id hardware-serial event event MyConfigEngine 11011
2012 Cisco and/or its affiliates. All rights reserved. Cisco Public
BRKNMS-2464
31
LDAP
IOIO
Config Config Engine Engine
BRKNMS-2464 2012 Cisco and/or its affiliates. All rights reserved.
Customer Premise
Cisco Public
32
1c
- Standard Service Templates - Service Options (Sub-)Templates - Bespoke Customization Configlets
1a 1b
Provisioning
2c
LDAP
- de-coupling of Data and Physical flow - generic bootstrap config, bulk loaded - flexible logistics Linking: - CPE driven provisioning 3 Robustness, Transactionality - Order ID (= PIN) Authentication, Encryption - CNS Device ID (= HW Serial) Efficiency
- CNS/Device ID - Template References - Parameters
welcome letter with PIN
bootsrap configs
2a 4
Config Config Engine Engine
BRKNMS-2464 2012 Cisco and/or its affiliates. All rights reserved. Cisco Public
Customer Premise
33
TFTP
CCE
1. 2.
Warehouse
DHCP Offer
3.
2
4.
3
DHCP Request
5.
4
6.
5
TFTP Request: bootstrap config TFTP Response: bootstrap config
8 9 10
LDAP
Customer Premise
7. 8. 9.
CE FS
11
12 13
BRKNMS-2464
34
? Async interface Auto-Template interface Bridge-Group Virtual Interface CDMA Ix interface CTunnel interface Dialer interface FastEthernet IEEE 802.3 Async Group interface Lex interface Loopback interface Multilink Frame Relay bundle interface Multilink-group interface Ethernet Channel of interfaces cisco service engine module Tunnel interface PGM Multicast Host interface Virtual dot11 interface Virtual PPP interface Virtual Template interface Virtual TokenRing Use hardware serial number as unique ID Use hostname as unique ID Use an arbitrary string as the unique ID Use the UDI as unique ID Virtual Multipoint Interface
2012 Cisco and/or its affiliates. All rights reserved.
Cisco Public
35
?
37
BRKNMS-2464
Cisco Public
Smart Install
Smart Install provides deployment automations Automated Access Switch IOS Image and Config deployment from factory default configuration Automated Access Switch replacement and Image/Config restoration from factory default configuration Smart Install Director acts as a single management point for images and configuration of client switches.
Smart Install Director detects new switches, and identifies the correct Cisco IOS image and the configuration file for downloading. It can allocate an IP address and host name to a client.
On-demand group configuration and software image updates are available via the director too.
BRKNMS-2464
Cisco Public
38
Smart Install
DHCP Server
Client Switches
BRKNMS-2464
Cisco Public
39
BRKNMS-2464
Cisco Public
40
Since Client Switch doesnt have VTP configured in factory default, no VLAN mismatch will be reported Client Switch target config should provide consistency
BRKNMS-2464 2012 Cisco and/or its affiliates. All rights reserved. Cisco Public
41
Custom Scripting
IOS Shell
Problem: Sometimes we need more than what Interface ranges, Macros, Auto SmartPorts and other CLI features already offer.
But we may not want all the power and complexity of Tcl Scripting or Embedded Event Manager
Solution: Use IOS Shell (IOS.sh)
IOS Shell offers Environment Variables Pipe and Redirection Condition Testing Loops Built-in Functions Custom Function Definitions
Available from: IOS 12.2(52)SE
BRKNMS-2464 2012 Cisco and/or its affiliates. All rights reserved. Cisco Public
MY_VAR=value, %n | if []; then else fi show shell functions shell exec <function> function <name>(){}
IOS.sh # _
43
BRKNMS-2464
Cisco Public
44
TCL Cisco IOS Extended Commands TCL Built In Command Cisco IOS Command
45
Configuration-based Events
Synchronous:
Trigger Policy and execute/skip based on exit status
_exit_status == 0 _exit_status == 1 skip CLI command (default) execute CLI command
event [tag event-tag] cli pattern regular-expression {[default] [enter] [questionmark] [tab]} [sync {yes | no skip {yes | no}] [mode variable] [occurs num-occurrences] [period period-value] [maxrun maxruntime-number] Available from: EEM 2.1, integrated with XML PI from EEM 3.0 Cisco Public BRKNMS-2464 2012 Cisco and/or its affiliates. All rights reserved.
47
event manager applet cli-async event cli pattern "switchport trunk allowed vlan remove.*380.*" sync no skip no action 1.0 syslog msg "Removing VLAN 380"
Option c: Ask for confirmation, then allow or prevent the entire command:
event manager applet cli-sync event cli pattern "switchport trunk allowed vlan remove.*380.*" sync yes action 1.0 puts "Confirm removing VLAN 380 [yes|no]:" action 2.0 gets response action 3.0 if $response eq yes goto 5.0 action 4.0 puts "NOK - VLAN 380 will NOT be removed" action 4.1 exit 0 action 5.0 puts "OK - VLAN 380 will be removed" action 5.1 exit 1
Caveat: command may be (much) bigger than what you match! Ranges!
BRKNMS-2464 2012 Cisco and/or its affiliates. All rights reserved. Cisco Public
48
Policy
causing an
BRKNMS-2464
Cisco Public
49
Syslog
email notification
SNMP get
SNMP notification
Reload or switch-over
Application specific
CLI Applets
IOS.sh Policies
TCL Policies
Actions
Event Detectors
Syslog ED SNMP EDs Timer EDs none ED HW EDs Watchdog ED
Interface Counter ED
NetFlow ED
IPSLA Route ED ED
CDP LLDP ED
802.1x ED
MAC ED
BRKNMS-2464
Cisco Public
50
CLI Applets
Part of the Cisco IOS Configuration
Based on CLI Commands Simple Actions Programmatic Applet Extensions
IOS.sh Policies
Separate ASCII File my-policy.sh
Based on Cisco IOS CLI and Shell Commands Effective shell-like simple scripting Registered via the Cisco IOS Config
TCL Policies
Separate ASCII File my-policy.tcl
Based on Cisco IOS CLI and Safe TCL Commands Flexible and powerful scripting capabilities Registered via the Cisco IOS Config
BRKNMS-2464
Cisco Public
51
Event-based Configurations
LLDP
NMS station
BRKNMS-2464
Cisco Public
Radius Server
53
event manager applet dectect-printer event neighbor-discovery interface regexp FastEthernet.* cdp add action 001 regexp ".*LasterJet.*" "$_nd_cdp_platform" action 002 if $_regexp_result eq 1 action 003 cli command "enable" action 004 cli command "config t" action 005 cli command "interface $_nd_local_intf_name" action 006 cli command "switchport access vlan $printer_vlan" action 007 cli command "switchport mode access" action 008 cli command "switchport port-security" action 009 cli command "switchport port-security violation restrict" action 010 cli command "switchport port-security aging time 2" action 011 cli command "switchport port-security aging type inactivity" action 012 cli command "spanning-tree portfast" action 013 cli command "spanning-tree bpduguard enable" action 014 cli command "end" action 015 syslog msg "New printer added: $_nd_cdp_entry_name , type: $_nd_cdp_platform" action 016 end
BRKNMS-2464
Cisco Public
54
On active cluster switches If we are in HSRP Active state && sender is a secondary ASA going to active { For each ASA-facing interface { shut } }
BRKNMS-2464 2012 Cisco and/or its affiliates. All rights reserved. Cisco Public
55
The ed Editor
During Development and Test it would be useful to be able to edit these files directly from IOS. But: IOS does not include an ASCII Editor ...
57
a a add lines and here are yet another two lines . . end adding ,n 1 line one of the test file 2 line two of the test file 3 another line 4 and here are 5 yet another two lines w 99 w write file q router# q quit
58
61
BRKNMS-2464
Cisco Public
62
Solution: Customize the EASy HTTx Package which provides an extensible HTTP Server running on IOS
6 11:02:44.649: %HA_EM-6-LOG: no_easy_httx_start.tcl: Accepting connection from 10.55.14 6 11:02:44.669: %HA_EM-6-LOG: no_easy_httx_start.tcl: "GET flash:/easy/easy-httx_public/ 6 11:02:44.825: %HA_EM-6-LOG: no_easy_httx_start.tcl: Accepting connection from 10.55.14
c1812-easy# c1812-easy#httx-stop
*Jan *Jan *Jan
BRKNMS-2464
6 11:11:31.129: %HA_EM-6-LOG: no_easy_httx_stop.tcl: Stopping the EASy httx server ... 6 11:11:34.017: %HA_EM-6-LOG: no_easy_httx_stop.tcl: ... EASy httx server stopped. 6 11:11:34.073: %SYS-5-CONFIG_I: Configured from console by vty1 Cisco Public 2012 Cisco and/or its affiliates. All rights reserved. 64
To use the Package: 1. Browse and Download HTTx EASy Package www.cisco.com/go/easy
2.
3. 4. 5.
BRKNMS-2464
65
Solution: Cisco EASy provides a simple packaging mechanism and open-source EASy Installer. A developer guide is available online to assist with the creation of EASy packages.
Package Description Pre-Requisite Verification Pre-Installation Config Pre-Installation Exec Environment Variables Configuration Files Post-Requisite Verification Post-Installation Config Post-Installation Exec Uninstall
EASy Installer
+
MyPackage.tar
Router# easy-installer tftp://10.1.1.1/mypackage.tar flash:/easy ----------------------------------------------------------------Configure and Install EASy Package mypackage -1.03' ----------------------------------------------------------------1. Display Package Description 2. Configure Package Parameters 3. Deploy Package Policies 4. Exit Enter option: 2
67
Provides packaged solutions built with EEM and related technologies available for free download
15 EASy solutions available now covering 5 categories, including network management, high availability, security, diagnostics and config automation and growing
www.cisco.com/go/easy
ask-easy@cisco.com
BRKNMS-2464
Cisco Public
68
2. 3.
4.
5.
6.
7.
BRKNMS-2464
Cisco Public
69
In Summary
Recap
1 2 3 4 5 6 7 8 9 10 11 Command Line Interface I Basics Command Line Interface II More Basics Automated Staging I Auto Install Automated Staging II Cisco Integrated Customization Service (CICS) Automated Remote Deployment Zero-Touch Deployment Automated Branch/Campus Deployment Smart Install Custom Scripting IOS.sh and Tcl Scripting Configuration-based Events Embedded Event Manager (EEM) I Event-based Configurations Embedded Event Manager (EEM) II Editing Files on IOS The ed Editor Custom Menus on the CLI Embedded Menu Manager (EMM)
12
13
71
References
References Instrumentation
Device Manageability Instrumentation (DMI) www.cisco.com/go/instrumentation
Embedded Event Manager (EEM): www.cisco.com/go/eem Cisco Beyond EEM Community: www.cisco.com/go/ciscobeyond Embedded Menu Manager (EMM): http://tinyurl.com/emm-in-124t Embedded Packet Capture (EPC): www.cisco.com/go/epc Flexible NetFlow: www.cisco.com/go/netflow and www.cisco.com/go/fnf GOLD: http://www.cisco.com/en/US/products/ps7081/products_ios_protocol_group_home.html IPSLA (formerly SAA, formerly RTR): www.cisco.com/go/ipsla Network Analysis Module: http://www.cisco.com/go/nam Network Based Application Recognition (NBAR): www.cisco.com/go/nbar Security Device Manager (SDM): http://www.cisco.com/go/sdm Smart Call Home: www.cisco.com/go/smartcall Web Services Management Agents (WSMA): http://tinyurl.com/wsma-in-150M Cisco Configuration Engine (CCE): www.cisco.com/go/ciscoce
73
Session ID
BRKNMS-2006 BRKNMS-2841 BRKNMS-2464 BRKNMS-3134 BRKNMS-2005 BRKNMS-2009 BRKNMS-3133 BRKNMS-2465 BRKNMS-2847 BRKNMS-2466 BRKNMS-2842 BRKNMS-2943 BRKNMS-3135 BRKNMS-2031 BRKNMS-2846 BRKNMS-2659 BRKNMS-2844 BRKNMS-3999 BRKNMS-2845
Title
Manage and Optimize IT Energy Usage with Cisco EnergyWise Enterprise Network Device Administration with TACACS+ 13 Smart Automations to Configure Your Cisco IOS Network Advanced NetFlow DataCenter & Virtualization Management Overview Simplify the Deployment of Cisco Platforms and Technologies Advanced - Using the UCS XML API 13 Smart Automations to Monitor Your Cisco IOS Network Ethernet OAM - Technical Overview and Deployment Scenarios 13 Smart Automations to Troubleshoot Your Cisco IOS Network Managing Network Performance in WAAS Environments Smart Services for Business Video - Turning Vision into Reality Advanced - Application Visibility and Performance in Cisco devices with Network Based Application Recognition (NBAR) SYSLOG Design, Methodology and Best Practices Paket Transport and its Management Cloud Automation A walkthrough over Service Management Using a Network Hypervisor to Automatically Create End to End Topologies Network Containers in a Multi-Tenant Data Center Best Network Mgmt Practice in Cisco Device Instrumentation: what (not) to do?
Day
Tuesday Tuesday Tuesday Tuesday Wednesday Wednesday Wednesday Wednesday Wednesday Wednesday Wednesday Thursday Thursday Thursday Thursday Friday Friday Friday Friday
Start Time
2012-01-31 11:15:00 2012-01-31 11:15:00 2012-01-31 15:45:00 2012-01-31 15:45:00 2012-02-01 09:00:00 2012-02-01 09:00:00 2012-02-01 09:00:00 2012-02-01 13:30:00 2012-02-01 13:30:00 2012-02-01 16:00:00 2012-02-01 16:00:00 2012-02-02 09:00:00 2012-02-02 09:00:00 2012-02-02 16:00:00 2012-02-02 16:00:00 2012-02-03 09:00:00 2012-02-03 09:00:00 2012-02-03 09:00:00 2012-02-03 11:00:00
BRKNMS-2464
Cisco Public
74
Session
Title
Format
BRKCRS-2437 Incorporating Intelligent Access at the Campus Edge BRKIPM-2090 Implementing Network Automations BRKNMS-2464 13 Smart Automations to Configure Your Cisco IOS Network BRKNMS-2465 13 Smart Automations to Monitor Your Cisco IOS Network BRKNMS-2466 13 Smart Automations to Troubleshoot Your Cisco IOS Network LABNMS-1262 Implementing Network Automation Module 0 - Basics LABNMS-1263 Implementing Network Automation Module 1- Planning LABNMS-1264 Implementing Network Automation Module 2 - Deployment LABNMS-1265 Implementing Network Automation Module 3 - Monitoring LABNMS-1266 Implementing Network Automation Module 4 - Troubleshooting LABNMS-1422 Network Automation Solutions using Cisco IOS EEM TECNMS-3601 Advanced Network Automation BRKCDN-1114 Building Innovative Solutions with IOS Embedded Automation
BRKNMS-2464 2012 Cisco and/or its affiliates. All rights reserved.
Technical Breakout Technical Breakout Technical Breakout Technical Breakout Technical Breakout Lab: Walk in Lab: Walk in Lab: Walk in Lab: Walk in Lab: Walk in Lab: Walk in Technical Seminar Technical Breakout
Cisco Public
LABNMS-2001 Advanced Network Automation and Solutions using Cisco IOS EEM Lab: Instructor Led
75
2. 3.
4.
BRKNMS-2464 2012 Cisco and/or its affiliates. All rights reserved. Cisco Public
Enjoy !
76
2. 3.
4.
5.
6.
7.
BRKNMS-2464
Cisco Public
77
Discussion forums
Ask questions, get answers
Video tutorials
Coming soon!
http://www.cisco.com/go/ciscobeyond
BRKNMS-2464 2012 Cisco and/or its affiliates. All rights reserved. Cisco Public
78
Recommended Reading
Conclusion
Network Automation
is a Paradigm Change offers opportunities far beyond OPEX savings is EASy to adopt now
80
http://m.cisco.com/mat/cleu12/
BRKNMS-2464 2012 Cisco and/or its affiliates. All rights reserved. Cisco Public
81
BRKNMS-2464
Cisco Public
82
Thank you.
BRKNMS-2464
Cisco Public
83