【实验分享】Switch基本配置
  KDk97yxRQlQU 2023年11月02日 40 0

实验目的:

l配置交换机的基本命令

实验说明:

Cisco的交换机配置命令和Router的配置命令基本一致, 故这里不做详细介绍

实验拓扑图:

 【实验分享】Switch基本配置_4s


实验步骤:

1. 了解基本配置

Sw1#configure terminal

Sw1(config)# interface fastethernet0/10

Sw1(config-if)#speed 10             

Sw1(config-if)#duplex half  

Sw1(config-if)#description test

Sw1(config-if)#end

Sw1#sh int f0/10 status

Port  Name Status   Vlan  Duplex  Speed Type

Fa0/10   test

Sw1#sh int fa0/11

FastEthernet0/11 is up, line protocol is up 

  Hardware is Fast Ethernet, address is 000d.2960.8bcb (bia 000d.2960.8bcb)

  MTU 1500 bytes, BW 100000 Kbit, DLY 1000 usec,

     reliability 255/255, txload 1/255, rxload 1/255

  Encapsulation ARPA, loopback not set

  Keepalive set (10 sec)

  Full-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:00, output 00:00:01, 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

     5751 packets input, 414216 bytes, 0 no buffer

     Received 5680 broadcasts, 0 runts, 0 giants, 0 throttles

     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored

     0 watchdog, 5680 multicast, 0 pause input

     0 input packets with dribble condition detected

     119 packets output, 12781 bytes, 0 underruns

     0 output errors, 0 collisions, 2 interface resets

     0 babbles, 0 late collision, 0 deferred

     0 lost carrier, 0 no carrier, 0 PAUSE output

     0 output buffer failures, 0 output buffers swapped out


Sw1#sh int fa0/1 switchport 

Name: Fa0/1

Switchport: Enabled

Administrative Mode: dynamic desirable

Operational Mode: down

Administrative Trunking Encapsulation: dot1q

Negotiation of Trunking: On

Access Mode VLAN: 1 (default)

Trunking Native Mode VLAN: 1 (default)

Administrative private-vlan host-association: none

Administrative private-vlan mapping: none

Operational private-vlan: none

Trunking VLANs Enabled: ALL

Pruning VLANs Enabled: 2-1001


Protected: false


Voice VLAN: none (Inactive)

Appliance trust: none


Sw1#sh run int f0/1

Building configuration...

Current configuration : 89 bytes

!

interface FastEthernet0/1

 description test

 no ip address

 duplex half

 speed 10

end


Sw1#show version

Cisco Internetwork Operating System Software

IOS (tm) C2960 Software (C2960-I6Q4L2-M), Version 12.2(11)EA1, RELEASE SOFTWARE (fc1)

Copyright (c) 1986-2007 by cisco Systems, Inc.

Compiled Wed 28-Aug-02 10:25 by antonino

Image text-base: 0x80010000, data-base: 0x80528000


ROM: Bootstrap program is CALHOUN boot loader


Sw1 uptime is 30 minutes

System returned to ROM by power-on

System image file is "flash:/c2960-i6q4l2-mz.122-11.EA1.bin"


cisco WS-C2960-24 (RC32300) processor (revision J0) with 20402K bytes of memory.

Processor board ID FOC0725Y05M

Last reset from system-reset

Running Standard Image

24 FastEthernet/IEEE 802.3 interface(s)


32K bytes of flash-simulated non-volatile configuration memory.

Base ethernet MAC Address: 00:0D:29:60:8B:C0

Motherboard assembly number: 73-5782-11

Power supply part number: 34-0965-01

Motherboard serial number: FOC07250XZ2

Power supply serial number: DAB07226HJ0

Model revision number: J0

Motherboard revision number: A0

Model number: WS-C2960-24

System serial number: FOC0725Y05M

Configuration register is 0xF




Sw1(config)#do sh vlan b


VLAN 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(省略)

1002 fddi-default                     active    

1003 token-ring-default               active    

1004 fddinet-default                  active    

1005 trnet-default                    active    


Sw1#sh int trunk

Port      Mode         Encapsulation  Status        Native vlan

Fa0/11    desirable    802.1q         trunking      1

Fa0/12    desirable    802.1q         trunking      1


Port      Vlans allowed on trunk

Fa0/11    1-4094

Fa0/12    1-4094


Port      Vlans allowed and active in management domain

Fa0/11    1

Fa0/12    1


Port      Vlans in spanning tree forwarding state and not pruned

Fa0/11    1

Fa0/12    none


Sw1(config)#vlan 20

Sw1(config-vlan)#name G-LAB20

Sw1(config-vlan)#end

Sw1#vlan database

Sw1(vlan)#vlan 30 name G-LAB30

VLAN 30 added:

    Name: G-LAB30

Sw1(vlan)#exit

APPLY completed.

Exiting....

Sw1#

Sw1#show vlan brief


VLAN 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

20   G-LAB20                       active 

30   G-LAB30                       active    

1002 fddi-default                     active    

1003 token-ring-default               active    

1004 fddinet-default                  active    

1005 trnet-default                    active    

Sw1#

Sw1(config)#no vlan 30

Sw1(config)#do sh vlan b


VLAN 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

20   G-LAB20                       active    

1002 fddi-default                     active    

1003 token-ring-default               active    

1004 fddinet-default                  active    

1005 trnet-default                    active    


Sw1(config)#int fa0/1   

Sw1(config-if)#switchport mode access

Sw1(config-if)#switchport access vlan 20

Sw1(config-if)#spanning-tree portfast

%Warning: portfast should only be enabled on ports connected to a single

 host. Connecting hubs, concentrators, switches, bridges, etc... to this

 interface  when portfast is enabled, can cause temporary bridging loops.

 Use with CAUTION


%Portfast has been configured on FastEthernet0/1 but will only

 have effect when the interface is in a non-trunking mode.

Sw1(config-if)#exit

Sw1(config)#vlan 30

Sw1(config-vlan)#name G-LAB30

Sw1(config-vlan)#exit

Sw1(config)#int range fa0/2 - 5

Sw1(config-if-range)#sw mode access

Sw1(config-if-range)#sw access vlan 30

Sw1(config-if-range)#end

Sw1#sh vlan brief


VLAN Name                             Status    Ports

---- -------------------------------- --------- -------------------------------

1    default                          active    Fa0/6, Fa0/7, Fa0/8, Fa0/9

                                                Fa0/10

20   G-LAB20                       active    Fa0/1

30   G-LAB30                       active    Fa0/2, Fa0/3, Fa0/4, Fa0/5

1002 fddi-default                     active    

1003 token-ring-default               active    

1004 fddinet-default                  active    

1005 trnet-default                    active    


Sw1(config-if)#int vlan 30

Sw1(config-if)#

Sw1(config-if)#ip address 192.168.30.254 255.255.255.0

Sw1(config-if)#no shutdown

Sw1(config-if)#exit

Sw1(config)#line vty 0 4

Sw1(config-line)#password G-LAB

Sw1(config-line)#login

Sw1(config)#enable secret G-LAB123

Sw1(config)#end

2. 简单验证

1) PC1 IP:192.168.30.23/24

PC2 IP:192.168.30.24/24

2) PC1 连结到Sw1的Fa0/1端口,PC2 连结到Sw1的Fa0/2端口,观察两个端口指示灯变成绿色的时间:

Fa0/1: ___s

Fa0/2: ___s

3) PC1 ping PC2:

C:\Documents and Settings\Joseph>ping 192.168.30.24


Pinging 192.168.30.24 with 32 bytes of data:


Request timed out.

Request timed out.

Request timed out.

Request timed out.


Ping statistics for 192.168.30.24:

    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

4) 将PC1 连结到Sw1的Fa0/3端口,PC1 再ping PC2:

C:\Documents and Settings\Joseph>ping 192.168.30.24


Pinging 192.168.30.24 with 32 bytes of data:


Request timed out.

Reply from 192.168.30.24: bytes=32 time=1ms TTL=64

Reply from 192.168.30.24: bytes=32 time=1ms TTL=64

Reply from 192.168.30.24: bytes=32 time=1ms TTL=64


Ping statistics for 192.168.30.24:

    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 1ms, Maximum = 1ms, Average = 1ms


C:\Documents and Settings\Joseph>telnet 192.168.30.254

Trying 192.168.30.254 ... Open



User Access Verification


Password:

Sw1>en

Password:

Sw1#

Sw1#copy run start

Destination filename [startup-config]?

Building configuration...

Sw1#

Sw1#sh flash:


Directory of flash:/


    2  -rwx     2664051   Mar 01 1993 00:03:19  c2960-i6q4l2-mz.122-11.EA1.bin

    3  -rwx         556   Mar 01 1993 03:56:53  vlan.dat

    4  -rwx         269   Jan 01 1970 00:01:16  env_vars

    5  -rwx         974   Mar 01 1993 03:59:06  config.text

    6  -rwx           5   Mar 01 1993 03:59:06  private-config.text

    7  drwx         704   Mar 01 1993 00:03:55  html

   19  -rwx         109   Mar 01 1993 00:03:56  info

   20  -rwx         109   Mar 01 1993 00:03:56  info.ver

Sw1#delete flash:/vlan.dat

Delete filename [vlan.dat]?

Delete flash:/vlan.dat? [confirm]↙

Sw1#delete flash:/config.text

Delete filename [config.text]?

Delete flash:/config.text? [confirm]↙

Sw1#sh flash:


Directory of flash:/


    2  -rwx     2664051   Mar 01 1993 00:03:19  c2960-i6q4l2-mz.121-11.EA1.bin

    4  -rwx         269   Jan 01 1970 00:01:16  env_vars

    6  -rwx           5   Mar 01 1993 03:59:06  private-config.text

    7  drwx         704   Mar 01 1993 00:03:55  html

   19  -rwx         109   Mar 01 1993 00:03:56  info

   20  -rwx         109   Mar 01 1993 00:03:56  info.ver


7741440 bytes total (3781120 bytes free)

Sw1#reload

Proceed with reload? [confirm]↙


04:06:33: %SYS-5-RELOAD: Reload requested 

C2960 Boot Loader (C2960-HBOOT-M) Version 12.2(11r)EA1, RELEASE SOFTWARE (fc1)

Compiled Mon 22-Jul-02 17:18 by antonino

WS-C2960-24 starting...

Base ethernet MAC Address: 00:0d:29:60:8b:c0

Xmodem file system is available.

Initializing Flash...

flashfs[0]: 16 files, 2 directories

flashfs[0]: 0 orphaned files, 0 orphaned directories

flashfs[0]: Total bytes: 7741440

flashfs[0]: Bytes used: 3960320

flashfs[0]: Bytes available: 3781120

flashfs[0]: flashfs fsck took 6 seconds.

...done initializing flash.

Boot Sector Filesystem (bs:) installed, fsid: 3

Parameter Block Filesystem (pb:) installed, fsid: 4

Loading "flash:/c2960-i6q4l2-mz.122-11.EA1.bin"...#########################################################################################################################################################################################################################################################################################


File "flash:/c2960-i6q4l2-mz.121-11.EA1.bin" uncompressed and installed, entry point: 0x80010000

executing...


              Restricted Rights Legend


Use, duplication, or disclosure by the Government is

subject to restrictions as set forth in subparagraph

(c) of the Commercial Computer Software - Restricted

Rights clause at FAR sec. 52.227-19 and subparagraph

(c) (1) (ii) of the Rights in Technical Data and Computer

Software clause at DFARS sec. 252.227-7013.


           cisco Systems, Inc.

           170 West Tasman Drive

           San Jose, California 95134-1706




Cisco Internetwork Operating System Software

IOS (tm) C2960 Software (C2960-I6Q4L2-M), Version 12.2(11)EA1, RELEASE SOFTWARE (fc1)

Copyright (c) 1986-2007 by cisco Systems, Inc.

Compiled Wed 28-Aug-02 10:25 by antonino

Image text-base: 0x80010000, data-base: 0x80528000



Initializing flashfs...

flashfs[1]: 16 files, 2 directories

flashfs[1]: 0 orphaned files, 0 orphaned directories

flashfs[1]: Total bytes: 7741440

flashfs[1]: Bytes used: 3960320

flashfs[1]: Bytes available: 3781120

flashfs[1]: flashfs fsck took 7 seconds.

flashfs[1]: Initialization complete.

Done initializing flashfs.

POST: System Board Test : Passed

POST: Ethernet Controller Test : Passed

ASIC Initialization Passed


POST: FRONT-END LOOPBACK TEST : Passed

cisco WS-C2960-24 (RC32300) processor (revision J0) with 20402K bytes of memory.

Processor board ID FOC0725Y05M

Last reset from system-reset

Running Standard Image

12 FastEthernet/IEEE 802.3 interface(s)


32K bytes of flash-simulated non-volatile configuration memory.

Base ethernet MAC Address: 00:0D:29:60:8B:C0

Motherboard assembly number: 73-5782-11

Power supply part number: 34-0965-01

Motherboard serial number: FOC07250XZ2

Power supply serial number: DAB07226HJ0

Model revision number: J0

Motherboard revision number: A0

Model number: WS-C2960-24

System serial number: FOC0725Y05M


         --- System Configuration Dialog ---


Would you like to enter the initial configuration dialog? [yes/no]: no↙


Press RETURN to get started!



Switch>

3. 实验完成

【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月08日 0

暂无评论

推荐阅读
  oYd6WBUwpOnX   2023年11月02日   27   0   0 3D2d缩放ios
  Mqh2iumZ9USt   2023年11月02日   30   0   0 #includei++ios
KDk97yxRQlQU