1.7 VLAN案例设计(华为)

本实验旨在通过构建一个复杂的企业网络拓扑,帮助学生掌握VLAN的高级配置技能,包括多交换机环境下的VLAN划分、主干链路配置以及不同型号交换机的互联。通过完成本实验,学生将能够理解并应用企业级网络中的VLAN设计原则。

校园网案例
实现各个楼之间互连,为了简化起见,设计时省略主楼和办公楼中的终端,每个教室中用两台终端作为示例。 要求:完成VLAN划分和端口配置,实现VLAN内部通信。

在VLAN配置过程中,有时需要撤销或修改已有的配置。华为交换机提供了undo命令来实现这一功能。以下是一些常用的撤销操作:

text

# 设置接口类型为 access
port link-type access

# 撤销接口类型设置
undo port link-type

text

# 设置接口类型为 access,并划分给 vlan 2
port link-type access
port default vlan 2

# 撤销上述操作
undo port default 
undo port link-type

text

# 设置接口类型为 trunk,并将接口共享给 vlan 2 和 vlan 3
port link-type access
port trunk allow-pass vlan 2 3

# 撤销上述操作(先撤销共享,再撤销类型)
undo port allow-pass vlan 2 3
undo port link-type
配置顺序
在撤销配置时,通常需要按照与配置相反的顺序进行。例如,先撤销VLAN分配,再撤销端口类型。这样可以避免因依赖关系导致的错误。
  1. 根据“设备类型表”及“拓扑图”,使用 eNSP 软件建立拓扑
  2. 根据“VLAN与交换机端口映射表”及“拓扑图”,划分VLAN
类型 设备名
终端 PC PC1 ~ 10
交换机 S3700 LSW1 ~ 5、LSW9
交换机 S5700 LSW6、LSW7、LSW8
终端 Server Server1 ~ 4

拓扑图

接口类型说明
S5700系列交换机(LSW6、LSW7、LSW8)的接口名称以GigabitEthernet开头,这是千兆以太网接口。而S3700系列交换机的接口名称以Ethernet开头。在配置时需要使用正确的接口名称。

text

system-view

vlan batch 2 3 

interface e0/0/1
port link-type access
port default vlan 2
quit

interface e0/0/2
port link-type access
port default vlan 3
quit

interface e0/0/3
port link-type trunk
port trunk allow-pass vlan 2 3
quit

text

system-view

vlan batch 3 4

interface e0/0/1
port link-type access
port default vlan 3
quit

interface e0/0/2
port link-type access
port default vlan 4
quit

interface e0/0/3
port link-type trunk
port trunk allow-pass vlan 3 4
quit

text

system-view

vlan batch 4 5

interface e0/0/1
port link-type access
port default vlan 4
quit

interface e0/0/2
port link-type access
port default vlan 5
quit

interface e0/0/3
port link-type trunk
port trunk allow-pass vlan 4 5
quit

text

system-view

vlan batch 6 7

interface e0/0/1
port link-type access
port default vlan 6
quit

interface e0/0/2
port link-type access
port default vlan 7
quit

interface e0/0/3
port link-type trunk
port trunk allow-pass vlan 6 7
quit

text

system-view

vlan batch 7 8

interface e0/0/1
port link-type access
port default vlan 7
quit

interface e0/0/2
port link-type access
port default vlan 8
quit

interface e0/0/3
port link-type trunk
port trunk allow-pass vlan 7 8
quit

text

system-view

vlan batch 2 3 4 5 13

interface g0/0/1
port link-type trunk
port trunk allow-pass vlan 2 3
quit

interface g0/0/2
port link-type trunk
port trunk allow-pass vlan 3 4
quit

interface g0/0/3
port link-type trunk
port trunk allow-pass vlan 4 5
quit

interface g0/0/4
port link-type access
port default vlan 13
quit

text

system-view

vlan batch 6 7 8 14

interface g0/0/1
port link-type trunk
port trunk allow-pass vlan 6 7
quit

interface g0/0/2
port link-type trunk
port trunk allow-pass vlan 7 8
quit

interface g0/0/3
port link-type access
port default vlan 14
quit

text

system-view

vlan batch 9 10 11 12 13 14

interface g0/0/1
port link-type access
port default vlan 13
quit

interface g0/0/2
port link-type access
port default vlan 14
quit

interface g0/0/3
port link-type trunk
port trunk allow-pass vlan 9 10 11 12
quit

text

system-view

vlan batch 9 10 11 12

interface e0/0/1
port link-type access
port default vlan 9
quit

interface e0/0/2
port link-type access
port default vlan 10
quit

interface e0/0/3
port link-type access
port default vlan 11
quit

interface e0/0/4
port link-type access
port default vlan 12
quit

相关内容