• 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.

Cấu hình IPSEC kết hợp với HSRP

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

  • Cấu hình IPSEC kết hợp với HSRP

    Cho mô hình mạng như sau:





    yêu cầu:
    VRX1 và VRX2 chạy HSRP cho 2 cổng bên ngoài (kết nối với Backbone - ISP). Ip virtual HSRP : 172.16.172.53

    VPN 7200 làm VPN site-to-site với địa chỉ HSRP virtual IP của 2 con VRX1 và VRX2


    Tại con VPN7200:

    show
    VPN7200#show run
    VPN7200#show running-config
    Building configuration...

    Current configuration : 1360 bytes
    !
    version 12.4
    service timestamps debug datetime msec
    service timestamps log datetime msec
    no service password-encryption
    !
    hostname VPN7200
    !
    boot-start-marker
    boot-end-marker
    !
    !
    no aaa new-model
    memory-size iomem 15
    ip cef
    !
    !
    !
    !
    !
    voice-card 0
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    !
    //Định nghĩa ISAKMP policy và preshared key cho xác thực IKE.
    //Chú ý: địa chỉ IP là địa chỉ của HSRP virtual của 2 con HSRP router

    crypto isakmp policy 1
    authentication pre-share
    crypto isakmp key cisco address 172.16.172.53

    //Dùng IKE keepalive để xác định sự tồn tại của con Router đầu xa.
    //Khi 1 trong 2 con VXR1 hoặc VXR2 fail, IKE keepalive sẽ xác định được
    //con Router còn lại mà chuyển qua và tiếp tục kết nối VPN

    crypto isakmp keepalive 10
    !
    !
    crypto ipsec transform-set MYSET esp-des esp-md5-hmac
    !

    //Tạo crypto map. Địa chỉ phải là địa chỉ HSRP virtual

    crypto map MYMAP 10 ipsec-isakmp
    set peer 172.16.172.53
    set transform-set MYSET
    match address 100
    !
    !
    !
    !
    interface Loopback0
    ip address 20.1.1.1 255.255.255.0
    !
    interface FastEthernet0/0
    ip address 172.16.172.69 255.255.240.0
    duplex auto
    speed auto
    crypto map MYMAP
    !
    interface FastEthernet0/1
    no ip address
    shutdown
    duplex auto
    speed auto
    !
    interface Serial0/1/0
    no ip address
    shutdown
    clock rate 2000000
    !
    interface Serial0/1/1
    no ip address
    shutdown
    clock rate 2000000
    !
    ip route 10.1.1.0 255.255.255.0 172.16.172.65
    ip route 99.99.99.99 255.255.255.255 172.16.172.65
    ip route 172.16.172.48 255.255.240.0 192.168.1.254
    !
    !
    ip http server
    no ip http secure-server
    !
    access-list 100 permit ip 20.1.1.0 0.0.0.255 10.1.1.0 0.0.0.255
    access-list 100 permit ip 20.1.1.0 0.0.0.255 host 99.99.99.99
    !
    !
    !
    control-plane
    !
    !
    !
    line con 0
    line aux 0
    line vty 0 4
    privilege level 15
    logging synchronous
    no login
    !
    scheduler allocate 20000 1000
    end


    Tại VXR1

    Current configuration : 1611 bytes
    !
    version 12.4
    service timestamps debug datetime msec
    service timestamps log datetime msec
    no service password-encryption
    !
    hostname VXR1
    !
    boot-start-marker
    boot-end-marker
    !
    !
    no aaa new-model
    memory-size iomem 15
    ip cef
    !
    !
    !
    !
    !
    !
    voice-card 0
    !
    !
    !

    //Tao ISAKMP policy
    crypto isakmp policy 1
    authentication pre-share
    crypto isakmp key cisco address 192.168.1.1
    crypto isakmp keepalive 10
    !
    !
    crypto ipsec transform-set myset esp-des esp-md5-hmac
    !

    //Tạo Crypto Map.
    //Chú ý: "Reverse-route" bật tính năng RRI (Khi vpn7200 kết nối VPN thì trên 2 con VXR1 và VXR2 tạo 1 route chỉ về vpn7200)

    crypto map mymap 10 ipsec-isakmp
    set peer 192.168.1.1
    set transform-set myset
    match address 101
    reverse-route
    !
    !
    !
    !
    //Định nghĩa HSRP. Ta phải định nghĩa HSRP name để sau đó dùng trong //cấu hình IPSEC. Từ Khóa "redundancy" trong cryptomap chỉ định rằng
    //group HSRP này sẽ kết hợp với IPSEC nào.

    interface FastEthernet0/0
    ip address 172.16.172.52 255.255.255.0
    duplex auto
    speed auto
    standby 1 ip 172.16.1.4
    standby 1 priority 200
    standby 1 preempt
    standby 1 name VPNHA
    standby 1 track FastEthernet0/1 150
    crypto map mymap redundancy VPNHA
    !
    interface FastEthernet0/1
    ip address 10.0.1.1 255.255.255.0
    duplex auto
    speed auto
    !
    interface Serial0/1/0
    no ip address
    shutdown
    no fair-queue
    clock rate 2000000
    !
    interface Serial0/1/1
    no ip address
    shutdown
    clock rate 2000000
    !
    interface Serial0/2/0
    no ip address
    shutdown
    clock rate 2000000
    !
    router ospf 1
    log-adjacency-changes
    redistribute static subnets
    network 10.1.1.0 0.0.0.255 area 0
    default-information originate
    !
    ip route 0.0.0.0 0.0.0.0 172.16.172.254
    !
    !
    ip http server
    no ip http secure-server
    !
    access-list 101 permit ip 10.1.1.0 0.0.0.255 20.1.1.0 0.0.0.255
    access-list 101 permit ip host 99.99.99.99 0.0.0.255 20.1.1.0 0.0.0.255
    !
    !
    !
    !
    control-plane
    !
    !
    !
    !
    !!
    line con 0
    line aux 0
    line vty 0 4
    login
    !
    scheduler allocate 20000 1000
    end


    Tại VXR2:
    Cấu hình tương tự như VxR1 tuy nhiên ta đổi lại thông số IP cũng như là ACL cho phù hợp
    TRAN VAN THANH
    090 6778 447
    email: thanhtrannsp@gmail.com

    Giải pháp quản trị Data Center
    Giải pháp kiểm tra hệ thống cáp mạng.
Working...
X