一、实验拓扑
二、实验目的
PVLAN可以通过主VLAN和辅助VLAN的概念,部署隔离技术,实现用户间的互访控制。
三、实验配置
SW2
Ruijie >enable
Ruijie #configure terminal
Ruijie (config)#vlan 20
Ruijie (config-vlan)#private-vlan community //创建团体vlan20
Ruijie (config-vlan)#exit
Ruijie (config)#vlan 30
Ruijie (config-vlan)#private-vlan isolated //创建隔离vlan30
Ruijie (config-vlan)#exit
Ruijie (config)#vlan 10
Ruijie (config-vlan)#private-vlan primary //创建主vlan,并关联secondary vlan
Ruijie (config-vlan)#private-vlan association 20,30
Ruijie (config-vlan)#exit
Ruijie #configure terminal
Ruijie (config)#int range gi0/1-2
Ruijie (config-if-range)#switchport mode private-vlan host
Ruijie(config-if-range)#switchport private-vlan host-association 10 20 //将1,2端口加入团体vlan20
Ruijie(config-if-range)#exit
Ruijie(config)#int range gi/3-4
Ruijie(config-if-range)#switchport mode private-vlan host
Ruijie(config-if-range)#switchport private-vlan host-ssociation 10 30 //将3,4端口加入隔离vlan30
Ruijie(config-if-range)#exit
Ruijie (config)#interface gi0/0
Ruijie (config-if)#switchport mode trunk
Ruijie (config-if)# switchport private-vlan promiscuous trunk 10 20,30 //配置上联GW的端口为混杂口属性指定主,辅vlan的映射关系,实现私有VLAN的报文送本接口发送出去时,修改VID为主VLAN ID。
SW1
Ruijie >enable
Ruijie #configure terminal
Ruijie (config)#vlan 10
Ruijie (config-vlan)#exit
Ruijie (config)#interface vlan 10
Ruijie (config-if)#ip address 192.168.1.1 24
Ruijie (config-if)#exit
Ruijie (config)#interface gigabitEthernet0/0
Ruijie (config-if)#switchport mode trunk