中兴交换机基础操作


一、配置本地用户认证

全局配置模式下,进入系统用户配置视图
system-user
创建用户,配置用户名为test用户
user-name test
配置用户密码为test
password test
绑定认证模板
bind authentication-template 1
绑定授权模板
bind authorization-template 1
exit

退出到用户配置视图,配置认证模板
authentication-template 1
绑定AAA认证模板
bind aaa-authentication-template 2001
exit
退出到用户配置视图,配置授权模板
authorization-template 1
配置绑定AAA授权模板
bind aaa-authorization-template 2001
配置授权权限为15级
local-privilege-level 15
退出到全局模式下,进入配置AAA认证模板
aaa-authentication-template 2001
配置认证方式为local
aaa-authentication-type local
退出到全局模式下,进入配置AAA授权模板
aaa-authorization-template 2001
配置授权方式为none
aaa-authorization-type none
退出到全局配置模式下,配置enable密码
enable secret level 15 testpassword
配置示例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
ZTE#config terminal     
ZTE(config)#system-user
ZTE(config-system-user)#user-name test
ZTE(config-system-user-username)#password test
ZTE(config-system-user-username)#bind authentication-template 1
ZTE(config-system-user-username)#bind authorization-template 1
ZTE(config-system-user-username)#exit
ZTE(config-system-user)#authentication-template 1
ZTE(config-system-user-authen-temp)#bind aaa-authentication-template 2001
ZTE(config-system-user-authen-temp)#exit
ZTE(config-system-user)#authorization-template 1
ZTE(config-system-user-author-temp)#bind aaa-authorization-template 2001
ZTE(config-system-user-author-temp)#local-privilege-level 15
ZTE(config-system-user-author-temp)#exit
ZTE(config-system-user)#exit
ZTE(config)#aaa-authentication-template 2001
ZTE(config-aaa-authen-template)#aaa-authentication-type local
ZTE(config-aaa-authen-template)#exit
ZTE(config)#aaa-authorization-template 2001
ZTE(config-aaa-author-template)#aaa-authorization-type none
ZTE(config-aaa-author-template)#exit
ZTE(config)#enable secret level 15 testpassword

二、配置VLAN

全局配置模式下,进入vlan配置视图
switchvlan-configuration
创建vlan10
Vlan 10
为vlan10命名,即添加描述
name Bangong
配置示例:

1
2
3
4
5
6
ZTE(config)#switchvlan-configuration     
ZTE(config-swvlan)#vlan 10
ZTE(config-swvlan-sub-10)#name banggong
ZTE(config-swvlan-sub-10)#exit
ZTE(config-swvlan)#exit
ZTE(config)#

三、端口加入VLAN

配置ACCESS类型端口
全局模式下,进入switchvlan配置模式
switchvlan-configuration
进入gei-0/1/1/1
interface gei-0/1/1/1
配置端口模式为access模式
switchport mode access
配置端口所属vlan
switchport access vlan 10
配置示例:

1
2
3
4
5
6
7
8
ZTE(config)#    
ZTE(config)#switchvlan-configuration
ZTE(config-swvlan)#interface gei-0/1/1/1
ZTE(config-swvlan-if-gei-0/1/1/11)#switchport mode access
ZTE(config-swvlan-if-gei-0/1/1/11)#switchport access vlan 10
ZTE(config-swvlan-if-gei-0/1/1/11)#exit
ZTE(config-swvlan)#exit
ZTE(config)#

配置Trunk端口(Trunk端口用于交换机和交换机直接互联)
进入gei-0/1/1/28
interface gei-0/1/1/28
配置端口模式为trunk模式
switchport mode trunk
配置端口允许vlan通过10 20
switchport trunk vlan 10,20
配置示例:

1
2
3
4
5
6
7
8
ZTE(config)#    
ZTE(config)#switchvlan-configuration
ZTE(config-swvlan)#interface gei-0/1/1/28
ZTE(config-swvlan-if-gei-0/1/1/28)#switchport mode trunk
ZTE(config-swvlan-if-gei-0/1/1/28)#switchport trunk vlan 10,20
ZTE(config-swvlan-if-gei-0/1/1/28)#exit
ZTE(config-swvlan)#exit
ZTE(config)#

四、配置接口 VLAN IP

全局模式下进入vlanif接口配置模式
进入vlan10 三层接口
interface vlan10
配置IP地址 192.168.1.1 掩码255.255.255.0
ip address 192.168.1.1 255.255.255.0
配置示例:

1
2
3
4
ZTE(config)#interface vlan10    
ZTE(config-if-vlan10)#ip address 192.168.1.1 255.255.255.0
ZTE(config-if-vlan10)#exit
ZTE(config)#

五、配置静态默认路由

全局配置模式下,配置默认路由的下一跳为192.168.1.2
ip route 0.0.0.0 0.0.0.0 192.168.1.2
静态路由配置和默认路由配置命令一样,命令中前0.0.0.0 代表网络号,后面一个0.0.0.0代表掩码。这8个0则能代表所有网段。代码一个24未掩码的网段表示:192.168.2.0 255.255.255.0
配置静态路由:
ip route 192.168.2.0 255.255.255.0 192.168.1.2

六、配置生成树选项

生成树配置需要结合当地网络进行配置,要所有运行在一个拓扑能开启生成树功能的交换机,生成树配置一样。
中兴交换机在目前的网络环境中主要作为三层设备,不建议开启生成树。
全局模式下进入生成树配置
spantree
开启生成树功能
enable
配置生成树模式mstp
mode mstp
配置多实例域名test
mst name test
配置实例1包含vlan10,20
mst vlans 10,20 instance 1
配置示例:

1
2
3
4
5
6
7
ZTE(config)#spantree     
ZTE(config-stp)#enable
ZTE(config-stp)#mode mstp
ZTE(config-stp)#mst name test
ZTE(config-stp)#mst vlans 10,20 instance 1
ZTE(config-stp)#exit
ZTE(config)#

七、配置ACL访问控制策略

进入acl配置模式
数字可配置2000-2999,基础ACL配置,供电网络中采用基础acl#
配置一条允许24.50.0.67主机
rule 0 permit source 24.50.0.67 0.0.0.0
配置一条允许23.50.6.0网段
rule 5 permit source 23.50.6.0 0.0.0.255
剩余的全部禁止
rule 10 deny
配置acl注意匹配规则是从上往下匹配,比如rule10 deny已经拒绝了除0,5匹配到的,剩余的都是禁止。这时候rule 15 permit source 23.50.7.0 0.0.0.255,则该策略不生效,23.50.7.0网段还是被全部禁止。
配置示例:

1
2
3
4
5
6
7
ZTE#configure terminal     
ZTE(config)#ipv4-access-list 2000
ZTE(config-ipv4-acl)# rule 0 permit source 24.50.0.67 0.0.0.0
ZTE(config-ipv4-acl)# rule 5 permit source 23.50.6.0 0.0.0.255
ZTE(config-ipv4-acl)# rule 10 deny
ZTE(config-ipv4-acl)# exit
ZTE(config)#

八、配置SSH远程登陆

全局开启ssh服务
ssh server enable
配置ssh服务应用ACL访问控制策略2000
ssh server access-class ipv4 2000
配置示例:

1
2
ZTE(config)#ssh server enable    
ZTE(config)#ssh server access-class ipv4 2000

九、配置时钟同步和时区

用户模式下配置时区为北京时区(加8小时)
ZTE(config)#clock timezone beijin 8
全局模式下配置时钟服务器10.109.192.5为第一个时钟服务器
(config)#ntp server 10.109.192.5 priority 5
全局模式下配置时钟服务器10.109.192.43为备用时钟服务器
(config)#ntp server 10.109.192.43 priority 4

十、备份和还原IOS

在交换机全局模式下通过tftp备份iso固件到23.50.6.99服务器,中兴交换机固件名为HMPU.set
格式:copy tftp root:文件名 //服务器IP/文件名
copy tftp root: /flash/HMPU.set //23.50.6.99/HMPU.set
在交换机下全局模式下通过tftp服务器还原IOS到交换机中
格式:tftp 服务器IP get 远程文件名 [本地文件名]
copy tftp //23.50.6.99/HMPU.set root: HMPU2.set
配置示例:

1
2
ZTE#copy tftp root: HMPU.set //23.50.6.99/HMPU.set    
ZTE#copy tftp //23.50.6.99/HMPU.set root: HMPU2.set

Tftp服务器可以下载软件3CDaemon在电脑上运行即可。

十一、交换机常规巡检命令

查看三层接口Ip地址
show ip interface brief
查看二层接口状态信息
show interface brief
查看交换机的mac地址表
show mac table
查看交换机的arp表
show arp
查看交换机的生成树状态
show spantree instance 0
查看交换机版本
show version
查看交换机系统时间
show clock
查看交换机电源状态
show power
查看交换机风扇状态
show fan
查看交换机cpu和内存使用状态
show processor
查看交换机运行配置
show running-config
查看交换机日志告警
show logging alarm
查看日志文件
show logfile

本文作者: 光明常在
发布时间: 2020-02-03
最后更新: 2020-02-03
本文标题: 中兴交换机基础操作
本文链接: http://mmdav0.coding-pages.com/2020/zte-basic/
版权声明: 本作品采用 CC BY-NC-SA 4.0 许可协议进行许可,转载请注明出处!
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×