网络应用基础交换机(NETBASE第五课)
交换机的定义
交换是按照通信两端传输信息的需要,用人工或设备自动完成的方法,把要传输的信息送到符合要求的相应路由上的技术的统称。交换机根据工作位置的不同,可以分为广域网交换机和局域网交换机。广域的交换机就是一种在通信系统中完成信息交换功能的设备,它应用在数据链路层。交换机有多个端口,每个端口都具有桥接功能,可以连接一个局域网或一台高性能服务器或工作站。实际上,交换机有时被称为多端口网桥。
网络交换机,是一个扩大网络的器材,能为子网络中提供更多的连接端口,以便连接更多的计算机。随着通信业的发展以及国民经济信息化的推进,网络交换机市场呈稳步上升态势。它具有性价比高、高度灵活、相对简单和易于实现等特点。以太网技术已成为当今最重要的一种局域网组网技术,网络交换机也就成为了最普及的交换机。 [1]
Switch是交换机的英文名称,这个产品是由原集线器的升级换代而来,在外观上看和集线器没有很大区别。由于通信两端需要传输信息,而通过设备或者人工来把要传输的信息送到符合要求标准的对应的路由器上的方式,这个技术就是交换机技术。从广义上来分析,在通信系统里对于信息交换功能实现的设备,就是交换机。 [2]
1)作用
用于将多台计算机/交换机连接到一起,组建网络
交换机负责为其中任意两台计算机提供独享线路进行通信
连接电脑组建局域网(组建局域网的主要设备)
2)类型
非网管(即插即用),便宜,不可管理
网管(智能),较贵,可以方便管理(隔离、限速、ACL、堆叠)
1 ENSP的视图转换的基本命令
1 <Huawei> //用户视图 输入system-wiew 2 [Huawei] //系统视图 输入 interface GigabitEthernet 0/0/1 3 [Huaiwei-GigabitEthernet0/0/1] //接口视图 4 reture 返回主视图 直接返回到用户视图 5 cyr+z 返回上一级 直接返回到用户视图 6 ping 192.168.1.2 //查看网络的联通性
ENSP视图的操作代码命令如下所示
4 <Huawei>sys Enter system view, return user view with Ctrl+Z. [Huawei] //系统的视图
5 [Huawei]interface GigabitEthernet 0/0/1 [Huawei-GigabitEthernet0/0/1] //进接口视图
6 [Huawei-GigabitEthernet0/0/1]quit [Huawei] //返回上一级
7 <Huawei>sys Enter system view, return user view with Ctrl+Z. [Huawei]ospf [Huawei-ospf-1] //协议视图
8 技巧一 输入字母加? <Huawei>s? save schedule screen-length screen-width send set stack start-script startup super system-view <Huawei>s
9 [Huawei]interface GigabitEthernet 0/0/1 [Huawei-GigabitEthernet0/0/1] //进入接口视图 接口为 0/0/1
10 技巧二 输入命令 按住Tab键 [Huawei]int [Huawei]interface g [Huawei]interface GigabitEthernet 0/0/1 [Huawei-GigabitEthernet0/0/1]
11 <Huawei>sy Enter system view, return user view with Ctrl+Z. [Huawei] //命令简写 [Huawei]int g0/0/1 [Huawei-GigabitEthernet0/0/1] //命令简写
12 交换机的基本配置 查看配置信息 <Huawei> <Huawei>dis <Huawei>display curr <Huawei>display current-configuration
13 <Huawei>dis <Huawei>display ver <Huawei>display version Huawei Versatile Routing Platform Software VRP (R) software, Version 5.110 (S5700 V200R001C00) Copyright (c) 2000-2011 HUAWEI TECH CO., LTD Quidway S5700-28C-HI Routing Switch uptime is 0 week, 0 day, 1 hour, 32 minutes
14 在系统视图下更改视图的名字 [Huawei]sysn [Huawei]sysname Swith1 改名字 [Swith1] 查询命令 [swith1]dis [swith1]display curr [swith1]display current-configuration # sysname swith1
15 PC>ipconfig Link local IPv6 address...........: fe80::5689:98ff:feda:4877 IPv6 address......................: :: / 128 IPv6 gateway......................: :: IPv4 address......................: 191.168.1.1 Subnet mask.......................: 255.255.255.0 Gateway...........................: 0.0.0.0 Physical address..................: 54-89-98-DA-48-77 DNS server........................:
16 PC>ipconfig Link local IPv6 address...........: fe80::5689:98ff:feda:4877 IPv6 address......................: :: / 128 IPv6 gateway......................: :: IPv4 address......................: 191.168.1.2 Subnet mask.......................: 255.255.255.0 Gateway...........................: 0.0.0.0 Physical address..................: 54-89-98-DA-48-77 DNS server........................:
17 PC>ipconfig Link local IPv6 address...........: fe80::5689:98ff:fea6:27a8 IPv6 address......................: :: / 128 IPv6 gateway......................: :: IPv4 address......................: 192.168.1.4 Subnet mask.......................: 255.255.255.0 Gateway...........................: 0.0.0.0 Physical address..................: 54-89-98-A6-27-A8 DNS server................
18 [swith1]interface g0/0/ //shutdown 禁用接口 Jul 8 2023 16:08:19-08:00 swith1 %%01PHY/1/PHY(l)[2]: GigabitEthernet0/0/2: change status to down2 Jul 8 2023 16:08:20-08:00 swith1 %%01PHY/1/PHY(l)[3]: GigabitEthernet0/0/2: change status to up [swith1-GigabitEthernet0/0/2] shout [swith1-GigabitEthernet0/0/2] shoutshoutdown ^ Error: Unrecognized command found at '^' position. [swith1-GigabitEthernet0/0/2]shut [swith1-GigabitEthernet0/0/2]shutdown [swith1-GigabitEthernet0/0/2] Jul 8 2023 16:08:42-08:00 swith1 %%01PHY/1/PHY(l)[4]: GigabitEthernet0/0/2: change status to down Jul 8 2023 16:08:50-08:00 swith1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5 .25.191.3.1 configurations have been changed. The current change number is 8, th e change loop count is 0, and the maximum number of records is 4095. [swith1-GigabitEthernet0/0/2]
19 Enter system view, return user view with Ctrl+Z. //启用接口 [swith1] int [swith1]interface g0/0/2 [swith1-GigabitEthernet0/0/2]undo [swith1-GigabitEthernet0/0/2]undo shutdown [swith1-GigabitEthernet0/0/2] Jul 8 2023 16:11:54-08:00 swith1 %%01PHY/1/PHY(l)[5]: GigabitEthernet0/0/2: change status to up
20 swith1]int [swith1]interface g0/0/2 [swith1]interface g0/0/2 [swith1-GigabitEthernet0/0/2]dis [swith1-GigabitEthernet0/0/2]display this # interface GigabitEthernet0/0/2 # return [swith1-GigabitEthernet0/0/2] sh [swith1-GigabitEthernet0/0/2]shutdown [swith1-GigabitEthernet0/0/2] Jul 8 2023 16:15:39-08:00 swith1 %%01PHY/1/PHY(l)[6]: GigabitEthernet0/0/2: change status to down Jul 8 2023 16:15:40-08:00 swith1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5 .25.191.3.1 configurations have been changed. The current change number is 10, t he change loop count is 0, and the maximum number of records is 4095.d Error: Input "dot1x enable" to enable 802.1x. [swith1-GigabitEthernet0/0/2]dis [swith1-GigabitEthernet0/0/2]display this # interface GigabitEthernet0/0/2 shutdown # return [swith1-GigabitEthernet0/0/2]
21 <swith1> save //保存命令 The current configuration will be written to the device. Are you sure to continue?[Y/N]Y Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]: Jul 8 2023 16:39:13-08:00 swith1 %%01CFM/4/SAVE(l)[0]:The user chose Y when dec iding whether to save the configuration to the device.