【實驗環境】
真機C3560以上,暫時無法完成實驗
【實驗目的】
模擬DMZ區域對隔離的需求。所有服務器均處在同一VLAN,為保證安全,現要求不同應用的服務器之間無法通訊,屬于同一應用的服務器之間可以通訊,管理員與網關接口可以跟所有服務器通訊:
C1可以和C2/C3/C4/C5互訪
C2和C3可以互訪
C4和C5不能互訪
這里就可以使用PVLAN技術簡化配置,在主VLAN 10的下面再創建2個VLAN 501(community類型,成員可以互訪)和VLAN 502(isolated類型,成員不可互訪),并且2個VLAN之間不能互訪,主VLAN可以與次級VLAN之間互訪。
【實驗拓撲】
【實驗描述】
所有服務器C1-C5均處在VLAN 10下,網段10.10.10.0/24,IP主機地址與接口號同。
primary VLAN:10
Secondary VLAN:community VLAN:501/isolated VLAN:502
Promiscuous Port:f1/1
Host Port:f1/2,f1/3,f1/4,f1/5
交換機管理VLAN:10.10.10.254/24
【實驗步驟】
1、配置各服務器IP地址
C1:ip 10.10.10.1/24
C2:ip 10.10.10.2/24
C3:ip10.10.10.3/24
C4:ip10.10.10.4/24
C5:ip10.10.10.5/24
2、將交換機的VTP模式改為透明模式,否則無法使用PVLAN技術
SW(config)#vtp mode transparent
3、創建Primary VLAN及Secondary VLAN
SW(config)#vlan 10
SW(config-vlan)#private-vlan primary
SW(config-vlan)#vlan 501
SW(config-vlan)#private-vlan community
SW(config-vlan)#vlan 502
SW(config-vlan)#private-vlan isolated
4、關聯Primary VLAN及Secondary VLAN
SW(config)#vlan 10
SW(config-vlan)#private-vlan association 501-502
5、將端口f1/1設置為Promiscuous Port并映射Secondary VLAN
SW(config)#int f1/1
SW(config-if)#switchport mode private-vlan promiscuous //設置端口為混雜模式
SW(config-if)#switchport private-vlan mapping 10 501-502 //使用mapping關聯主VLAN和能夠訪問的私有VLAN
6、將端口f1/2,f1/3設置為Host Port并映射community VLAN
SW(config)#int range f1/2 - 3
SW(config-if)#switchport mode private-vlan host //設置端口為host模式
SW(config-if)#switchport private-vlan host-association 10 501 //使用host-association關聯主VLAN和所屬的私有VLAN
7、將端口f1/4,f1/5設置為Host Port并映射isolated VLAN
SW(config)#int range f1/4 - 5
SW(config-if)#switchport mode private-vlan host //設置端口為host模式
SW(config-if)#switchport private-vlan host-association 10 502 //使用host-association關聯主VLAN和所屬的私有VLAN
8、在交換機上檢查PVLAN設置
SW#show vlan private-vlan
結果暫無
9、測試各服務器之間的連通性
結果暫無
10、配置交換機的三層管理接口(SVI)
SW(config)#int vlan 10
SW(config-if)#ip address 10.10.10.254 255.255.255.0
SW(config-if)#no shutdown
11、測試交換機SVI接口連通性
結果暫無
12、配置三層接口PVLAN映射,開啟三層交換功能,使得Secondary VLAN也可以遠程訪問SVI接口
SW(config)#int vlan 10
SW(config-if)#private-vlan mapping 501-502
SW(config-if)#exit
SW(config)#ip routing
11、再次測試交換機SVI接口連通性
結果暫無
實驗完成。