2024年4月26日发(作者:)
1、连接交换机,写下连接的命令;
telnet 192.168.2.102 10203 连接网络机房1中的第二个机柜堆叠中第三
台交换机的连接命令
2、对交换机进行初始化配置,写出配置项目的命令;
switch>enable //从一般模式切换到特权模式
switch#conf t //从特权模式切换到全局配置模式
switch
sw2960
sw2960
管理vlan 1 ip地址为192.168.5.20 子网掩码为 255.255.255.0
删除管理vlan 1的IP地址命令为:
sw2960
sw2960
sw2960
sw2960
sw2960#wr //保存设置
sw2960# clock set 09:43:50 2010.09.18 //配置交换机时间命令
sw2960# conf t //从一般模式进入到特权模式
sw2960
current password //没有设置任何口令 按回车进入密码设置
new password 110 //配置密码为110
confirm new password 110 // 确认密码 110
sw2960
sw2960
ctrl+z 返回一般配置模式
sw2960#wr //保存设置
3 配置交换机带内管理web连接和远程telnet的配置命令;
根据第二题操作
带内管理web连接
sw2960
sw2960
Http用户
sw12960#wr //保存设置
关闭带内管理web连接命令为:
no ip http server
在dos命令下输入telnet 192.168.5.20 将连接到交换机
远程telnet配置
sw2960
sw2960
telnet用户
sw2960
sw2960#wr //保存设置
关闭交换机telnet服务命令如下:
sw2960
在dos命令下输入http:192.168.5.20 进入telnet管理交换机接口
4 保存配置,记录下flash中的文件名及文件大小。保存配置到计算机,
写出命令。
sw2960#show flash //查看需要备份的文件
file name file length
2464210 bytes
startup-config 985 bytes
running-config 985 bytes
保存配置到计算机,写出命令。
sw2960#copy startup-config tftp://192.168.5.10/startup-config0918 保存配
置到计算机
confirm (yn) y
5 vlan划分命令
switchA
switchA
switchA
switchA
switchA
删除vlan 200的命令是:
switchA
switchA
switchA#wr //保存设置
6、为vlan 100和vlan 200分配端口
switchA
口添加给vlan 100
switchA
端口添加给vlan 200
为其添加端口完成
7 实现不同交换机相同vlan的互通
如同5、6两题为另一台交换机配置相同 并配置trunk口
配置24端口为trunk口如下操作
switchA
switchA
另一台交换机也如同7所示配置trunk口并用双绞线将其trunk相连
两台pc机分别连接一台交换机相同vlan的端口,这样相互之间就可以通
信了
8、交换机MAC地址与端口绑定
switch>en
switch#config
switch(Config)#interface ethernet 0/0/1
switch(Config-Ethernet0/0/1)#switchport port-security
验证配置:
switch(Config-Ethernet0/0/1)#switchport port-security ?
convert -- convert dynamic mac to security mac
lock -- Lock security port
mac-address -- Security mac address
maximum -- Max secure addrs
timeout -- lock timer
violation -- Security Violation Mode
switch(Config-Ethernet0/0/1)#switchport port-security mac-address 00-1D-
09-13-DC-5E ?
switch(Config-Ethernet0/0/1)#switchport port-security mac-address 00-1D-
09-13-DC-5E
switch(Config-Ethernet0/0/1)#
switch#show port-security
Security Port MaxSecurityAddr CurrentAddr Security Action
(count) (count)
------------------------------------------------------------------------------------
Ethernet0/0/1 1 1 Protect
-----------------------------------------------------------------------------------
Max Addresses limit per port :128
Total Addresses in System :1
switch#show port-security address
Security Mac Address Table
----------------------------------------------------------------------------
Vlan Mac Address Type Ports
1 00-1d-09-13-dc-5e SecurityConfigured Ethernet0/0/1
----------------------------------------------------------------------------
Total Addresses in System :1
Max Addresses limit in System :128
9 MAC地址与ip地址绑定
switch#config
switch(Config)#am enable
switch(Config)#interface ethernet 0/0/1
switch(Config-Ethernet0/0/1)#am mac-ip-pool 00-1D-09-13-DC-5E
192.168.1.102
switch(Config-Ethernet0/0/1)#exit
switch(Config)#
验证配置:show am
10、配置MAC地址表实现绑定与过滤
switch>en
switch#config
switch(Config)#mac-address-table static address 00-1D-09-13-DC-5E vlan 1
interface ethernet 0/0/1
验证配置:show mac-address-table
发布评论