admin管理员组

文章数量:1531792

2024年6月25日发(作者:)

1. 基本配置:

开启SSH服务:debug ssh-server

设置特权模式密码:enable password [8] 注释:8为加密的密码

设置退出特权模式超时时间::exec-timeout []

Switch(config)#exec-timeout 5 30(退出时间为5分30秒)

更改主机名:hostname 主机名

设置主机名与IP地址的映射关系:Switch(config)#ip host beijing 200.121.1.1

(beijing为主机)

开启web配置服务:Switch(config)#ip http serve

显示帮户信息的语言类型:language {chinese|english}

使用密码验证:login

使用本地用户密码验证:Switch(config)#login local

设置用户在 console上进入一般用户配置模式时的口令:Switch(config)#password 8

test

热启动交换机:reload

加密系统密码:service password-encryption

恢复交换机出厂配置:set default

保存当前配置:write

配置交换机作为 Telnet 服务器允许登录的 Telnet 客户端的安全 IP 地址:

Switch(config)#telnet-server securityip 192.168.1.21

设置Telnet 客户端的用户名及口令:Switch(config)#telnet-user Antony password 0

switch

打开交换机的 SSH服务器功能:Switch(config)#ssh-server enable

设置SSH客户端的用户名及口令:Switch(config)#ssh-user switch password 0 switch

通过DHCP 方式获取 IP 地址。

Switch(config)#interface vlan 1

Switch(Config-if-Vlan1)#ip dhcp-client enable

Switch(Config-if-Vlan1)#exit

交换机 Switch1 端口 1 同交换机 Switch2 端口 1 用线相连,将该两个端口设置为强制

100Mbit/s 速率,半双工模式。

Switch1(config)#interface ethernet1/1

Switch1(Config-If-Ethernet1/1)#speed-duplex force100-half

Switch2(config)#interface ethernet1/1

Switch2(Config-If-Ethernet1/1)#speed-duplex force100-half

配置名称为 test的隔离组。

Switch>enable

Switch#config

Switch(config)#isolate-port group test

打开LACP调试开关。

Switch#debug lacp

新建一个 port group,并且采用默认的流量分担方式。

Switch (config)#port-group 1

删除一个 port group

Switch (config)#no port-group 1

在 Ethernet1/1 端口模式下,将本端口以 active 模式加入port-group 1。

Switch (Config-If-Ethernet1/1)#port-group 1 mode active

删除端口 1 动态MAC。

Switch#clear port-security dynamic interface Ethernet 1/1

使能端口 1 的MAC 地址绑定功能。

Switch(config)#interface Ethernet 1/1

Switch(Config-If-Ethernet1/1)#switchport port-security

将端口 1 的MAC地址转化为静态安全 MAC 地址。

Switch(config)#interface Ethernet 1/1

Switch(Config-If-Ethernet1/1)#switchport port-security convert

添加MAC 00-03-0F-FE-2E-D3 到端口 1

Switch(config)#interface Ethernet 1/1

Switch(Config-If-Ethernet1/1)#switchport port-security mac-address 00-03-0F-FE-2E-

D3

设置端口 1 安全MAC 地址上限为 4。

Switch(config)#interface Ethernet 1/1

Switch(Config-If-Ethernet1/1)#switchport port-security maximum 4

设置端口 1 的违背模式为 shutdown。

Switch(config)#interface Ethernet 1/1

Switch(Config-If-Ethernet1/1)#switchport port-security violation shutdown

生成树配置:

配置VLAN1-10;100-110 与 Instance 1的映射关系。

Switch(config)#spanning-tree mst configuration

Switch(Config-Mstp-Region)#instance 1 vlan 1-10;100-110

配置修正数值为 2000。

Switch(config)#spanning-tree mst configuration

Switch(Config-Mstp-Region)# revision-level 2000

开启和关闭生成树

Switch(config)#spanning-tree

Switch(config)#interface ethernet 1/2

Switch(Config-If-Ethernet1/2)#no spanning-tree

设置交换机运行 STP模式。

Switch(config)#spanning-tree mode stp

在端口 1/2 设置实例 1 的端口优先级为 32。

Switch(config)#interface ethernet 1/2

Switch(Config-If-Ethernet1/2)#spanning-tree mst 1 port-priority 32

配置交换机实例 2 的优先级为 4096。

Switch(config)#spanning-tree mst 2 priority 4096

访问控制列表配置:

使能在 Tuesday到 Saturday内的 9:15:30到 12:30:00时间段内配置生效

本文标签: 配置模式设置端口交换机