交换机接口类型综合实验
实验要求
1.PC1和PC3所在接口为access。pvlan vlan 2PC2/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
实验过程
拓扑搭建
配置交换机接口
LSW1
vlan batch 2 to 5
interface Ethernet0/0/1
port link-type access
port default vlan 2
interface Ethernet0/0/2
port hybrid pvid vlan 3
port hybrid untagged vlan 3 to 5
interface Ethernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 5
interface Ethernet0/0/4
port hybrid tagged vlan 2
port hybrid untagged vlan 3 to 5
LSW2
vlan batch 2 to 5
interface Ethernet0/0/1
port link-type access
port default vlan 2
interface Ethernet0/0/2
port hybrid pvid vlan 4
port hybrid untagged vlan 3 to 4
interface Ethernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 5
interface Ethernet0/0/4
port link-type trunk
port trunk allow-pass vlan 2 to 5
LSW3
vlan batch 2 to 5
interface Ethernet0/0/1
port hybrid pvid vlan 4
port hybrid untagged vlan 3 to 4
interface Ethernet0/0/2
port hybrid pvid vlan 5
port hybrid untagged vlan 3 5
interface Ethernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 5
配置路由
子接口
[r1-Ethernet0/0/0.1]ip address 192.168.2.1 2
[r1-Ethernet0/0/0.1]dot1q termination vid 2
[r1-Ethernet0/0/0.1]arp broadcast enable
[r1-Ethernet0/0/0.1]dhcp select global
物理接口
[r1-Ethernet0/0/0]ip address 192.168.1.1 24
[r1-Ethernet0/0/0]dhcp select global
创建池子
[r1]ip pool pool1
[r1-ip-pool-pool1]network 192.168.1.0 mask 24
[r1-ip-pool-pool1]gateway-list 192.168.1.1
[r1]ip pool pool2
[r1-ip-pool-pool2]network 192.168.2.0 mask 24
[r1-ip-pool-pool2]gateway-list 192.168.2.1
PC获取的ip地址如下:
PC1:192.168.2.254
PC2:192.168.2.253
PC3:192.168.1.253
PC4:192.168.1.253
PC5:192.168.1.252
PC6:192.168.1.251
测试
PC1/3可以访问PC2/4/5/6
PC2可以访问PC4/5/6
PC4可以访问PC5,但不能访问PC6
PC5不能访问PC6