拓扑:
需求:
创建vlan 45,335,401
DNS主备可以通信并属于VLAN335,WWW服务器不能与FTP服务器互通并属于VLAN401,
配置:
vtp domain CCIE
vtp mode transparent
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
vlan internal allocation policy ascending
!
vlan 45
private-vlan primary
private-vlan association 335,401
!
vlan 335
private-vlan community
!
vlan 401
private-vlan isolated
!
interface Ethernet0/1
switchport
switchport private-vlan mapping 45 335,401
switchport mode private-vlan promiscuous
duplex auto
spanning-tree portfast edge
!
interface Ethernet0/2
switchport
switchport private-vlan host-association 45 335
switchport mode private-vlan host
duplex auto
spanning-tree portfast edge
!
interface Ethernet0/3
switchport
switchport private-vlan host-association 45 335
switchport mode private-vlan host
duplex auto
spanning-tree portfast edge
!
interface Ethernet1/1
switchport
switchport private-vlan host-association 45 401
switchport mode private-vlan host
duplex auto
spanning-tree portfast edge
!
interface Ethernet1/2
switchport
switchport private-vlan host-association 45 401
switchport mode private-vlan host
duplex auto
spanning-tree portfast edge
查看命令:
show vlan private-vlan
show int x/x switchport
转载于:https://blog.51cto.com/q3322095/905155