实验 15 交换机基本配置

来源:互联网 发布:跑男第三季网络直播 编辑:程序博客网 时间:2024/05/24 04:29

一.实验目的:
1.掌握交换机基本配置的步骤和方法。
2.掌握查看和测试交换机基本配置的步骤和方法。
二.实验要点:
配置交换机的基本参数,检查交换机的基本参数配置。
三.实验设备:
交换机 Cisco Catalyst 2950-24 一台,带有网卡的工作站 PC 一台,控制台电缆一条,直连线一条。
四、实验环境
这里写图片描述
图15

实验中使用2950-24和2950T-24都能实现效果
五. 实验步骤
1.按图 15 连接交换机和工作站 PC。
2.配置交换机主机名(SwitchA)、加密使能密码(S1)、虚拟终端口令(S2)及超时时间(5分钟)、禁止名称解析服务。

Switch>enSwitch#conf tEnter configuration commands, one per line.  End with CNTL/Z.switchA(config)#hostname SwitchASwitchA(config)#enable password s1SwitchA(config)#line vty 0 4SwitchA(config-line)#password s2SwitchA(config-line)#loginSwitchA(config-line)#line con 0SwitchA(config-line)#exec-time 5 0SwitchA(config-line)#no ip domain-lookupSwitchA(config)#

3.配置交换机管理 IP 地址(192.168.1.1)、子网掩码(255.255.255.0)、默认网关(192.168.1.254)。

SwitchA(config)#int vlan 1SwitchA(config-if)#ip ad 192.168.1.1 255.255.255.0SwitchA(config-if)#no shSwitchA(config-if)#%LINK-5-CHANGED: Interface Vlan1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to upSwitchA(config-if)#exitSwitchA(config)#ip default-gateway 192.168.1.254SwitchA(config)#exit

4.配置交换机端口速度(100Mbps)、端口双工方式(半双工)。(这里配置全双工模式是无法实现端口能够ping通的)

什么是半双工,什么是全双工?它们之间有什么区别?
半双工(half-duplex)是指传输过程中同时只能向一个方向传输。一方的数据传输结束之后,另外一方再回应。也就是说同时只有一个节点能够传输,如果两个节点同时传输数据的话,网络中就会出现拥堵。 相信你能够理解,这种传输方式效率低,需要更多的时间,收发更多的数据。 老的网站都是用的半双工的节点,主要是因为受到网络媒介(同轴电缆)和硬件设备(hub)的限制。 全双工(full-duplex)是指两方能同时发送和接受数据。在这种情况下就没有拥堵的危险,数据的传输也就更快。

全双工 速率100M ,可以同时接收发送帧。配置duplex full
半双工 速率10M , 瞬时只能接收或者发送帧。配置duplex half

SwitchA#%SYS-5-CONFIG_I: Configured from console by consoleSwitchA#conf tEnter configuration commands, one per line.  End with CNTL/Z.SwitchA(config)#int f0/1SwitchA(config-if)#speed 10SwitchA(config-if)#duplex halfSwitchA(config-if)#%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to upSwitchA(config-if)#exit

5.通过 Telnet 方式登录到交换机。
在 hostA 上 C:>telnet 192.168.1.1

PC>ping 192.168.1.1Pinging 192.168.1.1 with 32 bytes of data:Reply from 192.168.1.1: bytes=32 time=0ms TTL=255Reply from 192.168.1.1: bytes=32 time=1ms TTL=255Reply from 192.168.1.1: bytes=32 time=0ms TTL=255Reply from 192.168.1.1: bytes=32 time=0ms TTL=255Ping statistics for 192.168.1.1:    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:    Minimum = 0ms, Maximum = 1ms, Average = 0msPC>telnet 192.168.1.1Trying 192.168.1.1 ...OpenUser Access VerificationPassword:       //这里输入s2SwitchA>enPassword:       //这里输入s1SwitchA#show runningSwitchA#show running-config 

6.检查交换机运行配置文件内容。
7.检查交换机启动配置文件内容。
show running-config //检查启动配置文件,要基本读懂配置文件中关于交换机的一些信息

SwitchA#show running-config Building configuration...Current configuration : 1140 bytes!version 12.1no service timestamps log datetime msecno service timestamps debug datetime msecno service password-encryption!hostname SwitchA!enable password s1!no ip domain-lookup!spanning-tree mode pvst!interface FastEthernet0/1 switchport mode access duplex half speed 100!interface FastEthernet0/2!interface FastEthernet0/3!interface FastEthernet0/4!interface FastEthernet0/5!interface FastEthernet0/6!interface FastEthernet0/7!interface FastEthernet0/8!interface FastEthernet0/9!interface FastEthernet0/10!interface FastEthernet0/11!interface FastEthernet0/12!interface FastEthernet0/13!interface FastEthernet0/14!interface FastEthernet0/15!interface FastEthernet0/16!interface FastEthernet0/17!interface FastEthernet0/18!interface FastEthernet0/19!interface FastEthernet0/20!interface FastEthernet0/21!interface FastEthernet0/22!interface FastEthernet0/23!interface FastEthernet0/24!interface Vlan1 ip address 192.168.1.1 255.255.255.0!ip default-gateway 192.168.1.254!!line con 0 exec-timeout 5 0!line vty 0 4 password s2 loginline vty 5 15 login!!end

show version //显示思科IOS信息

SwitchA#show versionCisco Internetwork Operating System SoftwareIOS (tm) C2950 Software (C2950-I6Q4L2-M), Version 12.1(22)EA4, RELEASE SOFTWARE(fc1)Copyright (c) 1986-2005 by cisco Systems, Inc.Compiled Wed 18-May-05 22:31 by jharirbaImage text-base: 0x80010000, data-base: 0x80562000ROM: Bootstrap program is is C2950 boot loaderSwitch uptime is 55 minutes, 14 secondsSystem returned to ROM by power-onCisco WS-C2950-24 (RC32300) processor (revision C0) with 21039K bytes of memory.Processor board ID FHK0610Z0WCLast reset from system-resetRunning Standard Image24 FastEthernet/IEEE 802.3 interface(s)63488K bytes of flash-simulated non-volatile configuration memory.Base ethernet MAC Address: 0001.6327.6705Motherboard assembly number: 73-5781-09 Power supply part number: 34-0965-01Motherboard serial number: FOC061004SZPower supply serial number: DAB0609127DModel revision number: C0Motherboard revision number: A0Model number: WS-C2950-24System serial number: FHK0610Z0WCConfiguration register is 0xF

8.检查 VLAN1 的参数及配置。

SwitchA#show vlanVLAN Name                             Status    Ports---- -------------------------------- --------- -------------------------------1    default                          active    Fa0/1, Fa0/2, Fa0/3, Fa0/4                                                Fa0/5, Fa0/6, Fa0/7, Fa0/8                                                Fa0/9, Fa0/10, Fa0/11, Fa0/12                                                Fa0/13, Fa0/14, Fa0/15, Fa0/16                                                Fa0/17, Fa0/18, Fa0/19, Fa0/20                                                Fa0/21, Fa0/22, Fa0/23, Fa0/241002 fddi-default                     act/unsup 1003 token-ring-default               act/unsup 1004 fddinet-default                  act/unsup 1005 trnet-default                    act/unsup VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------1    enet  100001     1500  -      -      -        -    -        0      01002 fddi  101002     1500  -      -      -        -    -        0      0   1003 tr    101003     1500  -      -      -        -    -        0      0   1004 fdnet 101004     1500  -      -      -        ieee -        0      0   1005 trnet 101005     1500  -      -      -        ibm  -        0      0   Remote SPAN VLANs------------------------------------------------------------------------------Primary Secondary Type              Ports------- --------- ----------------- -----------------------------------------

9.检查端口 FastEthernet 0/1 的状态及参数。

SwitchA#show int f0/1FastEthernet0/1 is up, line protocol is up (connected)  Hardware is Lance, address is 0010.1164.c801 (bia 0010.1164.c801) BW 100000 Kbit, DLY 1000 usec,     reliability 255/255, txload 1/255, rxload 1/255  Encapsulation ARPA, loopback not set  Keepalive set (10 sec)  Half-duplex, 100Mb/s  input flow-control is off, output flow-control is off  ARP type: ARPA, ARP Timeout 04:00:00  Last input 00:00:08, output 00:00:05, output hang never  Last clearing of "show interface" counters never  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0  Queueing strategy: fifo  Output queue :0/40 (size/max)  5 minute input rate 0 bits/sec, 0 packets/sec  5 minute output rate 0 bits/sec, 0 packets/sec     956 packets input, 193351 bytes, 0 no buffer     Received 956 broadcasts, 0 runts, 0 giants, 0 throttles     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort     0 watchdog, 0 multicast, 0 pause input     0 input packets with dribble condition detected     2357 packets output, 263570 bytes, 0 underruns     0 output errors, 0 collisions, 10 interface resets     0 babbles, 0 late collision, 0 deferred     0 lost carrier, 0 no carrier     0 output buffer failures, 0 output buffers swapped outSwitchA#

10.检查交换机 MAC 地址表的内容。

SwitchA#show mac-address-table          Mac Address Table-------------------------------------------Vlan    Mac Address       Type        Ports----    -----------       --------    -----   1    0090.2be9.84d2    DYNAMIC     Fa0/1

六. 实验总结
1 .交换机基本配置与路由器基本配置有什么异同?哪些命令相同,哪些命令不同?
熟悉路由器和交换机基本配置的异同之处。
2 .一般来说对于同网段的交换机管理时对交换机配置一个管理性 IP 地址就可以了,当要从一个
交换机跨网段管理另一个交换机时需要给交换机配置默认网关。

0 0
原创粉丝点击