基于mac地直划分vlan实现不同vlan间数据传输

1.模型构建

实验目地:通过mac地址划分vlan,然后通过创新虚拟接口实现不同vlan间主机通信。mac地址对照表如下:

|-----|----------------|
| 主机 | mac地址 |
| pc1 | 5489-98be-2cf8 |
| pc2 | 5489-9831-4830 |
| pc3 | 5489-981f-364f |
| pc4 | 5489-988c-7d7d |
| pc5 | 5489-98d8-028c |
| pc6 | 5489-9860-5a6d |

2.具体步骤

2.1首先在LSW8,LSW9上通过mac划分vlan,

具体步骤:1.创建vlan 10 、20.

2.进入对应vlan将所属pc进行mac地址绑定。(pc1,pc2,pc4,pc5绑定在vlan 10中,其绑定在vlan 20中)

3.设置对应端口向下数据传输时要去掉vlan标签

复制代码
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei]vlan 10
[Huawei-vlan10]mac-vlan mac-address 5489-98be-2cf8
[Huawei-vlan10]mac-vlan mac-address 5489-9831-4830
[Huawei-vlan10]quit
[Huawei]vlan 20
[Huawei-vlan20]mac-vlan mac-address 5489-981f-364f
[Huawei-vlan20]quit
[Huawei]interface Ethernet 0/0/1
[Huawei-Ethernet0/0/1]port hybrid untagged vlan 10 20
[Huawei-Ethernet0/0/1]quit

[Huawei]interface Ethernet 0/0/2
[Huawei-Ethernet0/0/2]port hybrid untagged vlan 10 20
[Huawei-Ethernet0/0/2]quit

[Huawei]interface Ethernet 0/0/3
[Huawei-Ethernet0/0/3]port hybrid untagged vlan 10 20
[Huawei-Ethernet0/0/3]quit
[Huawei]interface GigabitEthernet 0/0/1
[Huawei-GigabitEthernet0/0/1]port hybrid tagged vlan 10 20
[Huawei-GigabitEthernet0/0/1]quit

4.使能mac-vlan功能

复制代码
[Huawei]interface Ethernet 0/0/1
[Huawei-Ethernet0/0/1]mac-vlan enable
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei-Ethernet0/0/1]quit

[Huawei]interface Ethernet 0/0/2
[Huawei-Ethernet0/0/2]mac-vlan enable
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei-Ethernet0/0/2] User interface con0 is available
[Huawei-Ethernet0/0/3]quit

[Huawei]interface Ethernet 0/0/3
[Huawei-Ethernet0/0/3]mac-vlan enable
Info: This operation may take a few seconds. Please wait for a moment...done.

LSW9配置与LSW8类似。

2.2 路由交换机配置

要实现不同vlan间通信需要对vlan创建相应SVI并配置ip地址,另外还需要对端口进行配置(干道链路配置:1.使用trunk接口进行配置,2.使用hybrid接口进行配置)

复制代码
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.

[Huawei]interface GigabitEthernet 0/0/1
[Huawei-GigabitEthernet0/0/1]port hybrid tagged vlan 10 20
[Huawei-GigabitEthernet0/0/1]quit

[Huawei]interface GigabitEThernet 0/0/2
[Huawei-GigabitEthernet0/0/2]port hybrid tagged vlan 10 20
[Huawei-GigabitEthernet0/0/2]quit
[Huawei]interface vlanif 10
[Huawei-Vlanif10]ip address 192.168.64.254 24
[Huawei-Vlanif10]quit
[Huawei]interface vlanif 20
[Huawei-Vlanif20]ip address 192.168.65.254 255.255.255.0
[Huawei-Vlanif20]quit
[Huawei] User interface con0 is available

3.实验结果

|-----|-----|---|
| pc1 | pc2 | 通 |
| pc1 | pc3 | 通 |
| pc1 | pc4 | 通 |
| pc3 | pc6 | 通 |

相关推荐
LHR_friendship4 天前
HCIP课程全部内容
网络·笔记·学习·hcip·华为ensp
Neolnfra6 个月前
华为ensp交换机与路由器常用命令速查手册
网络协议·ensp·华为ensp
bedynamic10 个月前
使用BGP实现不同AS之间的通信
网络·华为ensp
bedynamic10 个月前
使用OSPF协议构建园区网
网络·华为ensp
lifejump1 年前
HUAWEI交换机配置镜像口验证(eNSP)
网络·华为·ensp·华为ensp·路由交换
lifejump1 年前
防火墙高可用(HA)主备验证实验(eNSP)
服务器·网络·华为ensp·路由交换
亚力山大抵2 年前
网络学习第二篇
网关·计算机网络·华为ensp
豪杰笑开怀3 年前
华为eNSP配置专题-NAT的配置
网络·华为·智能路由器·华为ensp
豪杰笑开怀3 年前
华为eNSP配置专题-ACL的配置
华为·智能路由器·网络工程师·华为ensp