网络应用基础交换机(NETBASE第五课)
交换机的定义
交换是按照通信两端传输信息的需要,用人工或设备自动完成的方法,把要传输的信息送到符合要求的相应路由上的技术的统称。交换机根据工作位置的不同,可以分为广域网交换机和局域网交换机。广域的交换机就是一种在通信系统中完成信息交换功能的设备,它应用在数据链路层。交换机有多个端口,每个端口都具有桥接功能,可以连接一个局域网或一台高性能服务器或工作站。实际上,交换机有时被称为多端口网桥。
网络交换机,是一个扩大网络的器材,能为子网络中提供更多的连接端口,以便连接更多的计算机。随着通信业的发展以及国民经济信息化的推进,网络交换机市场呈稳步上升态势。它具有性价比高、高度灵活、相对简单和易于实现等特点。以太网技术已成为当今最重要的一种局域网组网技术,网络交换机也就成为了最普及的交换机。 [1]
Switch是交换机的英文名称,这个产品是由原集线器的升级换代而来,在外观上看和集线器没有很大区别。由于通信两端需要传输信息,而通过设备或者人工来把要传输的信息送到符合要求标准的对应的路由器上的方式,这个技术就是交换机技术。从广义上来分析,在通信系统里对于信息交换功能实现的设备,就是交换机。 [2]
1)作用
用于将多台计算机/交换机连接到一起,组建网络
交换机负责为其中任意两台计算机提供独享线路进行通信
连接电脑组建局域网(组建局域网的主要设备)
2)类型
非网管(即插即用),便宜,不可管理
网管(智能),较贵,可以方便管理(隔离、限速、ACL、堆叠)
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., LTDQuidway 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.
22 重启设备
<swith1>reboot
Info: The system is now comparing the configuration, please wait.
Warning: All the configuration will be saved to the configuration file for the n
ext startup:, Continue?[Y/N]:y
Now saving the current configuration to the slot 0.
Save the configuration successfully.
Info: If want to reboot with saving diagnostic information, input 'N' and then e
xecute 'reboot save diagnostic-information'.
System will reboot! Continue?[Y/N]:Y
Jul 8 2023 16:43:18-08:00 swith1 %%01CMD/4/REBOOT(l)[1]:The user chose Y when d
eciding whether to reboot the system. (Task=co0, Ip=**, User=**)
<swith1>
Jul 8 2023 16:43:18-08:00 swith1 %%01IFNET/4/BOARD_DISABLE(l)[2]:Board 0 has be
en unavailable.
Jul 8 2023 16:43:18-08:00 swith1 %%01IFPDT/4/IF_STATE(l)[3]:GigabitEthernet0/0/
1 has turned into DOWN state.
Jul 8 2023 16:43:18-08:00 swith1 %%01IFNET/4/IF_DISABLE(l)[4]:Interface Gigabit
Ethernet0/0/1 has been unavailable.
Jul 8 2023 16:43:18-08:00 swith1 %%01IFPDT/4/IF_STATE(l)[5]:GigabitEthernet0/0/
2 has turned into DOWN state.
Jul 8 2023 16:43:18-08:00 swith1 %%01IFNET/4/IF_DISABLE(l)[6]:Interface Gigabit
Ethernet0/0/2 has been unavailable.
Jul 8 2023 16:43:18-08:00 swith1 %%01IFPDT/4/IF_STATE(l)[7]:GigabitEthernet0/0/
3 has turned into DOWN state.
Jul 8 2023 16:43:18-08:00 swith1 %%01IFNET/4/IF_DISABLE(l)[8]:Interface Gigabit
Ethernet0/0/3 has been unavailable.
Jul 8 2023 16:43:18-08:00 swith1 %%01IFNET/4/IF_STATE(l)[9]:Interface Vlanif1 h
as turned into DOWN state.
Jul 8 2023 16:43:18-08:00 swith1 %%01IFPDT/4/IF_STATE(l)[10]:GigabitEthernet0/0
/4 has turned into DOWN state.
Jul 8 2023 16:43:18-08:00 swith1 %%01IFNET/4/IF_DISABLE(l)[11]:Interface Gigabi
tEthernet0/0/4 has been unavailable.
Jul 8 2023 16:43:18-08:00 swith1 %%01IFNET/4/IF_DISABLE(l)[12]:Interface Gigabi
tEthernet0/0/5 has been unavailable.
Jul 8 2023 16:43:18-08:00 swith1 %%01IFNET/4/IF_DISABLE(l)[13]:Interfa
22 [SW1]user-interface console 0 //进入终端进行配置
[SW1-ui-console0]authentication-mode password //启用密码认证
[SW1-ui-console0]set authentication password cipher 123456 //设置终端密码为123456(密文)**想要验证密码,在用户视图中直接敲入quit
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
#
interface GigabitEthernet0/0/3
#
interface GigabitEthernet0/0/4
#
interface GigabitEthernet0/0/5
#
interface GigabitEthernet0/0/6
#
interface GigabitEthernet0/0/7
#
interface GigabitEthernet0/0/8
#
interface GigabitEthernet0/0/9
#
interface GigabitEthernet0/0/10
#
interface GigabitEthernet0/0/11
[Huawei]dis
[Huawei]display in
[Huawei]display increment-command
Error: Please execute this command on the administrator switch.
[Huawei]dis
[Huawei]display
^
Error:Incomplete command found at '^' position.
[Huawei]
<Huawei>
<Huawei>dis
<Huawei>display cuur
<Huawei>display cur
<Huawei>display current-configuration
#
sysname Huawei
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
drop-profile default
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password simple admin
local-user admin service-type http
#
interface Vlanif1
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
#
interface GigabitEthernet0/0/3
#
interface GigabitEthernet0/0/4
#
interface GigabitEthernet0/0/5
#
interface GigabitEthernet0/0/6
#
interface GigabitEthernet0/0/7
#
interface GigabitEthernet0/0/8
#
interface GigabitEthernet0/0/9
#
interface GigabitEthernet0/0/10
#
interface GigabitEthernet0/0/11
#
interface GigabitEthernet0/0/12
#
interface GigabitEthernet0/0/13
#
interface GigabitEthernet0/0/14
#
interface GigabitEthernet0/0/15
#
interface GigabitEthernet0/0/16
#
interface GigabitEthernet0/0/17
#
interface GigabitEthernet0/0/18
#
interface GigabitEthernet0/0/19
#
interface GigabitEthernet0/0/20
#
interface GigabitEthernet0/0/21
#
interface GigabitEthernet0/0/22
#
interface GigabitEthernet0/0/23
#
interface GigabitEthernet0/0/24
#
interface NULL0
#
ospf 1
#
user-interface con 0
user-interface vty 0 4
#
return
<Huawei>
<Huawei>
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]in
[Huawei]info-center
^
Error:Incomplete command found at '^' position.
[Huawei]inter
[Huawei]interface g0/0/1
[Huawei-GigabitEthernet0/0/1]
Jul 8 2023 17:21:53-08:00 Huawei %%01PHY/1/PHY(l)[0]: GigabitEthernet0/0/2:
change status to down
Jul 8 2023 17:21:54-08:00 Huawei %%01PHY/1/PHY(l)[1]: GigabitEthernet0/0/2:
change status to up
[Huawei-GigabitEthernet0/0/1]dis
[Huawei-GigabitEthernet0/0/1]display this
#
interface GigabitEthernet0/0/1
#
return
[Huawei-GigabitEthernet0/0/1]
<Huawei>dis ver
<Huawei>dis 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, 0 hour, 9 minutes
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysn
[Huawei]sysname s1
[Huawei]sysname s1
[s1]
Jul 8 2023 17:23:29-08:00 s1 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 5, the ch
ange loop count is 0, and the maximum number of records is 4095.
[s1]
[s1]
[s1]
[s1]
[s1]
[s1]
[s1]
[s1]user
[s1]user-in
[s1]user-interface co
[s1]user-interface console 0
[s1]user-interface console 0
[s1-ui-console0]aus
[s1-ui-console0]aut
[s1-ui-console0]authentication-mode pa
[s1-ui-console0]authentication-mode password
[s1-ui-console0]
[s1-ui-console0]
Jul 8 2023 17:24:29-08:00 s1 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 6, the ch
ange loop count is 0, and the maximum number of records is 4095.
[s1-ui-console0]set au
[s1-ui-console0]set authentication p
[s1-ui-console0]set authentication password ci
[s1-ui-console0]set authentication password cipher 123
[s1-ui-console0]
[s1-ui-console0]
[s1-ui-console0]
Jul 8 2023 17:24:59-08:00 s1 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 7, the ch
ange loop count is 0, and the maximum number of records is 4095.
[s1-ui-console0]
[s1-ui-console0]quit
[s1-ui-console0]quit
[s1]
[s1]
[s1]
[s1]
[s1]quit
[s1]quit
<s1>
<s1>
<s1>
<s1>sys
Enter system view, return user view with Ctrl+Z.
[s1]
<s1>
<s1>QUIT User interface con0 is available