PVLAN(私有vlan)+路由实验

PVLAN(私有vlan)+路由实验

做本实验的原因是因为我自己对私有vlan的上联到本地网络外的配置不是很清楚,以往能在二层将私有vlan配置正确使所有的辅助vlan都能访问到网关,但是不知道能否通过网关访问本地网络外,特做此实验。

拓扑图:
PVLAN(私有vlan)+路由实验_第1张图片
SW1:
vlan 10
private-vlan primary
private-vlan association 20,30
!
vlan 20
private-vlan community
!
vlan 30
private-vlan isolated
!
interface Ethernet0/0
switchport private-vlan host-association 10 20
switchport mode private-vlan host
!
interface Ethernet0/1
switchport private-vlan host-association 10 20
switchport mode private-vlan host
!
interface Ethernet0/2
switchport private-vlan host-association 10 30
switchport mode private-vlan host
!
interface Ethernet0/3
no switchport
ip address 10.1.1.2 255.255.255.0
!
interface Vlan10
ip address 192.168.10.254 255.255.255.0
private-vlan mapping 20,30
!
router rip
version 2
network 10.0.0.0
network 192.168.10.0
no auto-summary
!

line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end
验证:PVLAN(私有vlan)+路由实验_第2张图片
PVLAN(私有vlan)+路由实验_第3张图片R1:
router rip
version 2
network 10.0.0.0
network 12.0.0.0
no auto-summary
PVLAN(私有vlan)+路由实验_第4张图片R2:
router rip
version 2
network 2.0.0.0
network 12.0.0.0
no auto-summary
在这里插入图片描述在这里插入图片描述PVLAN(私有vlan)+路由实验_第5张图片总结:除PVLAN正常的配置外,需要int vlan 10,配置private-vlan mapping 20,30

你可能感兴趣的:(交换,Cisco,路由)