• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
Xin chào ! Nếu đây là lần đầu tiên bạn đến với diễn đàn, xin vui lòng danh ra một phút bấm vào đây để đăng kí và tham gia thảo luận cùng VnPro.

Announcement

Collapse
No announcement yet.

VPN Load-Balancing Cluster

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • VPN Load-Balancing Cluster

    Thực hiện VPN Load-Balancing Cluster




    I. Mô tả:
    VPN Load-Balancing Cluster cho phép thực hiện chia tải cho tất cả kết nối remote-access bao gồm IPSec VPN và SSL VPN. Trong Cluster sẽ có một thiết bị đóng vai trò Master, thiết bị là Master sẽ chịu trách nhiệm giám sát trạng thái tải của những thiết bị trong Cluster, trả về địa chỉ của thiết bị trong Cluster mà ít tải nhất cho mỗi yêu cầu kết nối đến Cluster thông qua địa chỉ Virtual Cluster.

    II. Cấu hình:
    Đảm bảo chính sách ISAMKP và IPSec được cấu hình

    Cấu hình tính năng vpn load-balancing
    ASA-1(config)# vpn load-balancing

    Xác định cổng tham gia vào tiến trình load-balancing, đảm bảo cổng inside và outside của tất cả các thiết bị trong cluster cùng mạng
    ASA-1(config-load-balancing)# interface lbpublic outside
    ASA-1(config-load-balancing)# interface lbprivate inside

    Định nghĩa priority (giá trị lớm hơn sẽ đóng vai trò Cluster Master)
    ASA-1(config-load-balancing)# priority 10

    Định nghĩa địa chỉ của cluster
    ASA-1(config-load-balancing)# cluster ip address 192.168.3.10

    Kích hoạt tiến trình load-balancing
    ASA-1(config-load-balancing)# participate

    Cấu hình định tuyến OSPF
    ASA-1(config)# router ospf 1
    ASA-1(config-router)# network 192.168.2.0 255.255.255.0 area 0
    ASA-1(config-router)# network 192.168.3.0 255.255.255.0 area 0

    Kết hợp với reverse-route, cho phép quảng bá tuyến static vào tiến trình OSPF
    ASA-1(config-router)# redistribute static subnets

    Kích hoạt tính năng Nat Traversal
    ASA-1(config-router)# isakmp nat-traversal

    III. Cấu hình đầy đủ

    ASA-1
    ASA Version 8.0(2)
    !
    hostname ASA-1
    enable password 8Ry2YjIyt7RRXU24 encrypted
    names
    !
    interface Ethernet0/0
    nameif inside
    security-level 100
    ip address 192.168.2.1 255.255.255.0
    !
    interface Ethernet0/1
    nameif outside
    security-level 0
    ip address 192.168.3.1 255.255.255.0
    !
    interface Ethernet0/2
    no nameif
    no security-level
    no ip address
    !
    interface Ethernet0/3
    shutdown
    no nameif
    no security-level
    no ip address
    !
    interface Management0/0
    shutdown
    no nameif
    no security-level
    no ip address
    management-only
    !
    passwd 2KFQnbNIdI.2KYOU encrypted
    ftp mode passive
    pager lines 24
    logging console informational
    mtu inside 1500
    mtu outside 1500
    ip local pool MYPOOL 172.16.1.2-172.16.1.10
    no failover
    icmp unreachable rate-limit 1 burst-size 1
    asdm image disk0:/asdm-602.bin
    no asdm history enable
    arp timeout 14400
    !
    router ospf 1
    network 192.168.2.0 255.255.255.0 area 0
    log-adj-changes
    redistribute static subnets
    default-information originate
    !
    route outside 0.0.0.0 0.0.0.0 192.168.3.3 1
    crypto ipsec transform-set MYSET esp-des esp-md5-hmac
    crypto dynamic-map DYNMAP 10 set transform-set MYSET
    crypto dynamic-map DYNMAP 10 set reverse-route
    crypto map MYMAP 10 ipsec-isakmp dynamic DYNMAP
    crypto map MYMAP interface outside
    crypto isakmp enable outside
    crypto isakmp policy 10
    authentication pre-share
    encryption des
    hash md5
    group 2
    lifetime 86400
    vpn-sessiondb max-session-limit 10
    vpn load-balancing
    priority 10
    cluster ip address 192.168.3.10
    participate
    threat-detection basic-threat
    threat-detection statistics access-list
    !
    class-map inspection_default
    match default-inspection-traffic
    !
    !
    policy-map type inspect dns preset_dns_map
    parameters
    message-length maximum 512
    policy-map global_policy
    class inspection_default
    inspect dns preset_dns_map
    inspect ftp
    inspect h323 h225
    inspect h323 ras
    inspect rsh
    inspect rtsp
    inspect esmtp
    inspect sqlnet
    inspect skinny
    inspect sunrpc
    inspect xdmcp
    inspect sip
    inspect netbios
    inspect tftp
    !
    service-policy global_policy global
    username vnpro password E1W6hUMdsPROmOmT encrypted
    tunnel-group VPNCLIENT type remote-access
    tunnel-group VPNCLIENT general-attributes
    address-pool MYPOOL
    tunnel-group VPNCLIENT ipsec-attributes
    pre-shared-key *
    prompt hostname context
    Cryptochecksum:00e93a11c51adfcbbe8b85a4bdc28e6c
    : end

    ASA-2
    ASA Version 8.0(2)
    !
    hostname ASA-2
    enable password 8Ry2YjIyt7RRXU24 encrypted
    names
    !
    interface Ethernet0/0
    nameif inside
    security-level 100
    ip address 192.168.2.2 255.255.255.0
    !
    interface Ethernet0/1
    nameif outside
    security-level 0
    ip address 192.168.3.2 255.255.255.0
    !
    interface Ethernet0/2
    shutdown
    no nameif
    no security-level
    no ip address
    !
    interface Ethernet0/3
    shutdown
    no nameif
    no security-level
    no ip address
    !
    interface Management0/0
    shutdown
    no nameif
    no security-level
    no ip address
    management-only
    !
    passwd 2KFQnbNIdI.2KYOU encrypted
    ftp mode passive
    pager lines 24
    mtu inside 1500
    mtu outside 1500
    ip local pool MYPOOL 172.16.1.2-172.16.1.10
    no failover
    icmp unreachable rate-limit 1 burst-size 1
    no asdm history enable
    arp timeout 14400
    !
    router ospf 1
    network 192.168.2.0 255.255.255.0 area 0
    log-adj-changes
    redistribute static subnets
    default-information originate metric 20
    !
    route outside 0.0.0.0 0.0.0.0 192.168.3.3 1
    crypto ipsec transform-set MYSET esp-des esp-md5-hmac
    crypto dynamic-map DYNMAP 10 set transform-set MYSET
    crypto dynamic-map DYNMAP 10 set reverse-route
    crypto map MYMAP 10 ipsec-isakmp dynamic DYNMAP
    crypto map MYMAP interface outside
    crypto isakmp enable outside
    crypto isakmp policy 10
    authentication pre-share
    encryption des
    hash md5
    group 2
    lifetime 86400
    vpn-sessiondb max-session-limit 10
    vpn load-balancing
    cluster ip address 192.168.3.10
    participate
    threat-detection basic-threat
    threat-detection statistics access-list
    !
    class-map inspection_default
    match default-inspection-traffic
    !
    !
    policy-map type inspect dns preset_dns_map
    parameters
    message-length maximum 512
    policy-map global_policy
    class inspection_default
    inspect dns preset_dns_map
    inspect ftp
    inspect h323 h225
    inspect h323 ras
    inspect rsh
    inspect rtsp
    inspect esmtp
    inspect sqlnet
    inspect skinny
    inspect sunrpc
    inspect xdmcp
    inspect sip
    inspect netbios
    inspect tftp
    !
    service-policy global_policy global
    username vnpro password E1W6hUMdsPROmOmT encrypted
    tunnel-group VPNCLIENT type remote-access
    tunnel-group VPNCLIENT general-attributes
    address-pool MYPOOL
    tunnel-group VPNCLIENT ipsec-attributes
    pre-shared-key *
    prompt hostname context
    Cryptochecksum:04430f0312d2ce3b05381da9a570e707
    : end

    GATEWAY
    Building configuration...

    Current configuration : 1136 bytes
    !
    hostname GATEWAY
    !
    interface FastEthernet0/0
    ip address 192.168.3.3 255.255.255.0
    ip nat inside
    ip virtual-reassembly
    duplex auto
    speed auto
    !
    interface FastEthernet0/1
    ip address 150.1.1.1 255.255.255.0
    ip nat outside
    ip virtual-reassembly
    duplex auto
    speed auto
    !
    router ospf 1
    log-adjacency-changes
    redistribute connected subnets
    !
    ip http server
    no ip http secure-server
    ip nat inside source static 192.168.3.10 195.1.1.1
    !
    end

    CORE
    Building configuration...

    Current configuration : 837 bytes
    !
    hostname CORE
    !
    interface Loopback0
    ip address 192.168.1.1 255.255.255.0
    ip ospf network point-to-point
    !
    interface FastEthernet0/0
    ip address 192.168.2.3 255.255.255.0
    duplex auto
    speed auto
    !
    interface FastEthernet0/1
    no ip address
    shutdown
    duplex auto
    speed auto
    !
    router ospf 1
    log-adjacency-changes
    network 192.168.1.0 0.0.0.255 area 0
    network 192.168.2.0 0.0.0.255 area 0
    !
    end

    CORE#

    IV. Kiểm tra
    Tạo kết nối VPN từ PC1 và PC2





    Giao tiếp thành công





    Lúc này ASA-2 kết thúc kết nối VPN

    ASA-1(config)# sh vpn load-balancing

    Status: enabled
    Role: Master
    Failover: n/a
    Encryption: disabled
    Cluster IP: 192.168.3.10
    Peers: 1

    Load (%) Sessions
    Public IP Role Pri Model IPSec SSL IPSec SSL
    ---------------------------------------------------------------------------
    * 192.168.3.1 Master 10 ASA-5510 0 0 0 0
    192.168.3.2 Backup 2 ASA-5510 1 0 2 0

    Trạng thái bảng định tuyến
    ASA-2# sh route

    Gateway of last resort is 192.168.3.3 to network 0.0.0.0

    S 172.16.1.4 255.255.255.255 [1/0] via 192.168.3.3, outside
    S 172.16.1.3 255.255.255.255 [1/0] via 192.168.3.3, outside
    O 192.168.1.0 255.255.255.0 [110/11] via 192.168.2.3, 0:15:33, inside
    C 192.168.2.0 255.255.255.0 is directly connected, inside
    C 192.168.3.0 255.255.255.0 is directly connected, outside
    S* 0.0.0.0 0.0.0.0 [1/0] via 192.168.3.3, outside

    CORE#sh ip route ospf
    172.16.0.0/32 is subnetted, 2 subnets
    O E2 172.16.1.4 [110/20] via 192.168.2.2, 00:01:54, FastEthernet0/0
    O E2 172.16.1.3 [110/20] via 192.168.2.2, 00:03:02, FastEthernet0/0
    O*E2 0.0.0.0/0 [110/1] via 192.168.2.1, 00:03:02, FastEthernet0/0

    Với số kết nối VPN tối đa của mỗi thiết bị trong trường hợp này là 250, nên để thực hiện việc kiểm tra tải ta sẽ giảm số kết nối tối đa



    ASA-1(config)# vpn-sessiondb max-session-limit 10
    ASA-2(config)# vpn-sessiondb max-session-limit 10

    Thực hiện lại kết nối VPN từ hai PC, lúc này ASA-1 và ASA-2 sẽ đồng thời tham gia kết thúc kết nối VPN
    ASA-1# sh vpn load-balancing

    Status: enabled
    Role: Master
    Failover: n/a
    Encryption: disabled
    Cluster IP: 192.168.3.10
    Peers: 1

    Load (%) Sessions
    Public IP Role Pri Model IPSec SSL IPSec SSL
    -------------------------------------------------------------------------------------
    * 192.168.3.1 Master 10 ASA-5510 10 0 1 0
    192.168.3.2 Backup 2 ASA-5510 10 0 1 0

    Trạng thái bảng định tuyến thay đổi tương ứng
    CORE#sh ip route ospf
    172.16.0.0/32 is subnetted, 2 subnets
    O E2 172.16.1.4 [110/20] via 192.168.2.2, 00:05:19, FastEthernet0/0
    O E2 172.16.1.2 [110/20] via 192.168.2.1, 00:00:46, FastEthernet0/0
    O*E2 0.0.0.0/0 [110/1] via 192.168.2.1, 00:06:27, FastEthernet0/0

    Trạng thái ISAKMP SA
    ASA-1# sh crypto isakmp sa

    Active SA: 1
    Rekey SA: 0 (A tunnel will report 1 Active and 1 Rekey SA during rekey)
    Total IKE SA: 1

    1 IKE Peer: 150.1.1.2
    Type : user Role : responder
    Rekey : no State : AM_ACTIVE

    ASA-2# sh crypto isakmp sa

    Active SA: 1
    Rekey SA: 0 (A tunnel will report 1 Active and 1 Rekey SA during rekey)
    Total IKE SA: 1

    1 IKE Peer: 150.1.1.5
    Type : user Role : responder
    Rekey : no State : AM_ACTIVE
    Phạm Minh Tuấn

    Email : phamminhtuan@vnpro.org
    Yahoo : phamminhtuan_vnpro
    -----------------------------------------------------------------------------------------------
Trung Tâm Tin Học VnPro
149/1D Ung Văn Khiêm P25 Q.Bình thạnh TPHCM
Tel : (08) 35124257 (5 lines)
Fax: (08) 35124314

Home page: http://www.vnpro.vn
Support Forum: http://www.vnpro.org
- Chuyên đào tạo quản trị mạng và hạ tầng Internet
- Phát hành sách chuyên môn
- Tư vấn và tuyển dụng nhân sự IT
- Tư vấn thiết kế và hỗ trợ kỹ thuật hệ thống mạng

Network channel: http://www.dancisco.com
Blog: http://www.vnpro.org/blog
Working...
X