第三次计算机网络实验报告
实验名称
实验三:交换机的基本配置
实验目的
- 掌握交换机端口的常用配置方法;
- 查看交换机端口的配置信息;
- 熟悉交换机的命令行配置;
- 保存交换机配置;
- 熟悉交换机站表的建立过程;
- 利用站表和ipconfig命令了解PC机所连接的交换机的接口
背景描述
假设你是某公司新来的网管,公司要求你熟悉网络产品,登录交换机,了解\掌握交换机的命令行操作,并对交换机端口进行配置和查看.
网络仿真架构
此网络仿真环境如下图:由一台交换机,4台PC机相连;其中PC0通过调试线与交换机相连.
进行交换机设备名称与交换机IP地址的配置
zzutcy>en # 进入特权模式
zzutcy#con
zzutcy#conf
zzutcy#configure # 配置模式
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
zzutcy(config)#host
zzutcy(config)#hostname zzutcy # 配置交换机名称
zzutcy(config)#hostname expoli
expoli(config)#inter
expoli(config)#interface vlan 1 # 配置 vlan1 管理 VLAN 接口
expoli(config-if)#no ip ad
expoli(config-if)#no ip address # 去除 vlan1 原来的IP地址
expoli(config-if)#ip add
expoli(config-if)#ip address 192.168.0.1 255.255.255.0 # 配交换机管理IP地址
expoli(config-if)#ex
expoli(config)#in
expoli(config)#interface vlan 1
expoli(config-if)#no shou
expoli(config-if)#no shout
expoli(config-if)#no shut
expoli(config-if)#no shutdown # 开启交换机管理接口
expoli(config-if)#ex
expoli(config)#ex
expoli#
验证交换机的配置
验证交换机管理IP地址已经配置和开启
# 显示正在运行的配置文件
expoli#show running-config
Building configuration...
Current configuration : 1046 bytes
!
version 12.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname expoli
!
!
spanning-tree mode pvst
!
interface FastEthernet0/1
!
interface FastEthernet0/2
!
##### 此处省略好多字
interface FastEthernet0/23
!
interface FastEthernet0/24
!
interface GigabitEthernet1/1
!
interface GigabitEthernet1/2
!
# vlan1 管理vlan的配置
interface Vlan1
ip address 192.168.0.1 255.255.255.0
!
!
line con 0
!
line vty 0 4
login
line vty 5 15
login
!
!
End
# 也可用show ip interface 显示
显示交换机MAC地址表的记录
SwitchA# show mac-address-table
保存在交换机上所做的配置
在检查完毕后下一步要做的就是保存配置文件,否则掉电会丢失
SwitchA# copy running-config startup-config # ! 保存交换机配置或:
SwitchA# write memory
# 用show running-configure查看当前配置:
# 验证测试:验证交换机配置已保存
SwitchA# show configure # ! 验证交换机配置已保存

0 评论