当前位置:   article > 正文

华为 eNSP—交换机配置(三层)_ensp三层交换机

ensp三层交换机

1 先创建如图 的网络拓扑图

1.1 需要设备:

	交换机:S5700(1个)、S3700(2个)、
	终端:PC(8个)
  • 1
  • 2

1.2 按照接口连线:

				所有接口已显示
  • 1

1-1

2 配置 交换机

2.1 LSW6:

关闭配置提示:< Huawei > undo terminal monitor
  • 1

交换机 LSW6

命令行如下( LSW6 ):
The device is running!

<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]vlan 10
[Huawei-vlan10]vlan 20
[Huawei-vlan20]vlan 30
[Huawei-vlan30]vlan 40
[Huawei-vlan40]quit
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[Huawei-GigabitEthernet0/0/1]dis this
#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
#
return
[Huawei-GigabitEthernet0/0/1]int g0/0/2
[Huawei-GigabitEthernet0/0/2]port link-type trunk
[Huawei-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[Huawei-GigabitEthernet0/0/2]q
[Huawei]int vlanif 10
[Huawei-Vlanif10]ip addr 192.14.10.1 24

[Huawei-Vlanif10]int vlanif 20
[Huawei-Vlanif20]ip addr 192.14.20.1 24
[Huawei-Vlanif20]int vlanif 30
[Huawei-Vlanif30]ip addr 192.14.30.1 24
[Huawei-Vlanif30]int vlanif 40
[Huawei-Vlanif40]ip addr 192.14.40.1 24
[Huawei-Vlanif40]q
[Huawei]q
<Huawei>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]:
Mar  8 2022 21:43:37-08:00 Huawei %%01CFM/4/SAVE(l)[12]:The user chose Y when de
ciding whether to save the configuration to the device.
Now saving the current configuration to the slot 0.
Save the configuration successfully.
<Huawei>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43

导出设备配置并保存(重点:不保存,下次打开就会出现丢失配置的情况
在这里插入图片描述

2.2 LSW4、LSW5:

	  两者命令行一样(注意接口变一下) 
  • 1
代码如下( LSW4 ):
The device is running!

<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]vlan 10
[Huawei-vlan10]vlan 20
[Huawei-vlan20]vlan 30
[Huawei-vlan30]vlan 40
[Huawei-vlan40]quit

[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all

[Huawei-GigabitEthernet0/0/1]int e0/0/1
[Huawei-Ethernet0/0/1]port link-type access
[Huawei-Ethernet0/0/1]port def vlan 10

[Huawei-Ethernet0/0/1]int e0/0/2
[Huawei-Ethernet0/0/2]port link-type access
[Huawei-Ethernet0/0/2]port def vlan 10

[Huawei-Ethernet0/0/2]int e0/0/6
[Huawei-Ethernet0/0/6]port link-type access
[Huawei-Ethernet0/0/6]port def vlan 20

[Huawei-Ethernet0/0/6]int e0/0/7
[Huawei-Ethernet0/0/7]port link-type access
[Huawei-Ethernet0/0/7]port def vlan 20

[Huawei-Ethernet0/0/7]q
[Huawei]q
<Huawei>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]:
Mar  8 2022 22:13:40-08:00 Huawei %%01CFM/4/SAVE(l)[4]:The user chose Y when dec
iding whether to save the configuration to the device.
Now saving the current configuration to the slot 0.
Save the configuration successfully.
<Huawei>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
代码如下( LSW5 ):
The device is running!

<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]vlan 10
[Huawei-vlan10]vlan 20
[Huawei-vlan20]vlan 30
[Huawei-vlan30]vlan 40
[Huawei-vlan40]quit

[Huawei]int g0/0/2
[Huawei-GigabitEthernet0/0/2]port link-type trunk
[Huawei-GigabitEthernet0/0/2]port trunk allow-pass vlan all

[Huawei-GigabitEthernet0/0/1]int e0/0/1
[Huawei-Ethernet0/0/1]port link-type access
[Huawei-Ethernet0/0/1]port def vlan 30

[Huawei-Ethernet0/0/1]int e0/0/2
[Huawei-Ethernet0/0/2]port link-type access
[Huawei-Ethernet0/0/2]port def vlan 30

[Huawei-Ethernet0/0/2]int e0/0/6
[Huawei-Ethernet0/0/6]port link-type access
[Huawei-Ethernet0/0/6]port def vlan 40

[Huawei-Ethernet0/0/6]int e0/0/7
[Huawei-Ethernet0/0/7]port link-type access
[Huawei-Ethernet0/0/7]port def vlan 40

[Huawei-Ethernet0/0/7]q
[Huawei]q
<Huawei>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]:
Mar  8 2022 22:13:40-08:00 Huawei %%01CFM/4/SAVE(l)[4]:The user chose Y when dec
iding whether to save the configuration to the device.
Now saving the current configuration to the slot 0.
Save the configuration successfully.
<Huawei>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41

3 配置 终端(PC)

	 【XX:可自己随意设置】
	 VLAN 10: 
	 			PC1(192.XX.10.2)
	 			PC2(192.XX.10.3)
  • 1
  • 2
  • 3
  • 4

PC1-相关配置

	VLAN 20: 
				PC3(192.XX.20.2)
				PC4(192.XX.20.3)
  • 1
  • 2
  • 3

PC3-相关配置

	VLAN 30: 
	 			PC4(192.XX.30.2)
	 			PC5(192.XX.30.3)
	VLAN 40: 
	 			PC6(192.XX.40.2)
	 			PC7(192.XX.40.3)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

4 验证 (ping命令)

	此处用 vlan 30 中的 PC6(192.XX.40.2) 
		分别 ping vlan 10 和 vlan 40
			结果 ping 通 配置完成!
  • 1
  • 2
  • 3

在这里插入图片描述

5 补充 (部分命令意义)

在这里插入图片描述

如果网关设置错了 先删除再配置  
			可用命令 undo ip addr 
  • 1
  • 2

在这里插入图片描述
在这里插入图片描述

导出设备配置并保存(重点:不保存,下次打开就会出现丢失配置的情况

	小编就曾因为没有保存导出配置 
				而重新配置过好几次 引以为戒啊!!!
  • 1
  • 2

在这里插入图片描述

最后的最后 如有问题 欢迎各位指正!!!
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/326854
推荐阅读
  

闽ICP备14008679号