VLAN实验

  • 实验需求

1、pc1和pc3所在接口为access;属于vlan 2;

   pc2/pc4/pc5/pc6处于同一网段;其中pc2可以访问pc4/pc5/pc6;

pc4可以访问pc6; pc5不能访问pc6;

2、pc1/pc3与pc2/pc4/pc5/pc6不在同一网段;

3、所有pc通过DHCP获取IP地址,且pc1/pc3可以正常访问pc2/pc4/pc5/pc6

划分vlan区域,pc2/4/5/6 在同一个广播域中,.pc1/3 在同一个广播域中,在交换机中创建vlan,将接口划分vlan配置链路模式

●LSW1配置:

创建VLAN2—VLAN5

[SW1]vlan batch 2 to 5

PC1所连接端口:为access模式,属于VLAN2

interface GigabitEthernet0/0/2

 port link-type access

 port default vlan 2

PC2所连接端口:为hybrid(混杂)模式,打标签为VLAN3,设置所有流量进入不打标签

interface GigabitEthernet0/0/3

 port hybrid pvid vlan 3

 port hybrid untagged vlan 3 to 5

●LSW1与LSW2之间端口:为trunk模式,设置允许所有VLAN流量通过

interface GigabitEthernet0/0/1

 port link-type trunk

 port trunk allow-pass vlan 2 to 4094

●LSW2配置:

创建VLAN2—VLAN5

[SW1]vlan batch 2 to 5

PC3所连接端口:为access模式,属于VLAN2

interface GigabitEthernet0/0/3

 port link-type access

 port default vlan 2

PC4所连接端口:为hybrid(混杂)模式,打标签VLAN4,设置VLAN3/4流量进入不打标签,让VLAN5流量不在允许列表里面。

interface GigabitEthernet0/0/4

 port hybrid pvid vlan 4

 port hybrid untagged vlan 3 to 4

LSW2与LSW1 和 LSW2与LSW3:接口为trunk模式,并且让其通过所有VLAN流量

interface GigabitEthernet0/0/1

 port link-type trunk

 port trunk allow-pass vlan 2 to 4094

●LSW3配置:

创建VLAN2—VLAN5

[SW1]vlan batch 2 to 5
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值