在 Linux 上运行 Cisco Nexus 9000v(NX-OS 10)

在 VMware Workstation for Linux 中部署 Cisco Nexus 9000v(NX-OS 10)

Posted by sysin on 2021-09-30
Estimated Reading Time 6 Minutes
Words 1.3k In Total
Viewed Times

点击访问腾讯云官方网站


请访问原文链接:在 Linux 上运行 Cisco Nexus 9000v(NX-OS 10),查看最新版。原创作品,转载请保留出处。

作者:gc(at)sysin.org,主页:www.sysin.org

本文使用的软件及下载地址:

下载和部署 OVF

本站下载链接如上所述,或者去 Cisco 软件下载 页面,搜索 “Nexus 9000v”,登录 Cisco 账号,开始下载,该软件不需要服务合同,可以使用一般账号下载。

VMware Workstation “Open a Virtual Machine”,导入 ova 文件,默认导入到用户主目录下的 vmware 文件夹下。

按照默认配置即可,导入后如下。

img

配置串口

添加串口

编辑虚机设置,出现 “设置” 页面如下,点击 “Add…”

img

选择 “串行端口”,点击 “Finish”

img

回到 “设置” 页面,编辑串口属性如下:

Use socket (named pipe),名称没有固定要求,本例使用 /tmp/serial0,连接串口需要使用该名称。

From:Server To:An Application(必须)

img

编辑 vmx

打开虚拟机目录,默认为用户主目录下的 vmware 文件夹下即 ~/vmware,找到 nexus9500v64.10.1.2,用文本编辑器打开 nexus9300v.10.1.2.vmx,将 serial0.fileType = "file" 修改为 serial0.fileType = "pipe"

连接串口

(1)安装 socat:

1
2
3
4
# for Debian、Ubuntu
sudo apt install socat
# for Redhat、CentOS
yum install socat

socat - Multipurpose relay
socat 是 Unix 下的一个多功能的网络工具,名字来由是 “Socket CAT”。其功能与有瑞士军刀之称的 Netcat 类似,可以看做是 Netcat 的加强版。
Socat 的主要特点就是在两个数据流之间建立通道,且支持众多协议和链接方式。如 IP、TCP、UDP、IPv6、PIPE、EXEC、System、Open、Proxy、Openssl、Socket 等。

(2)开启虚机,出现了启动画面(截图略):

(3)连接串口 serial0:

1
socat -d -d unix-connect:/tmp/serial0 stdio

-d 参数最多可以用 4 个,表示输出的信息级别越多,参看 man socat
unix-connect: 后面跟串口文件的实际路径,比如:$HOME/vmware/serial0
stdio = stdin,客户端只进行标准输入

(4)画面出现大量字符:

img

(5)按回车键可以看到如下提示:

1
- Abort Power On Auto Provisioning [yes - continue with normal setup, skip - bypass password and basic configuration, no - continue with Power On Auto Provisioning] (yes/skip/no)[no]:

输入 yes 停止 POAP(Cisco NX-OS PowerOn Auto Provisioning)

(6)出现初始化配置界面:

1
2
3
4
5
6
         ---- System Admin Account Setup ----


Do you want to enforce secure password standard (yes/no) [y]: 直接按回车,启用安全密码
Enter the password for "admin": 为 admin 设置密码,这里是明文显示的
Confirm the password for "admin": 确认密码

确认后:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
         ---- Basic System Configuration Dialog VDC: 1 ----

This setup utility will guide you through the basic configuration of
the system. Setup configures only enough connectivity for management
of the system.

Please register Cisco Nexus9000 Family devices promptly with your
supplier. Failure to register may affect response times for initial
service calls. Nexus9000 devices must be registered to receive
entitled support services.

Press Enter at anytime to skip a dialog. Use ctrl-c at anytime
to skip the remaining dialogs.

Would you like to enter the basic configuration dialog (yes/no): 这里直接输入 no 终止

(7)此时出现登录界面:

1
2
3
4
User Access Verification
login: admin
admin
Password:

登录后

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Cisco NX-OS Software
Copyright (c) 2002-2021, Cisco Systems, Inc. All rights reserved.
Nexus 9000v software ("Nexus 9000v Software") and related documentation,
files or other reference materials ("Documentation") are
the proprietary property and confidential information of Cisco
Systems, Inc. ("Cisco") and are protected, without limitation,
pursuant to United States and International copyright and trademark
laws in the applicable jurisdiction which provide civil and criminal
penalties for copying or distribution without Cisco's authorization.

Any use or disclosure, in whole or in part, of the Nexus 9000v Software
or Documentation to any third party for any purposes is expressly
prohibited except as otherwise authorized by Cisco in writing.
The copyrights to certain works contained herein are owned by other
third parties and are used and distributed under license. Some parts
of this software may be covered under the GNU Public License or the
GNU Lesser General Public License. A copy of each such license is
available at
http://www.gnu.org/licenses/gpl.html and
http://www.gnu.org/licenses/lgpl.html
***************************************************************************
* Nexus 9000v is strictly limited to use for evaluation, demonstration *
* and NX-OS education. Any use or disclosure, in whole or in part of *
* the Nexus 9000v Software or Documentation to any third party for any *
* purposes is expressly prohibited except as otherwise authorized by *
* Cisco in writing. *
***************************************************************************
switch#

必要配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
## 配置管理 IP
switch# conf t
Enter configuration commands, one per line. End with CNTL/Z.
switch(config)# interface mgmt0
switch(config-if)# ip address 10.0.2.15/24
# <--- NOTE: can use "ip address dhcp" here instead
switch(config-if)# no shut
switch(config-if)# end
# 此时可以通过 ssh 访问管理口,默认 ssh 服务开启。

# 配置管理口路由
switch(config)#vrf context management
switch(config-vrf)# ip route 0.0.0.0/0 10.0.2.1

## 配置引导镜像
switch# conf t
Enter configuration commands, one per line. End with CNTL/Z.
switch(config)# boot nxos bootflash:nxos.10.1.2.bin
# 或者直接 boot nxos nxos.10.1.2.bin
# <--- Note: use correct imagename from "dir" command output
switch(config)# copy r s
[########################################] 100%
Copy complete.
switch(config)#
# 运行 show boot 命令确认
switch(config)# show boot
show boot
Current Boot Variables:
sup-1
NXOS variable = bootflash:/nxos.10.1.2.bin
Boot POAP Disabled

Boot Variables on next reload:
sup-1
NXOS variable not set
Boot POAP Disabled
switch#

## 添加一个用户(可选)
switch(config)# username sysin password vagrant role network-admin
switch(config)# username sysin shell bash
switch(config)# copy r s

下一步

以后可以直接使用 SSH 访问,串口可用于 SSH 无法访问时候问题排查。

请访问官方文档,开启你的 Nexus 之旅:

Cisco Nexus 9000 Series Switches Configuration Guides


捐助本站 ❤️ Donate


如果文章中使用的内容或图片侵犯了您的版权,请联系作者删除。如果您喜欢这篇文章或者觉得它对您有所帮助,欢迎您发表评论,也欢迎您分享这个网站,或者赞赏一下作者,谢谢!


支付宝打赏 微信打赏

赞赏一下



1000000