26
© 2013 Cisco and/or its affiliates. All rights reserved. 1 Cisco NX-OS Command Line Introduction Presented by: Li-Ji Hong (洪李吉) IT Learning Solution (ITLS), Fast Lane Group GmbH. May 28 th , 2015

Cisco NX-OS Command Line Introductionicon.clnchina.com.cn/pdf/Cisco_NX_OS_Command_Line_Introduction.pdf · 介绍Cisco NX-OS操作系统和Nexus ... hines.\爀一攀砀甀猀 ㈀欀

Embed Size (px)

Citation preview

Page 1: Cisco NX-OS Command Line Introductionicon.clnchina.com.cn/pdf/Cisco_NX_OS_Command_Line_Introduction.pdf · 介绍Cisco NX-OS操作系统和Nexus ... hines.\爀一攀砀甀猀 ㈀欀

© 2013 Cisco and/or its affiliates. All rights reserved. 1

Cisco NX-OS Command Line Introduction

Presented by:Li-Ji Hong (洪李吉)IT Learning Solution (ITLS), Fast Lane Group GmbH.May 28th, 2015

Page 2: Cisco NX-OS Command Line Introductionicon.clnchina.com.cn/pdf/Cisco_NX_OS_Command_Line_Introduction.pdf · 介绍Cisco NX-OS操作系统和Nexus ... hines.\爀一攀砀甀猀 ㈀欀

© 2015 Cisco and/or its affiliates. All rights reserved. 2

介绍Cisco NX-OS操作系统和Nexus系列交换机的功能特性和配置方式,及各种二层功能特性(包括VLAN、PVLAN、vPC、SPT和FabricPath)、三层功能特性(包括EIGRP、OSPF、IS-IS、BGP以及FHRP)、IP多播、安全性、高可用性、内嵌式维护功能特性、统一交换矩阵、QoS、OTV、MPLS、LISP等各种传统技术与大量新兴技术。

讲座内容包含:

• Introduction to the Cisco NX-OS Command-Line Interface (CLI)• Cisco NX-OS Command Line Demonstration• Cisco NX-OS Command-Line Prompts Overview• Cisco NX-OS Initial Setup and Configuration• Cisco NX-OS Introduction Questions and Answers/Further Demonstrations

演示者
演示文稿备注
This is the agenda for the presentation.
Page 3: Cisco NX-OS Command Line Introductionicon.clnchina.com.cn/pdf/Cisco_NX_OS_Command_Line_Introduction.pdf · 介绍Cisco NX-OS操作系统和Nexus ... hines.\爀一攀砀甀猀 ㈀欀

© 2015 Cisco and/or its affiliates. All rights reserved. 3

Access-Aggregation Aggregation/Core

Nexus 5010

Nexus 7010

Nexus 5020

Nexus 2248

Nexus 7018

Nexus 1000V

Nexus 4000

Nexus 2232

NX-OS

Nexus 1010

Compute

Nexus 5548

Nexus 2224

演示者
演示文稿备注
Here is just a glimpse of some of Cisco nexus datacenter family products. We have Nexus 1000v virtual switch for Virtual Machines. Nexus 2k Fabric Extenders Nexus 4k, Nexus 5k, Nexus 7k Not shown here we also Nexus 3k and the new Nexus 6k datacenter switches.
Page 4: Cisco NX-OS Command Line Introductionicon.clnchina.com.cn/pdf/Cisco_NX_OS_Command_Line_Introduction.pdf · 介绍Cisco NX-OS操作系统和Nexus ... hines.\爀一攀砀甀猀 ㈀欀

© 2013 Cisco and/or its affiliates. All rights reserved. 4

Cisco NX-OS命令行界面(CLI)简介

演示者
演示文稿备注
--- Moving on to the UCS Unified Computing System platform
Page 5: Cisco NX-OS Command Line Introductionicon.clnchina.com.cn/pdf/Cisco_NX_OS_Command_Line_Introduction.pdf · 介绍Cisco NX-OS操作系统和Nexus ... hines.\爀一攀砀甀猀 ㈀欀

© 2015 Cisco and/or its affiliates. All rights reserved. 5

• 使用 consoleHyperTerminalTeraTerminal使用COM埠

2 RJ45 connectors.This port that this cable is in is labeled CONSOLE

A ‘console’ cable is also known as a rollover cable. It can have a DB9-RJ45 or RJ45-RJ45 configuration.

Page 6: Cisco NX-OS Command Line Introductionicon.clnchina.com.cn/pdf/Cisco_NX_OS_Command_Line_Introduction.pdf · 介绍Cisco NX-OS操作系统和Nexus ... hines.\爀一攀砀甀猀 ㈀欀

© 2015 Cisco and/or its affiliates. All rights reserved. 6

‘Rollover’ cable. DB9 to RJ45 cable.

Page 7: Cisco NX-OS Command Line Introductionicon.clnchina.com.cn/pdf/Cisco_NX_OS_Command_Line_Introduction.pdf · 介绍Cisco NX-OS操作系统和Nexus ... hines.\爀一攀砀甀猀 ㈀欀

© 2015 Cisco and/or its affiliates. All rights reserved. 7

Page 8: Cisco NX-OS Command Line Introductionicon.clnchina.com.cn/pdf/Cisco_NX_OS_Command_Line_Introduction.pdf · 介绍Cisco NX-OS操作系统和Nexus ... hines.\爀一攀砀甀猀 ㈀欀

© 2015 Cisco and/or its affiliates. All rights reserved. 8

User issues reverse telnet command to IP address on the terminal server. The reverse telnet command includes the serial port that is cabled to the Nexus device. The telnet session is terminated at the terminal server. The user data is converted to serial and sent across the rollover cable to Console port and vice versa.

telnet 10.1.1.1 2001 where the serial port 1 is attached to the Nexus

Ethernet port on the comm server

RJ45-RJ45 rollover cable from comm server to Console port

Page 9: Cisco NX-OS Command Line Introductionicon.clnchina.com.cn/pdf/Cisco_NX_OS_Command_Line_Introduction.pdf · 介绍Cisco NX-OS操作系统和Nexus ... hines.\爀一攀砀甀猀 ㈀欀

© 2015 Cisco and/or its affiliates. All rights reserved. 9

• 初始配置

• 管理口障碍:

• 映像档问题

• 密码还原

• AAA配置问题

• 监看boot up画面

Page 10: Cisco NX-OS Command Line Introductionicon.clnchina.com.cn/pdf/Cisco_NX_OS_Command_Line_Introduction.pdf · 介绍Cisco NX-OS操作系统和Nexus ... hines.\爀一攀砀甀猀 ㈀欀

© 2015 Cisco and/or its affiliates. All rights reserved. 10

• Telnet

• SSH

• Login required (for scripting SSH can be utilized with certificates to provide access without the need for a password to be entered)

• AAA (authentication/authorization/accounting) availableTACACS+, Radius, and LDAP (MS Active Directory) can be used to authenticate user login. The Nexus will prompt the user for a password, and then verify with the AAA server if the password is valid. The AAA server can also tell the Nexus what role the user is assigned.

• RBAC (role based access control) used by default.RBAC is means to control what commands can be entered by the user. There are some default roles like network-operator and network-admin. You can design custom roles where you can permit or deny specific commands. Every user that logs in is assigned a role. The default role is network-operator.

• IOS like ‘privilege level’ command authorization can be configured

Page 11: Cisco NX-OS Command Line Introductionicon.clnchina.com.cn/pdf/Cisco_NX_OS_Command_Line_Introduction.pdf · 介绍Cisco NX-OS操作系统和Nexus ... hines.\爀一攀砀甀猀 ㈀欀

© 2015 Cisco and/or its affiliates. All rights reserved. 11

• 求助(?)

• Up arrow 带回之前执行过的命令

• Ctrl-A 移到最开头

• Ctrl-E 移到最后面

• Pipe “|” 筛选输出

• “>": redirect the display output to a file

• ">>": redirect display output to a file in append mode

• “diff”: show items that have changed between command iterations.

• TAB 自动完成

Page 12: Cisco NX-OS Command Line Introductionicon.clnchina.com.cn/pdf/Cisco_NX_OS_Command_Line_Introduction.pdf · 介绍Cisco NX-OS操作系统和Nexus ... hines.\爀一攀砀甀猀 ㈀欀

© 2015 Cisco and/or its affiliates. All rights reserved. 12

• ‘terminal length xx’终端机画面行数

• ‘terminal session-timeout xx’调整(延长)自动注销的时间

• ‘show cli history’列出执行过的最近命令历史

• ‘copy’搬动Nexus档案

Page 13: Cisco NX-OS Command Line Introductionicon.clnchina.com.cn/pdf/Cisco_NX_OS_Command_Line_Introduction.pdf · 介绍Cisco NX-OS操作系统和Nexus ... hines.\爀一攀砀甀猀 ㈀欀

© 2013 Cisco and/or its affiliates. All rights reserved. 13

Cisco NX-OS命令行界面演示

Page 14: Cisco NX-OS Command Line Introductionicon.clnchina.com.cn/pdf/Cisco_NX_OS_Command_Line_Introduction.pdf · 介绍Cisco NX-OS操作系统和Nexus ... hines.\爀一攀砀甀猀 ㈀欀

© 2013 Cisco and/or its affiliates. All rights reserved. 14

Cisco NX-OS命令提示简介

Page 15: Cisco NX-OS Command Line Introductionicon.clnchina.com.cn/pdf/Cisco_NX_OS_Command_Line_Introduction.pdf · 介绍Cisco NX-OS操作系统和Nexus ... hines.\爀一攀砀甀猀 ㈀欀

© 2015 Cisco and/or its affiliates. All rights reserved. 15

• 一般登入, exec prompt, 请注意 "#"

• 配置模式

• 口的配置模式

TIP: Use the where command and hit enter to have the system remind you which interface you are configuring.

Page 16: Cisco NX-OS Command Line Introductionicon.clnchina.com.cn/pdf/Cisco_NX_OS_Command_Line_Introduction.pdf · 介绍Cisco NX-OS操作系统和Nexus ... hines.\爀一攀砀甀猀 ㈀欀

© 2015 Cisco and/or its affiliates. All rights reserved. 16

• Loader? What is the loader prompt? When would I see the loader prompt?Nexus units load 2 images upon power up or a reload. These images are statically assigned. The Nexus unit will not attempt to load an image unless is it statically configured to do so. If the configured image is not present, or corrupted, the system will land at the loader prompt.

You will only see this when attaching via the Console, and never on the management port. You have several options for recovery.If there are compatible kickstart and main images loaded onto bootflash: you can issued 1 command to load both and get the unit operational. You can use the ‘dir’ command to see what files are on bootflash:

loader> boot kickstart-image-name main-image-name

Page 17: Cisco NX-OS Command Line Introductionicon.clnchina.com.cn/pdf/Cisco_NX_OS_Command_Line_Introduction.pdf · 介绍Cisco NX-OS操作系统和Nexus ... hines.\爀一攀砀甀猀 ㈀欀

© 2015 Cisco and/or its affiliates. All rights reserved. 17

• The nexus boot process consists of loading the kickstart image, and then the main NX-OS image. If for some reason the main image is not on the bootflash: or is corrupted, and the system is unable to load the main image, it will stop at the switch(boot) prompt.

• At this point, the kickstart image has been successfully loaded, but not the main image. You can use the dir command to view the files on bootflash: and issue the load command to load the main image if it exits. If it is not on bootflash, you can enter configuration mode and put an IP address on the management interface and copy an the image onto bootflash:

• This is the prompt where the admin user password recovery takes place.

switch(boot)# load main-image-name TIP: Remember the saying “BOOT AT LOAD, AND LOAD AT BOOT” to help remember when you issue load command versus when you issue boot command to get the system up and functional

Page 18: Cisco NX-OS Command Line Introductionicon.clnchina.com.cn/pdf/Cisco_NX_OS_Command_Line_Introduction.pdf · 介绍Cisco NX-OS操作系统和Nexus ... hines.\爀一攀砀甀猀 ㈀欀

© 2013 Cisco and/or its affiliates. All rights reserved. 18

Cisco NX-OS初始设置和配置

Page 19: Cisco NX-OS Command Line Introductionicon.clnchina.com.cn/pdf/Cisco_NX_OS_Command_Line_Introduction.pdf · 介绍Cisco NX-OS操作系统和Nexus ... hines.\爀一攀砀甀猀 ㈀欀

© 2015 Cisco and/or its affiliates. All rights reserved. 19

• Before the management interface (Ethernet management port) can be used, some basic configuration must be completed using the Console port.

• The admin user password must be set. Until this is completed, access via the management port will not work.

First you must configure the unit for the desired password strength that you desire.

Second you must key in the admin user password 2 times. The password is not displayed

Once the admin password is set, you can elect to continue with the setup script, or terminate the script.

Page 20: Cisco NX-OS Command Line Introductionicon.clnchina.com.cn/pdf/Cisco_NX_OS_Command_Line_Introduction.pdf · 介绍Cisco NX-OS操作系统和Nexus ... hines.\爀一攀砀甀猀 ㈀欀

© 2015 Cisco and/or its affiliates. All rights reserved. 20

Here we see what the script will prompt you to enter. In the [ ] you will see the default entry for the prompt. Hitting enter will result in this being your response.

When you complete all prompts, the script will show you the entries it will make into the running-configuration and give a change to make changes.

If you are okay with the presented values, you can save the configuration and make it active.

At this point, SSH can be used to login for the admin user account.

Page 21: Cisco NX-OS Command Line Introductionicon.clnchina.com.cn/pdf/Cisco_NX_OS_Command_Line_Introduction.pdf · 介绍Cisco NX-OS操作系统和Nexus ... hines.\爀一攀砀甀猀 ㈀欀

© 2015 Cisco and/or its affiliates. All rights reserved. 21

• The kickstart and main NX-OS images should be on the bootflash: before starting the install.

• The ‘install all’ command will verify the files, extract the binaries, and then prompt you with the result of the install all verification process. You need to check if the install is non-disruptive and if desired, continue with the upgrade process.

Page 22: Cisco NX-OS Command Line Introductionicon.clnchina.com.cn/pdf/Cisco_NX_OS_Command_Line_Introduction.pdf · 介绍Cisco NX-OS操作系统和Nexus ... hines.\爀一攀砀甀猀 ㈀欀

© 2015 Cisco and/or its affiliates. All rights reserved. 22

• Nexus 3000, 4000, and 5000 all have a single supervisor incorporated into the chassis, so there is no concept of the standby-supervisor.

• Nexus 7000, and MDS modular chassis (9506, 9509, and 9513) have 2 supervisor for enhanced reliability. Only 1 supervisor is ever active at any one time.

Active supervisor

Standby supervisor

Both supervisors share the same IP address for the management interface. Only the active supervisor is active with this address

The Console connection is active on both supervisors, and the user can use this connection to access the standby supervisor.

Page 23: Cisco NX-OS Command Line Introductionicon.clnchina.com.cn/pdf/Cisco_NX_OS_Command_Line_Introduction.pdf · 介绍Cisco NX-OS操作系统和Nexus ... hines.\爀一攀砀甀猀 ㈀欀

© 2015 Cisco and/or its affiliates. All rights reserved. 23

• Does your role have the authority to issue the command? You may need to have the administrator add you to a role with more authority, or update your current role to add permissions for certain features and commands.

• Is the feature enabled?

• If the feature is not enabled the

relevant commands will not work.

Page 24: Cisco NX-OS Command Line Introductionicon.clnchina.com.cn/pdf/Cisco_NX_OS_Command_Line_Introduction.pdf · 介绍Cisco NX-OS操作系统和Nexus ... hines.\爀一攀砀甀猀 ㈀欀

© 2015 Cisco and/or its affiliates. All rights reserved. 24

• Nexus systems, like IOS systems, have a startup-configuration and a running-configuration. Most configuration command are make to the running configuration, and are not saved to the startup-configuration. While making changed, save your changes often.

• IOS used the ‘write memory’ command as well as the ‘copy run start’. NX-OS only supports the ‘copy run start’ which is short for ‘copy running-config startup-config’ command. Depending on the version of NX-OS in use, you can abbreviate it to ‘cop r s’.

• NX-OS support configuration of alias and variables to help ease CLI usage. You may also run scripts from the CLI. http://www.cisco.com/en/US/docs/switches/datacenter/nexus5000/sw/configuration/guide/cli_rel_4_0_1a/begin.html

There is also an option to run a script at a pre-determined time, or on a regular schedule. This is not available on all Nexus platforms. The feature is called ‘scheduler’ and must be enabled.

Page 25: Cisco NX-OS Command Line Introductionicon.clnchina.com.cn/pdf/Cisco_NX_OS_Command_Line_Introduction.pdf · 介绍Cisco NX-OS操作系统和Nexus ... hines.\爀一攀砀甀猀 ㈀欀

© 2013 Cisco and/or its affiliates. All rights reserved. 25

问题解答

Page 26: Cisco NX-OS Command Line Introductionicon.clnchina.com.cn/pdf/Cisco_NX_OS_Command_Line_Introduction.pdf · 介绍Cisco NX-OS操作系统和Nexus ... hines.\爀一攀砀甀猀 ㈀欀

Thank you.Thank you.