博达交换机基础操作


一、配置本地用户认证

全局配置模式下
创建用户,配置用户名为test用户,密码为test
username test password 0 test
配置特权密码为testpassword
enable password testpassword
开启密码加密,防止配置里明文保存密码
service password-encryption
配置认证为本地用户认证
aaa authentication login default local

配置进行特权认证时使用enable的密码
aaa authentication enable default enable
配置示例:

1
2
3
4
5
bdcom_config#username test password 0 test    
bdcom_config#enable password testpassword
bdcom_config#service password-encryption
bdcom_config#aaa authentication login default local
bdcom_config#aaa authentication enable default enable

二、配置VLAN

全局配置模式下,创建vlan 10
Vlan 10
添加描述信息
description Bangong
配置示例:

1
2
3
4
5
bdcom#config     
bdcom_config#vlan 2
bdcom_config_vlan2#name Management
bdcom_config_vlan2#exit
bdcom_config#

三、端口加入VLAN

配置access类型端口
全局模式下进入端口配置模式
进入fa0/1
interface fastEthernet0/1
配置端口模式为access模式
switchport mode access
配置端口所属vlan
switchport pvid 10
配置示例:

1
2
3
4
5
bdcom_config#interface fastEthernet0/1    
bdcom_config_f0/1#switchport mode access
bdcom_config_f0/1#switchport pvid 10
bdcom_config_f0/1#exit
bdcom_config#

配置trunk类型端口(trunk类型端口适用于交换机接交换机)
全局模式下进入端口配置模式
进入G0/1
interface GigaEthernet0/1
配置端口模式为trunk模式
switchport mode trunk
配置端口允许通过的VLAN
switchport trunk vlan-allowed all
配置示例:

1
2
3
4
5
bdcom_config#interface GigaEthernet0/1    
bdcom_config_g0/1#switchport mode trunk
bdcom_config_g0/1#switchport trunk vlan-allowed all
bdcom_config_g0/1#exit
bdcom_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
5
bdcom#config     
bdcom_config#int vlAN 10
bdcom_config_v2#ip address 192.168.1.1 255.255.255.0
bdcom_config_v2#exit
bdcom_config#

五、配置静态默认路由

全局配置模式下,配置默认路由的下一跳为192.168.1.2
ip route default 192.168.1.2
配置静态路由:
ip route 192.168.2.0 255.255.255.0 192.168.1.2

六、配置生成树选项

生成树配置需要结合当地网络进行配置,要所有运行在一个拓扑能开启生成树功能的交换机,生成树配置一样。
全局模式下关闭生成树功能
No spanning-tree
配置生成树模式为mstp(配置了模式就开启了生成树)
spanning-tree mode mstp
配置MST域名
spanning-tree mstp nametest
配置实例1包含vlan10,vlan20
spanning-tree mstp instance 1 vlan 10,20
激活MST域配置
active region-configuration
不包含实例中的vlan,全部属于默认实例0,如vlan1默认属于实例0
配置示例:

1
2
3
bdcom_config#spanning-tree mode mstp    
bdcom_config#spanning-tree mstp name test
bdcom_config#spanning-tree mstp instance 1 vlan 10

七、配置ACL访问控制策略

进入acl配置模式
ip access-list standard 2000 #数字可配置2000-2999,基础ACL配置,供电网络中采用基础acl#
配置一条允许24.50.0.67主机
permit 24.50.0.67 255.255.255.255
配置一条允许23.50.6.0网段
permit 23.50.6.0 255.255.255.0
剩余的全部禁止
Deny any
配置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
bdcom_config#ip access-list standard 2000    
bdcom_config_std#permit 24.50.0.67 255.255.255.255
bdcom_config_std#permit 23.50.6.0 255.255.255.0
bdcom_config_std#deny any
bdcom_config_std#exit
bdcom_config

八、配置SSH远程登陆

全局开启ssh服务
ip sshd enable
配置ssh服务认证方法列表,默认情况下使用default列表,按照第一节的配置,default的认证方式是local。也可以直接新建认证方法。我们这里都采用默认的,下面命令可以不需要。
ip sshd auth-method default
配置ssh服务使用的ACL,需要先关闭服务才能启用控制列表
ip sshd access-class 2000
配置示例:

1
2
3
bdcom_config#ip sshd auth-method default    
bdcom_config#ip sshd access-class 2000
bdcom_config#ip sshd enable

九、配置时钟同步和时区

全局模式下配置时区为北京时区(加8小时)
time-zone Beijin 8 0
全局模式下配置时钟服务器10.109.192.5为第一个时钟服务器
sntp server 10.109.192.5 1
全局模式下配置时钟服务器10.109.192.43为备用时钟服务器
sntp server 10.109.192.43
配置示例:

1
2
3
bdcom_config#time-zone Beijin 8 0    
bdcom_config#sntp server 10.109.192.5 1
bdcom_config#sntp server 10.109.192.43

十、备份和还原IOS

交换机用户模式下通过tftp备份iso固件到23.50.6.99服务器
格式:copy flash:Switch.bin tftp:文件名 IP
copy flash:Switch.bin tftp:123.bin 23.50.6.99
交换机用户模式下通过tftp服务器还原IOS到交换机中
格式:copy tftp:123.bin flash:Switch.bin 23.50.6.99
配置示例:

1
2
bdcom#copy flash:Switch.bin tftp:123.bin 23.50.6.99     
bdcom#copy tftp:123.bin flash:Switch.bin 23.50.6.99

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

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

查看三层接口Ip地址
show ip interface brief
查看二层接口状态信息
show interface brief
查看交换机的mac地址表
show mac address-table
查看交换机的arp表
show arp
查看交换机的生成树状态
show spanning-tree
查看交换机版本
show version
查看交换机cpu使用状态
Showcpu
查看交换机内存使用状态
show memory region

本文作者: 光明常在
发布时间: 2020-02-03
最后更新: 2020-02-03
本文标题: 博达交换机基础操作
本文链接: http://mmdav0.coding-pages.com/2020/bd-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

×