计算机网络实验 — Cisco交换机的配置

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/m0_37345402/article/details/83928639

Cisco交换机的配置实验的具体步骤及命令代码:

Switch> enable
——————————————观察交换机相关信息
Switcher#show version
——————————————查看交换机配置
Switch#show running-config
——————————————查看交换机端口参数
Switch#show interfaces f0/1
——————————————生成树配置
Switch#show spanning-tree
——————————————查看交换机的MAC地址
Switch#show mac-address-table

——————————————进入特权命令状态
Switch>enable
Switch#
——————————————进入全局设置状态
Switch#configure terminal
Switch(config)#
——————————————设置交换机名称
Switch(config)#hostname switch_1
Switch_1(config)#

——————————————设置交换机IP地址
Switch_1(config)#int vlan1 ——进入vlan接口模式
Switch_1(config-if)#ip address 172.21.12.254 255.255.255.0
Switch_1(config-if)#exit
Switch_1(config)#
——————————————进入接口设置状态
Switch_1(config)#interface f0/10
Switch_1(config-if)#
———————————设置交换机接口的duplex方式
Switch_1(config-if)#speed 100
Switch_1(config-if)#duplex half
Switch_1(config-if)#exit
Switch_1(config)#exit
Switch_1#
——————————在特权命令下验证端口工作状态
Switch_1#show interfaces f0/10

划分VLAN
Switch_2#configure terminal
Switch_2(config)#

——————————设置switch2为VTP的server
Switch_2(config)#vtp mode server
——————————设置VTP的域名为ABC
Switch_2(config)#vtp domain ABC
———————设置switch1的vtp域名及client模式
Switch_1(config)#vtp mode client
Switch_1(config)#vtp domain ABC
——在switch2(服务器)设置VLAN:①增加VLAN2;②VLAN2的名字为xyx;③其中f0/1属于VLAN1;f0/2属于VLAN2;④f0/24为trunk——
①②—————————————————————
Switch_2(config)#vlan 2
Switch_2(config-vlan)#name xyz
③——————————————————————
Switch_2(config-vlan)#int f0/2
Switch_2(config-if)#switchport mode access
Switch_2(config-if)#switchport access vlan 2
④——————————————————————
Switch_2(config-if)#exit
Switch_2(config)#int f0/24
Switch_2(config-if)#switchport mode trunk

———在switch1设置f0/1属于vlan1;f0/2属于vlan2;f0/24为trunk———
Switch_1(config)#int f0/2
Switch_1(config-if)#switchport mode access
Switch_1(config-if)#switchport access vlan 2

——————————————检查VLAN信息
Switch_1#show vlan b/brief

猜你喜欢

转载自blog.csdn.net/m0_37345402/article/details/83928639
今日推荐