vlan实验

实验要求
1,PC1和pc3所在接口为access;属于vlan2;
      PC2/4/5/6处于同一网段;其中PC2可以访问PC4/5/6;但PC4可以访问Pc5,不能访问PC6 

2,PC5不能访问PC6
3,PC1/3与PC2/4/5/6不在同一个网段
4,所有PC通过DHCP获取IP地址,且PC1/3可以正常访问PC2/4/5/6

实验操作
一,配置交换机
SW1
vlan batch 2 to 5

int g 0/0/1
port link-type access
port default vlan 2

int g 0/0/2
port hybrid pvid vlan 3
port hybrid untagged vlan 3 to 5

int g 0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 5

int g 0/0/4
port hybrid tagged vlan 2
port hybrid untagged vlan 3 to 5

SW2
vlan batch 2 to 5

int g 0/0/1
port link-type access
port default vlan 2

int g 0/0/2
port hybrid pvid vlan 4
port hybrid untagged vlan 3 to 4

int g 0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 5

int g 0/0/4
port link-type trunk
port trunk allow-pass vlan 2 to 5

SW3
vlan batch 2 to 5

int g 0/0/1
port hybrid pvid vlan 4
port hybrid untagged vlan 3 to 4

int g 0/0/2
port hybrid pvid vlan 5
port hybrid untagged vlan 3 5

int g 0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 5

二,配置路由器
[r1]dhcp enable
[r1]ip pool 2
[r1-ip-pool-2]network 34.1.1.0 mask 24
[r1-ip-pool-2]gateway-list 34.1.1.1
[r1-ip-pool-2]dns-list 8.8.8.8
[r1-ip-pool-2]q
[r1]ip
[r1]ip poo
[r1]ip pool 345
Info: It’s successful to create an IP address pool.
[r1-ip-pool-345]network 12.1.1.0 mask 24
[r1-ip-pool-345]gateway-list 12.1.1.1
[r1-ip-pool-345]dns-list 8.8.8.8
[r1-ip-pool-345]q

配置接口IP地址

[r1]interface g0/0/0
[r1-GigabitEthernet0/0/0]ip address 12.1.1.1 24
[r1-GigabitEthernet0/0/0]q
[r1]interface g0/0/0.1
[r1-GigabitEthernet0/0/0.1]ip address 34.1.1.1 24
[r1-GigabitEthernet0/0/0.1]dot1q termination vid 2
[r1-GigabitEthernet0/0/0.1]arp broadcast enable
[r1-GigabitEthernet0/0/0.1]q

开启DHCP服务

[r1]interface g0/0/0
[r1-GigabitEthernet0/0/0]dhcp select global
[r1-GigabitEthernet0/0/0]int g0/0/0.1
[r1-GigabitEthernet0/0/0.1]dhcp select global
[r1-GigabitEthernet0/0/0.1]q

 

三,检验 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值