简单组网(根据MAC地址划分VLAN)

某个公司的网络中,网络管理者将同一部门的员工划分到同一 VLAN。为了提高部门内的信息安全,要求只有本部门员工的 PC 才可以访问公司服务器。

1、拓扑图

简要说明:

服务器server1属于vlan101,只有属于vlan101的用户才能访问。

为了提高安全,使用mac地址划分vlan,只有PC1、PC2、PC3的电脑才可以访问服务器。

PC4接入到交换机的1、2、3接口上,并不能访问服务器,实现了信息安全。

image

2、交换机接口配置

<Huawei>undo terminal monitor
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname SWA
[SWA]vlan 101
[SWA-vlan101]quit
[SWA]int g0/0/1
[SWA-GigabitEthernet0/0/1]port hybrid untagged vlan 101
[SWA-GigabitEthernet0/0/1]quit
[SWA]int g0/0/2
[SWA-GigabitEthernet0/0/2]port hybrid untagged vlan 101
[SWA-GigabitEthernet0/0/2]quit
[SWA]int g0/0/3
[SWA-GigabitEthernet0/0/3]port hybrid untagged vlan 101
[SWA-GigabitEthernet0/0/3]quit
[SWA]int g0/0/24
[SWA-GigabitEthernet0/0/24]port link-type access
[SWA-GigabitEthernet0/0/24]port default vlan 101
[SWA-GigabitEthernet0/0/24]quit

3、PC的MAC地址与VLAN101关联

[SWA]vlan 101
[SWA-vlan101] mac-vlan mac-address 5489-9822-36c7 priority 0
[SWA-vlan101] mac-vlan mac-address 5489-98dd-7928 priority 0
[SWA-vlan101] mac-vlan mac-address 5489-98cd-4fed priority 0
[SWA-vlan101]quit
[SWA]

4、使能接口的基于 MAC 地址划分 VLAN 功能

[SWA]int g0/0/1
[SWA-GigabitEthernet0/0/1]mac-vlan enable
Info: This operation may take a few seconds. Please wait for a moment...done.
[SWA-GigabitEthernet0/0/1]quit
[SWA]int g0/0/2
[SWA-GigabitEthernet0/0/2]mac-vlan enable
Info: This operation may take a few seconds. Please wait for a moment...done.
[SWA-GigabitEthernet0/0/2]quit
[SWA]int g0/0/3
[SWA-GigabitEthernet0/0/3]mac-vlan enable
Info: This operation may take a few seconds. Please wait for a moment...done.
[SWA-GigabitEthernet0/0/3]quit
[SWA]

5、测试

目前正常情况下PC1、PC2、PC3都可以访问服务器。

将PC4连接到PC1在交换机上的端口,配置与PC1相同的地址,测试发现不能访问服务器。


读书和健身总有一个在路上

posted @ 2020-09-04 16:36  Renqy  阅读(1564)  评论(0编辑  收藏  举报