深圳热线

思科交换机有哪些型号?思科交换机常用命令

2023-04-23 15:30:22 来源:驱动中国网

型号:

Cisco 的交换机产品以“Catalyst ”为商标,包含1900 、2800 、2900 、3500 、4000 、5000 、5500 、6000、8500 等十多个系列。

1、固定配置交换机 ,包括3500 及以下的大部分型号,比如1924 是24 口10M 以太交换机,带两个100M上行端口。除了有限的软件升级之外,这些交换机不能扩展;

2、模块化交换机 ,主要指4000 及以上的机型,网络设计者可以根据网络需求,选择不同数目和型号的接口板、电源模块及相应的软件。

命令大全:

1. 接口MTU和ip MTU

Switch(config-if)#mtu 1500

Switch(config-if)#ip mtu 1500

Switch#sh int s1/0

Switch#sh ip int s1/0

2. 管理MAC表

48位,点分十六进制表示

Switch#show mac address-table //显示mac地址表

Switch#clear mac address-table //清空mac地址表

Switch(config)#mac address-table static aaaa.bbbb.cccc vlan 10 interface e0/0 //配置mac地址静态绑定

VLAN相关

1. Protected port

Switch(config-if)#switchport protected

2. Native Vlan

Switch(config-if)#switchport trunk native vlan 10 //配置trunk接口的native vlan

Switch(config)#vlan dot1q tag native //配置对native vlan也打标签

Vlan范围:(dot1q)

3. Trunk配置

ISL:支持1-1005个vlan编号

DOT1Q:支持1-4094个vlan编号

Switch(config-if)#switchport mode access //将接口设置为access模式

Switch(config-if)#switchport mode trunk //将接口设置为trunk模式

Switch(config-if)#switchport trunk encapsulation {dot1q | ISL | negotiate } //设置trunk封装类型

Switch(config-if)#switchport nonegotiate //将接口设置为nonegotiate,不发送DTP帧,如果配置为非协商,那么必须手工配置接口模式为access或trunk

Switch(config-if)#switchport mode dynamic [auto | desirable] //配置接口为协商模式

Switch#show interface trunk //查看trunk状态

Switch#show interfaces fa0/0 switchport //可查看接口二层trunk信息

Switch(config-if)#switchport trunk allowed vlan {WORD | add | all | except | none | remove} //增删trunk接口允许的vlan

Switch1(config-if)#switchport trunk allowed vlan ?

WORD VLAN IDs of the allowed VLANs when this port is in trunking mode

add add VLANs to the current list

all all VLANs

except all VLANs except the following

none no VLANs

remove remove VLANs from the current list

Switch(config-if)#switchport trunk allowed vlan remove 20 //从trunk接口的allow vlan列表中删除vlan 20

Switch#show interface f0/8 switchport //查看接口trunk/vlan/private-vlan信息

4. VTP

1). VTP配置

Switch1(config)#vtp domain cisco //设置vtp domain

Switch1(config)#vtp mode {server | client |transparent} //设置vtp模式

Switch1(config)#vtp password 123456 //设置vtp密码

Switch1#sh vtp password //查看vtp密码

2). VTP pruning

Switch2(config)#vtp pruning //开启VTP修剪

Switch1#sh vtp status //查看vtp状态

3). 查看trunk及allowed vlan状态

Switch1#sh int trunk //可查看trunk及allow vlan信息

5. 私有VLAN(PVLAN)

1). 创建主VLAN:

Vlan 100

Private-vlan primary

2). 创建辅助VLAN

Vlan 101

Private-vlan community

Vlan 102

Private-vlan ioslate

3). 配置主VLAN,将二层辅助VLAN关联到主VLAN

Vlan 100

Private-vlan association 101,102

4). 将辅助VLAN映射到主VLAN的SVI接口,从而允许PVLAN入口流量的三层交换。

Interface vlan 100

Private-vlan mapping add 101,102

5). 配置接口

主机接口配置

Interface f0/1

Switchport mode private-vlan host

Switchport private-vlan host-association 100 101 //关联主VLAN和辅助VLAN到接口

Interface f0/2

Switchport mode private-vlan host

Switchport mode private-vlan host-association 100 102

混杂端口配置

Interface f0/3

Switchport mode private-vlan promiscuous

Switchport private-vlan mapping add 100 101 //将端口映射到PLAN

6). 查看及验证

Show pvlan mapping

关键词: 以太交换机 网路需求 软件升级

热门推荐