您当前的位置:首页 > 电脑百科 > 网络技术 > 网络设置

Switch基本配置

时间:2022-07-12 15:24:14  来源:  作者:郭主任讲网络

实验目的:

l配置交换机的基本命令

实验说明:

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

实验拓扑图:

Switch基本配置

 

实验步骤:

1. 了解基本配置

Sw1#configure terminal

Sw1(config)# interface fastethe.NET0/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 notconnect 1 half 10 10/100BaseTX

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 SettingsJoseph>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 SettingsJoseph>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 SettingsJoseph>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>



Tags:Switch   点击:()  评论:()
声明:本站部分内容及图片来自互联网,转载是出于传递更多信息之目的,内容观点仅代表作者本人,不构成投资建议。投资者据此操作,风险自担。如有任何标注错误或版权侵犯请与我们联系,我们将及时更正、删除。
▌相关推荐
腾讯首款自研 Switch 游戏上线:《腾讯扣叮-编程第一课》
IT之家 4 月 11 日消息,腾讯 Nintendo Switch 今日官宣,Nintendo Switch 趣味编程学习软件 ——《腾讯扣叮-编程第一课》已于今日上架 Nintendo e 商店,建议零售价 4...【详细内容】
2024-04-11  Search: Switch  点击:(6)  评论:(0)  加入收藏
Go中的switch的六种使用:没有你想象中那么简单
Go以其简洁而著称,但并不是每个人都熟悉这种语言中switch语句的多样性。首先,如果你对Go的switch语句还不熟悉,它可能与其他语言相比有些不同。下面是一个简单的示例来展示它是...【详细内容】
2023-12-04  Search: Switch  点击:(172)  评论:(0)  加入收藏
switch联网连不上怎么解决?switch联网问题这样解决
由MBAInternational开发的横版卷轴冒险游戏《游吧!!萨卡班甲鱼!!一起向远方游去》,将于11 月21日在Switch上推出。游戏中玩家将操作一脸呆萌样的表情包“萨卡班甲鱼”,在海底进行...【详细内容】
2023-11-14  Search: Switch  点击:(87)  评论:(0)  加入收藏
国行Switch最火游戏榜出炉:《只只大冒险》第一 任天堂自家游戏遇冷
快科技8月21日消息,腾讯NintendoSwitch今日公布了2023年上半年国行Switch e商店游戏人气排行榜,比较意外的是任天堂第一方作品无一上榜。榜单前10名游戏如下:1、《只只大冒险》...【详细内容】
2023-08-21  Search: Switch  点击:(103)  评论:(0)  加入收藏
任天堂下一代Switch将涨价至399美元:或明年发布
快科技8月10日消息,综合各方信息来看,任天堂Switch已经越来越近了。据海外爆料者最新消息,新一代Switch将涨价,售价定位399.99美元(约合2882元人民币)。任天堂认为,这是一个“黄金...【详细内容】
2023-08-10  Search: Switch  点击:(114)  评论:(0)  加入收藏
解密C语言中的Switch语句:从基础使用到高级技巧
在C语言中,Switch语句是一种功能强大且经常被使用的条件控制结构。它通过匹配多个条件,根据不同的情况执行相应的代码块。本文将带领您深入探讨Switch语句的各个方面,从基础使...【详细内容】
2023-08-08  Search: Switch  点击:(297)  评论:(0)  加入收藏
锈湖游戏即将登陆Switch平台,支持中文
据悉,锈湖(Rusty Lake)双人解谜游戏《The Past Within》将于7月6日登陆任天堂Switch平台,并支持中文。该游戏去年已在PC、Mac、iOS、Android平台上线。 《The Past Within》是锈...【详细内容】
2023-06-26  Search: Switch  点击:(92)  评论:(0)  加入收藏
Steam好评如潮《神之天平》Switch版已提交审核 DLC预计2023年发售
Steam好评如潮《神之天平》Switch版已提交审核 DLC预计2023年发售动作RPG游戏《神之天平》发布新开发博文,公布了游戏的后续研发进度,其中包括Switch版的新消息,该作此前于2022...【详细内容】
2023-05-29  Search: Switch  点击:(140)  评论:(0)  加入收藏
《王国之泪》掉帧严重怎么破?超频Switch教程来了,稳定30帧运行
萧箫 发自 凹非寺量子位 | 公众号 QbitAI《塞尔达传说王国之泪》简直爆火,相比之下Switch有点“带不动”它了。这不,就在游戏发售后,不少玩家发现它最大的问题是掉帧严重,尤其是...【详细内容】
2023-05-17  Search: Switch  点击:(297)  评论:(0)  加入收藏
性能平均提升50%!Switch模拟器Yuzu新版表现惊艳
快科技5月15日消息,近日,PC端的Switch模拟器Yuzu进行了一次更新迭代,在性能方面获得了堪称惊艳的提升。从更新日志来看,新版Yuzu对原有的缓冲区缓存代码进行了重写,这让模拟器在...【详细内容】
2023-05-15  Search: Switch  点击:(100)  评论:(0)  加入收藏
▌简易百科推荐
iPhone或iPad用户必学:如何通过二维码快速共享Wi-Fi密码,简单又实用!
你有没有想过在不泄露网络密码的情况下与客人共享你的家庭或工作Wi-Fi?你肯定不是第一个这样想的人,我们很高兴地通知你,多亏了以下这个的变通方法,你现在可以使用iPhone或iPad...【详细内容】
2024-01-22  驾驭信息纵横科技    Tags:Wi-Fi密码   点击:(74)  评论:(0)  加入收藏
Windows 11网络连接问题诊断与解决小技巧,轻松解决上网问题!
在日常生活中,如果在连接网络时遇到问题,该如何排查解决?以下是一些故障排除步骤,可帮助你解决戴尔电脑上的无线网络连接问题。一起来看看吧!1、进行基本检查先进行一些基本检查...【详细内容】
2024-01-12  戴尔维修工程师    Tags:   点击:(59)  评论:(0)  加入收藏
配置Cisco AnyConnect VPN的5个步骤,缺一不可
随着越来越多的人远程工作或在混合环境中工作,IT部门和MSP在ASA防火墙上配置Cisco AnyConnect VPN的呼声越来越高。但是Cisco文档可能会非常混乱,这会导致一些组织的配置错误(...【详细内容】
2023-11-14  驾驭信息纵横科技    Tags:VPN   点击:(96)  评论:(0)  加入收藏
如何在Windows 10系统上设置DNS?
如果你正在使用Windows10操作系统,并且想要更好地控制你的网络服务,那么了解如何设置DNS(DomainNameSystem)是非常重要的。DNS是一种将域名解析为IP地址的服务,它能够让你在访问...【详细内容】
2023-11-10  高梦文    Tags:DNS   点击:(197)  评论:(0)  加入收藏
RabbitMQ发送和接收消息的几种方式
channel.basicQos(0, 1, false):0表示对消息的大小无限制,1表示每次只允许消费一条,false表示该限制不作用于channel。同时,我们采用手工ACK的方式,因为我们配置文件配置了 spri...【详细内容】
2023-11-08  程序猿羊  微信公众号  Tags:RabbitMQ   点击:(264)  评论:(0)  加入收藏
CISA发布十大常见网络安全错误配置
美国国家安全局(NSA)和网络安全与基础设施安全局(CISA)在本周五的报告中公布了其红队和蓝队在大型组织网络中发现的十大最常见网络安全误配置。NSA和CISA在安全建议中详细说...【详细内容】
2023-11-07  GoUpSec  微信公众号  Tags:CISA   点击:(262)  评论:(0)  加入收藏
Istio Envoy 配置解读,看这篇就够了
前面我们创建了一个 Gateway 和 VirtualService 对象,用来对外暴露应用,然后我们就可以通过 ingressgateway 来访问 Bookinfo 应用了。那么这两个资源对象是如何实现的呢?Gatew...【详细内容】
2023-11-07  k8s技术圈  微信公众号  Tags:Istio Envoy   点击:(130)  评论:(0)  加入收藏
RabbitMQ的四种交换机详解
交换机主要是接收消息并且转发到绑定的队列,交换机不存储消息,在启用ack模式后,交换机找不到队列会返回错误。交换机有四种类型:Direct, topic, Headers and Fanout。图片一、to...【详细内容】
2023-11-06  程序猿小杨  微信公众号  Tags:交换机   点击:(267)  评论:(0)  加入收藏
路由器配置NAT/UPNP/DMZ方法
常见路由器配置NAT(网络地址转换)、UPnP(通用即插即用)和DMZ(区域暴露)的方法可以根据不同的路由器品牌和型号有所不同,但通常会在路由器的管理界面中找到相关设置。以下是一般步骤...【详细内容】
2023-10-11  晴间多云  今日头条  Tags:路由器配置   点击:(423)  评论:(0)  加入收藏
路由器如何正确安装?后台设置一步即可接入宽带
现在的路由器不论安装还是后台设置都非常方便,但一些网友可能是没有详细了解过相关的知识,所以每次想要更换路由器或者新装路由器的时候并不知道如何安装路由器接入自家宽带,这...【详细内容】
2023-09-21  羽度非凡    Tags:路由器   点击:(304)  评论:(0)  加入收藏
站内最新
站内热门
站内头条