交换机的基本配置

2025-10-16 18:40:46

1、设备命名

Switch>enab   特权模式

Switch#conf t  全局配置模式

Switch(config)#host SWITCH-A  配置主机名

SWITCH-A(config)#no host   恢复系统默认名称

Switch(config)#

交换机的基本配置

2、Console口密码配置

Switch(config)#line console 0        进放console 0接口线配置模式

Switch(config-line)#password 123  为conslole 接口配置密码“123”

Switch(config-line)#login  允许通过本地登录,如果没有这此命令则口

令不生效

Switch(config-line)#no password   清除conslole 0接口密码

交换机的基本配置

3、特权密码

Switch(config)#enable password 123   配置交换机特权密码为“123” 明文形式保存

Switch(config)#no enab password    删除特权明文密码

Switch(config)#enab secret 123     配置交换机特权密码为“123”以密文形式保存

Switch(config)#no enab secret 123     删除特权密文密码

Switch(config)#Service password-encryption   加密码系统所有口令

4、IP地址配置

Switch(config)#interface vlan 1       进入vlan 1虚拟接口

Switch(config-if)#ip address 192.168.1.1 255.255.255.0   配置交换机IP地址为:192.168.1.1

Switch(config-if)#no shutdown  打开交换机vlan 1接口, IP地址生效

Switch(config-if)#no ip address   删除vlan 1配置的IP

Switch(config-if)#exit   返回上一级特权模式

Switch#show vlan id 30   查看vlan 30的状态

Switch#show vlan   查看交换机里全部的vlan

5、网关配置

Switch(config)#ip default-gateway 192.168.1.254    配置交换机的默认网关

Switch(config)#no ip default-gateway    删除网关地址

Switch# show ip def     查看交换机的默认网关

6、交换机端口模式和速度配置

Switch(config)#interface f0/1      进入F0/1接口配置模式

Switch(config-if)#duplex full        配置双工模式为全双工

Switch(config-if)#speed 100         配置速度为100

双工模式:

 auto:自动协商模式           full:全双工           half:半双工

端口速率:

Auto:自动协商                    10Mb/s               100Mb/s

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢