本文檔提供內容交換模組(CSM)上的VPN負載平衡配置示例。VPN負載均衡是一種機制,可智慧地在一組VPN集中器或VPN前端裝置上分配VPN會話。之所以實施VPN負載均衡,原因如下:
克服VPN裝置的效能或可擴充性限制;例如,每秒資料包數、每秒連線數和吞吐量
提供冗餘(消除單點故障)
嘗試此組態之前,請確保符合以下要求:
在前端裝置上實施反向路由注入(RRI),以自動傳播分支中的路由資訊。
啟用VLAN 61和51以共用同一子網。
本文中的資訊係根據以下軟體和硬體版本:
採用CSM的Cisco Catalyst 6500
思科2621路由器
Cisco 7206
Cisco 7206VXR
Cisco 7204VXR
Cisco 7140
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路正在作用,請確保您已瞭解任何指令可能造成的影響。
如需文件慣例的詳細資訊,請參閱思科技術提示慣例。
本節提供用於設定本文件中所述功能的資訊。
註:使用Command Lookup Tool(僅供已註冊客戶使用)可獲取本節中使用的命令的詳細資訊。
本檔案會使用以下網路設定:
本檔案會使用以下設定:
請完成以下步驟:
在前端裝置上實施RRI,以自動傳播分支中的路由資訊。
注意:VLAN 61和VLAN 51共用同一子網。
定義VLAN客戶端和VLAN伺服器。
定義用於檢查IPSec伺服器運行狀況的探測。
!--- The CSM is located in slot 4. module ContentSwitchingModule 4 vlan 51 client ip address 172.21.51.244 255.255.255.240 ! vlan 61 server ip address 172.21.51.244 255.255.255.240 ! probe ICMP_PROBE icmp interval 5 retries 2 !
使用實際IPSec伺服器定義serverfarm。
配置failaction purge,刷新屬於失效伺服器的連線。
定義粘滯策略。
!--- Serverfarm VPN_IOS and real server members. serverfarm VPN_IOS nat server no nat client !--- Set the behavior of connections when the real servers have failed. failaction purge real 172.21.51.242 inservice real 172.21.51.247 inservice probe ICMP_PROBE ! !--- Ensure that connections from the same client match the same server !--- load balancing (SLB) policy. !--- Use the same real server on subsequent connections; issue the !--- sticky command. sticky 5 netmask 255.255.255.255 timeout 60 ! policy VPNIOS sticky-group 5 serverfarm VPN_IOS !
定義VServers,每個流量一個。
!--- Virtual server VPN_IOS_ESP. vserver VPN_IOS_ESP !--- The virtual server IP address is specified. virtual 172.21.51.253 50 !--- Persistence rebalance is used for HTTP 1.1, to rebalance the connection !--- to a new server using the load balancing policy. persistent rebalance !--- Associate the load balancing policy with the VPNIOS virtual server. slb-policy VPNIOS inservice ! vserver VPN_IOS_IKE virtual 172.21.51.253 udp 500 persistent rebalance slb-policy VPNIOS inservice !
crypto isakmp policy 10 authentication pre-share crypto isakmp key cisco123 address 0.0.0.0 ! crypto ipsec transform-set myset esp-3des esp-sha-hmac crypto mib ipsec flowmib history tunnel size 200 crypto mib ipsec flowmib history failure size 200 ! crypto dynamic-map mydyn 10 set transform-set myset reverse-route ! crypto map mymap 10 ipsec-isakmp dynamic mydyn ! interface FastEthernet0/0 ip address 172.21.51.247 255.255.255.240 crypto map mymap ! interface FastEthernet2/0 ip address 10.1.1.6 255.255.255.0 router eigrp 1 redistribute static network 10.0.0.0 no auto-summary no eigrp log-neighbor-changes ! ip default-gateway 172.21.51.241 ip classless ip route 0.0.0.0 0.0.0.0 172.21.51.241 no ip http server !
crypto isakmp policy 10 authentication pre-share crypto isakmp key cisco123 address 172.21.51.253 ! crypto ipsec transform-set myset esp-3des esp-sha-hmac crypto mib ipsec flowmib history tunnel size 200 crypto mib ipsec flowmib history failure size 200 ! crypto map mymap 10 ipsec-isakmp set peer 172.21.51.253 set transform-set myset match address 101 ! interface Loopback0 ip address 10.3.3.3 255.255.255.0 ! interface Ethernet0/0 ip address 172.21.51.250 255.255.255.240 duplex auto crypto map mymap ! ip classless ip route 0.0.0.0 0.0.0.0 172.21.51.241 no ip http server ! access-list 101 permit ip 10.3.3.0 0.0.0.255 10.1.1.0 0.0.0.255 !
使用本節內容,確認您的組態是否正常運作。
輸出直譯器工具(僅供已註冊客戶使用)(OIT)支援某些show命令。使用OIT檢視show命令輸出的分析。
發出show module csm all或show module contentSwitchingModule all命令;兩個命令都會生成相同的資訊。
show module contentSwitchingModule all vservers命令顯示SLB虛擬伺服器資訊。
Cat6506-1-Native# show module contentSwitchingModule all vservers ---------------------- CSM in slot 4 ---------------------- slb vserver prot virtual vlan state conns --------------------------------------------------------------------------- VPN_IOS_ESP 50 172.21.51.253/32:0 ALL OPERATIONAL 2 VPN_IOS_IKE UDP 172.21.51.253/32:500 ALL OPERATIONAL 2
show module contentSwitchingModule all conns命令顯示SLB連線資訊。
Cat6506-1-Native# show module contentSwitchingModule all conns ---------------------- CSM in slot 4 ---------------------- prot vlan source destination state ---------------------------------------------------------------------- In UDP 51 172.21.51.250:500 172.21.51.253:500 ESTAB Out UDP 61 172.21.51.242:500 172.21.51.250:500 ESTAB In 50 51 172.21.51.251 172.21.51.253 ESTAB Out 50 61 172.21.51.247 172.21.51.251 ESTAB In 50 51 172.21.51.250 172.21.51.253 ESTAB Out 50 61 172.21.51.242 172.21.51.250 ESTAB In UDP 51 172.21.51.251:500 172.21.51.253:500 ESTAB Out UDP 61 172.21.51.247:500 172.21.51.251:500 ESTAB
show module contentSwitchingModule all sticky命令顯示SLB粘滯資料庫。
Cat6506-1-Native# show module contentSwitchingModule all sticky ---------------------- CSM in slot 4 ---------------------- client IP: 172.21.51.250 real server: 172.21.51.242 connections: 0 group id: 5 timeout: 38 sticky type: netmask 255.255.255.255 client IP: 172.21.51.251 real server: 172.21.51.247 connections: 0 group id: 5 timeout: 40 sticky type: netmask 255.255.255.255
在路由器上發出show ip route命令。
2621VPN# show ip route !--- Output suppressed. 10.0.0.0/24 is subnetted, 3 subnets D EX 10.2.2.0 [170/30720] via 10.1.1.6, 00:13:57, FastEthernet0/0 D EX 10.3.3.0 [170/30720] via 10.1.1.5, 00:16:15, FastEthernet0/0 C 10.1.1.0 is directly connected, FastEthernet0/0 D*EX 0.0.0.0/0 [170/30720] via 10.1.1.5, 00:37:58, FastEthernet0/0 [170/30720] via 10.1.1.6, 00:37:58, FastEthernet0/0 2621VPN# 7206VXR# show ip route !--- Output suppressed. 172.21.0.0/28 is subnetted, 1 subnets C 172.21.51.240 is directly connected, FastEthernet0/0 10.0.0.0/24 is subnetted, 3 subnets S 10.2.2.0 [1/0] via 0.0.0.0, FastEthernet0/0 D EX 10.3.3.0 [170/30720] via 10.1.1.5, 00:16:45, FastEthernet2/0 C 10.1.1.0 is directly connected, FastEthernet2/0 S* 0.0.0.0/0 [1/0] via 172.21.51.241
目前尚無適用於此組態的具體疑難排解資訊。