我们已经准备好了,你呢?

2022我们与您携手共赢,为您的企业网络安全保驾护航!

交换机基本操作:
1.进入特权模式
Switch>enable
Switch#
2.返回用户模式
Switch#exit
Press RETURN to get started! 
Switch> 
配置模式:
全局配置模式[主机名(config)#]:配置交换机的整体参数
子模式: 
1.线路配置模式[主机名(config-line)#]:配置交换机的线路参数
2.接口配置模式[主机名(config-if)#]:配置交换机的接口参数
 
1.进入、退出全局配置模式
Switch#configure terminal
Switch(config)#exit
Switch#
 
2.进入、退出线路配置模式
Switch(config)#line console 0
Switch(config-line)#exit
Switch(config)#
 
3.进入、退出接口配置模式
Switch(config)#interface fastEthernet 0/1
Switch(config-if)#exit
Switch(config)#
 
从子模式下直接返回特权模式
Switch(config-if)#end
Switch#
 
交换机操作帮助:
1.支持命令简写(按TAB键将命令补充完整)
2.在每种操作模式下直接输入“?”显示该模式下所有的命令
3.命令空格 “?”显示命令参数并对其解释说明
4. “字符?”显示以该字符开头的命令
5.命令历史缓存: (Ctrl+P)显示上一条命令,(Ctrl+N)显示下一条命令
6.错误提示信息
 
交换机显示命令:
显示交换机硬件及软件的信息 Switch#show version 
显示当前运行的配置参数 Switch#show running-config 
显示保存的配置参数 Switch#show configure
 
常用交换机EXEC命令:
1.将当前运行的配置参数复制到flash:
Switch#write memory 
Building configuration...
[OK]
Switch#
 
2.清空flash中的配置参数:
Switch#delete flash:config.text
Switch#
 
3.交换机重新启动:
Switch#reload 
System configuration has been modified. Save? [yes/no]:n
Proceed with reload? [confirm]
 
4.配置交换机主机名:
Switch(config)#hostname S2126G-1
S2126G-1(config)#
 
5.配置交换机口令:
1) 配置交换机的登陆密码
S2126G(config)#enable secret level 1  0  star
“0”表示输入的是明文形式的口令
2) 配置交换机的特权密码
S2126G(config)#enable secret level 15  0  star
“0”表示输入的是明文形式的口令
 
常用交换机配置命令:
1、为交换机分配管理IP地址
S2126G(config)#interface vlan 1
S2126G(config-if)#ip address {IP address} {IP subnetmask}[secondary]
2、将接口启用
S2126G(config-if)#no shutdown
3、将接口关闭
S2126G(config-if)#shutdown
4、配置接口速率
S2126G(config-if)#speed [10|100|auto] 
5、配置接口双工模式
S2126G(config-if)#duplex [auto|full|half]
 
显示接口状态:
S2126G#show interface 
 
测定目的端的可达性:
S2126G>ping {IP address} 
 
从TFTP服务器下载配置参数:
S2126G#copy tftp startup-config
 
管理交换机MAC地址表:
1、查看MAC地址表
S2126G#show mac-address-table 
 
2、配置MAC地址表记录的生存时间(缺省为300秒) 
S2126G(config)#mac-address-table aging-time <10-1000000>
 
3、查看MAC地址表记录的生存时间
S2126G#show mac-address-table aging-time 
 
VLAN的配置:
1.添加一个VLAN 
S2126G(config)#vlan <1-4094>
S2126G(config-vlan)#
 
2.为VLAN命名
S2126G(config-vlan)#name  名字
 
将交换机端口分配到VLAN
1.配置Port VLAN
Switch(config-if)#switchport access vlan <1-4094> 
2.配置Tag VLAN
Switch(config-if)#switchport mode trunk
1)配置本地(native)VLAN
Switch(config-if)#switchport trunk native vlan <1-4094>
Native VLAN即PVID,默认情况下每个trunk口的native VLAN 是1
2)从主干链路中清除VLAN
Switch(config-if)#switchport trunk allowed vlan except  vlan-list
注:VLAN1不可被清除
3)在主干链路中允许所有VLAN
Switch(config-if)#switchport trunk allowed vlan all
4)向主干链路中加入VLAN
Switch(config-if)#switchport trunk allowed vlan add  vlan-list
 
VLAN的验证:
1.显示全部的VLAN:Switch#show vlan
2.显示单独的VLAN :Switch#show vlan id <1-4094>
 
将VLAN信息保存到flash中:
Switch#write memory
从flash中清除VLAN信息:
Switch#delete flash:vlan.dat
 
RSTP的配置:
1.启用生成树:
S2126G(config)#spanning-tree 
2.配置交换机优先级:
S2126G(config)#spanning-tree priority <0-61440> 
“0”或“4096”的倍数(RSTP BPDU该值后12bit全0)
3.配置交换机端口优先级:
S2126G(config-if)#spanning-tree port-priority <0-240> 
“0”或“16”的倍数(RSTP BPDU该值后4bit全0)
4、生成树hello时间的配置(由Root决定):
S2126G(config)#spanning-tree hello-time <1-10> 
5、生成树的验证:Switch#show spanning-tree
Switch#show spanning-tree interface <接口名称> <接口编号> 
 
聚合端口的创建:
Switch(config)# interface aggregateport 1   创建聚合接口AG1
Switch(config-if)# switchport mode trunk   配置并保证AG1为 trunk 模式
Switch(config)#int range f0/23-24
Switch(config-if-range)#port-group 1       将端口(端口组)划入聚合端口AG1中
生成树:
Switch(config)#spanning-tree    开启生成树协议
Switch(config)#spanning-tree mode stp 指定生成树类型为stp
  可选模式stp , rstp , mstp
Switch(config)#spanning-tree priority 4096 设置交换机的优先级为4096 , 优先级值小为高。优先级可选值为0,4096,8192,……,为4096的倍数。交换机默认值为32768
SVI接口配置:
Switch(config)#interface vlan 10   进入VLAN 10的虚拟端口配置模式
Switch(config-if)# ip address 192.168.1.1 255.255.255.0 为VLAN10的虚拟端口配置IP及掩码,二层交换机只能配置一个IP,此IP是作为管理IP使用,例如,使用Telnet的方式登录该IP地址
Switch(config-if)# no shutdown    启用该端口
端口安全:
Switch(config)# interface fastethernet 0/1     进入一个端口
Switch(config-if)# switchport port-security    开启该端口的安全功能
1)配置最大连接数限制
Switch(config-if)# switchport port-secruity maxmum 1 配置端口的最大连接数为1,最大连接数为128
Switch(config-if)# switchport port-secruity violation shutdown
配置安全违例的处理方式为shutdown,可选为protect (当安全地址数满后,将未知名地址丢弃)、restrict(当违例时,发送一个Trap通知)、shutdown(当违例时将端口关闭,并发送Trap通知,可在全局模式下用errdisable recovery来恢复)
2)IP和MAC地址绑定
Switch(config-if)#switchport port-security mac-address xxxx.xxxx.xxxx ip-address 172.16.1.1
接口配置模式下配置MAC地址xxxx.xxxx.xxxx与IP地址172.16.1.1进行绑定(MAC地址十六进制a-f用小写字母)
三层交换机路由功能:
1) 开启三层交换机的路由功能
Switch(config)# ip routing
2) 开启端口的三层路由功能
Switch(config)# interface fastethernet 0/1
Switch(config-if)# no switchport    (这样就可以为某一端口配置IP)
Switch(config-if)# ip address 192.168.1.1 255.255.255.0
Switch(config-if)# no shutdown

我们凭借多年的智能化设计及施工经验,坚持以“帮助中小企业实现现代化网络”为宗旨,累计为4000多家客户提供品质智能化服务,得到了客户的一致好评。如果您有综合布线、计算机网络、无线覆盖、门禁考勤、机房建设、防火墙、路由器及交换机调试等方面的需求...
请立即点击咨询我们或拨打咨询热线: 17804441181,我们会详细为你一一解答你心中的疑难。项目经理在线

我们已经准备好了,你呢?

2022我们与您携手共赢,为您的企业网络安全保驾护航!

在线客服
联系方式

热线电话

17804441181

上班时间

周一到周五

公司电话

+86-512-65829193

二维码
微信
线