2. 实验要求 (1) 最基本要求
? 分别重命名两台交换机为:sw1和sw2 关闭域名查找(解释)? 设置输入同步?
设置执行会话时间为20分30秒? (2) 设置交换机的时区、日期和时钟 (3) 设置交换机的接口
把fa1/7接口设置为:速率10M;半双工模式;access模式?
? 把fa1/8接口设置为:速率100M;全双工模式;access模式;portfast
? 把fa1/1和fa1/2接口设置为:速率100M;全双工模式;trunk模式;trunk封装dot1q (4) 配置静态MAC地址
? 在sw1上把MAC地址:0010.65c9.2568与0012.2b30.1234分别以静态方式分配给接口fa1/9和fa1/10
? 在sw2上把MAC地址:1111.1111.1111与2222.2222.2222分别以静态方式分配给接口fa1/9和fa1/10
(5) 设置交换机管理vlan IP地址和默认网关 (6) 设置交换机的描述信息 设置登陆描述信息?
? 设置fa1/1和fa1/2接口的描述信息 (7) 设置密码
设置访问配置交换机的端口(Console和VTY)密码?
使用service? password-encryption命令把明文密码隐藏起来 使用MD5算法对特权模式进行加密设置? ? 实现对同一网段的交换机进行telnet访问设置
(8) 创建静态hostname表,然后使用该表对直连的交换机进行telnet访问设置 3. 实验步骤 (1) 基本要求 SW1:
Router>show version Router>enable
Router#configure terminal Router(config)#hostname sw1 sw1(config)#no ip domain-lookup sw1(config)#line console 0
sw1(config-line)#logging synchronous sw1(config-line)#exec-timeout 20 30 sw1(config-line)#end SW2:
Router>show version Router>en Router#conf t Router(config)#ho sw2 sw2(config)#no ip domain-loo sw2(config)#line con 0 sw2(config-line)#logg s sw2(config-line)#exec-ti 20 30 sw2(config-line)#end
(2) 设置交换机的时区、日期和时钟 SW1:
sw1#show clock
*00:05:58.767 UTC Fri Mar 1 2002 sw1#conf t
sw1(config)#clock timezone Beijing +8 sw1(config)#exit
sw1#clock set 8:22:50 oct 22 2008 sw1#show clock
08:22:53.815 Beijing Wed Oct 22 2008 SW2设置同上
(3) 设置交换机的接口 SW1:
Sw1#show interfaces status //查看交换机所有接口默认状态信息 sw1#conf t
sw1(config)#int fa1/7 //进入fa1/7接口
sw1(config-if)#speed 10 //设置速度为10M;speed ?可查看可选参数
sw1(config-if)#duplex half //设置为半双工模式;duplex ?可查看可选参数
sw1(config-if)#switchport mode access //设置为访问模式;switchport mode ?查看参数
sw1(config-if)#no shutdown sw1(config-if)#exit
sw1(config)#int fa1/8 //进入fa1/8 sw1(config-if)#speed 100 //设置速度为100M sw1(config-if)#duplex full //设置为全双工模式 sw1(config-if)#switchport mode access //设置为访问模式
sw1(config-if)#spanning-tree portfast //设置接口为portfast模式(前提端口为访问模式) sw1(config-if)#no sh sw1(config-if)#exit
sw1(config)#int range fa1/1 , fa1/2 //同时配置fa1/1和fa1/2接口 sw1(config-if-range)#speed 100 sw1(config-if-range)#duplex full
sw1(config-if-range)#switchport mode trunk //封装trunk模式 sw1(config-if-range)#switchport trunk encapsulation dot1q //trunk封装dot1q sw1(config-if-range)#no sh sw1(config-if-range)#end
检查命令(每配置完一个接口检查一次):
sw1#show running-config interface fa1/7 //查看接口当前运行的配置 sw1#show interfaces fa1/7 //查看接口的完整信息 sw1#show interfaces status
sw1#show interfaces fa1/1 switchport sw1#show interfaces trunk
sw1#show vlan brief //实验时未能使用改命令 sw1#show ip interface brief //查看所有接口状态的概要信息
SW2的配置同上
(4) 配置静态MAC地址 SW1: sw1#conf t
sw1(config)#mac-address-table static 0010.65c9.2568 interface fa1/9 vlan 1 sw1(config)#mac-address-table static 0012.2b30.1234 interface fa1/10 vlan 1 sw1(config)#interface range fa1/9 , fa1/10 sw1(config-if-range)#no sh sw1(config-if-range)#end
sw1#show mac-address-table //查看MAC地址表中所有MAC地址 sw1#show mac-address-table static //查看静态MAC地址表 sw1#show mac-address-table dynamic //查看动态MAC地址表 sw1#show mac-address-table interface fa1/1 //查看指定接口的MAC地址 SW2: sw2#conf t
sw2(config)#mac-address-table static 1111.1111.1111 int fa1/9 vlan 1 sw2(config)#mac-address-table static 2222.2222.2222 int fa1/10 vlan 1 sw2(config)#int ran fa1/9 , fa1/10 sw2(config-if-range)#no sh sw2(config-if-range)#end
(5) 设置交换机管理vlan IP和默认网关 SW1: sw1#conf t
sw1(config)#interface vlan 1
sw1(config-if)#ip add 10.1.1.1 255.255.255.0 sw1(config-if)#no sh
sw1(config-if)#ip default-gateway 10.1.1.254 sw1(config)#end sw1#show int vlan 1 sw1#show ip int vlan 1 sw1#show ip default-gateway SW2: sw2#conf t
sw2(config)#int vlan 1
sw2(config-if)#ip add 10.1.1.2 255.255.255.0 sw2(config-if)#no sh sw2(config-if)#exit
sw2(config)#ip default-ga 10.1.1.254 sw2(config)#end sw2#ping 10.1.1.1 (6) 设置交换机的描述信息 SW1:
sw1(config)#banner motd #
Enter TEXT message. End with the character 'm'. //输入完文本后以m结束,有的以#结束
This is CCNA club sw1 m //文本内容 sw1(config)#int range fa1/1 , fa1/2
sw1(config-if-range)#desc link to office switch sw1(config-if-range)#no sh sw1(config-if-range)#end SW2配置同上 (7) 设置密码 sw1#conf t
sw1(config)#line con 0 sw1(config-line)#pass cisco sw1(config-line)#login sw1(config-line)#exit
sw1(config)#line vty ? //查看vty接口数 <0-871> First Line number sw1(config)#line vty 0 871 sw1(config-line)#pass cisco sw1(config-line)#login sw1(config-line)#exit
sw1(config)#service password-encryption sw1(config)#enable secret cisco sw1(config)#end SW2配置同上
sw2#telnet 10.1.1.1 //从r2 telnet r1 Trying 10.1.1.1 ... Open User Access Verification Password: sw1>en Password: