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

Triển khai VPN Site–to–Site trên thiết bị Cisco (phần 2)

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

  • Triển khai VPN Site–to–Site trên thiết bị Cisco (phần 2)

    7. Bước 6: Xác định luồng dữ liệu sẽ được mã hóa hay bảo vệ
    Tại router SAIGON:
    SAIGON(config)#access-list 100 permit ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255

    Tại router BINHPHUOC:
    BINHPHUOC(config)#access-list 100 permit ip 192.168.2.0 0.0.0.255 192.168.1.0 0.0.0.255

    8. Bước 7: Cấu hình crypto map
    Tại router SAIGON:
    SAIGON(config)#crypto map MYMAP 10 ipsec-isakmp
    % NOTE: This new crypto map will remain disabled until a peer and a valid access list have been configured
    SAIGON(config-crypto-map)#set peer 151.1.1.1
    SAIGON(config-crypto-map)#set transform-set MYSET
    SAIGON(config-crypto-map)#match address 100

    Tại router BINHPHUOC:
    BINHPHUOC(config)#crypto map MYMAP 10 ipsec-isakmp
    % NOTE: This new crypto map will remain disabled until a peer and a valid access list have been configured
    BINHPHUOC(config-crypto-map)#set peer 151.1.1.1
    BINHPHUOC(config-crypto-map)#set transform-set MYSET
    BINHPHUOC(config-crypto-map)#match address 100

    9. Bước 8: Cấu hình crypto map lên cổng:
    Tại router SAIGON:
    SAIGON(config)#interface s0/0
    SAIGON(config-if)#crypto map MYMAP

    Tại router BINHPHUOC:
    BINHPHUOC(config)#interface s0/0
    BINHPHUOC(config-if)#crypto map MYMAP

    10. Bước 9: Tiến hành kiểm tra
    Kích hoạt tunnel dựa vào lưu lượng được xác định trên acl 100
    Từ client_saigon ping qua gateway của BINHPHUOC


    Sau khi tunnel được thiết lập có thể kiểm tra thông tin pha 1 và pha 2:
    Trạng thái ISAKMP SA:
    SAIGON#show crypto isakmp sa
    dst src state conn-id slot status
    151.1.1.1 150.1.1.1 QM_IDLE 1 0 ACTIVE

    Trạng thái IPSEC SA:
    SAIGON#show crypto ipsec sa
    interface: Serial0/0
    Crypto map tag: MYMAP, local addr 150.1.1.1
    protected vrf: (none)
    local ident (addr/mask/prot/port): (192.168.1.0/255.255.255.0/0/0)
    remote ident (addr/mask/prot/port): (192.168.2.0/255.255.255.0/0/0)
    current_peer 151.1.1.1 port 500
    PERMIT, flags=origin_is_acl,
    #pkts encaps: 7, #pkts encrypt: 7, #pkts digest: 7 => Gói được mã hóa
    #pkts decaps: 7, #pkts decrypt: 7, #pkts verify: 7 => Gói được mã hóa
    #pkts compressed: 0, #pkts decompressed: 0
    #pkts not compressed: 0, #pkts compr. failed: 0
    #pkts not decompressed: 0, #pkts decompress failed: 0
    #send errors 1, #recv errors 0
    local crypto endpt.: 150.1.1.1, remote crypto endpt.: 151.1.1.1
    path mtu 1500, ip mtu 1500
    current outbound spi: 0x6DA11B48(1839274824)
    inbound esp sas: => SA sử dụng cho gói đi vào
    spi: 0xC9EFAA55(3387927125) => Tương ứng với outbound của peer
    transform: esp-des esp-md5-hmac ,
    in use settings =Tunnel,
    conn id: 2001, flow_id: SW:1, crypto map: MYMAP
    sa timing: remaining key lifetime (k/sec): (4457799/3252)
    IV size: 8 bytes
    replay detection support: Y
    Status: ACTIVE
    inbound ah sas:
    inbound pcp sas:
    outbound esp sas: => SA sử dụng cho gói đi ra
    spi: 0x6DA11B48(1839274824) => Tương ứng với inbound của peer
    transform: esp-des esp-md5-hmac ,
    in use settings =Tunnel,
    conn id: 2002, flow_id: SW:2, crypto map: MYMAP
    sa timing: remaining key lifetime (k/sec): (4457799/3225)
    IV size: 8 bytes
    replay detection support: Y
    Status: ACTIVE
    outbound ah sas:
    outbound pcp sas:

    SAIGON#show crypto session detail
    Crypto session current status
    Code: C – IKE Configuration mode, D – Dead Peer Detection
    K – Keepalives, N – NAT-traversal, X – IKE Extended Authentication
    Interface: Serial0/0
    Session status: UP-ACTIVE => Trạng thái của session
    Peer: 151.1.1.1 port 500 fvrf: (none) ivrf: (none)
    Phase1_id: 151.1.1.1
    Desc: (none)
    IKE SA: local 150.1.1.1/500 remote 151.1.1.1/500 Active
    Capabilities none) connid:1 lifetime:23:49:20
    IPSEC FLOW: permit ip 192.168.1.0/255.255.255.0 192.168.2.0/255.255.255.0 => Dữ liệu được bảo vệ
    Active SAs: 2, origin: crypto map
    Inbound: #pkts dec’ed 11 drop 0 life (KB/Sec) 4457798/2961
    Outbound: #pkts enc’ed 11 drop 1 life (KB/Sec) 4457798/2961
    Số lượng kết nối mở (1 cho IKE và 2 cho Ipsec)

    SAIGON#show crypto engine connections active
    ID Interface IP-Address State Algorithm Encrypt Decrypt
    1 Serial0/0 150.1.1.1 set HMAC_MD5+DES_56_CB 0 0
    2001 Serial0/0 150.1.1.1 set DES+MD5 0 11
    2002 Serial0/0 150.1.1.1 set DES+MD5 11 0

    Có thể xóa kết nối với dòng lệnh:
    SAIGON#clear crypto session
    SAIGON#show crypto isakmp sa
    dst src state conn-id slot status
    151.1.1.1 150.1.1.1 MM_NO_STATE 1 0 ACTIVE (deleted)
    Trong quá trình cấu hình, có thể dùng câu lệnh debug crypto isakmp để kiểm tra quá trình thiết lập

    Trần Huỳnh Hiệp – VnPro
    Xin mời xem phần 1 tại đây.
    Phạm Thanh Đông Khê
    Email: dongkhe@vnpro.org
    Hãy share hoặc like nếu thông tin hữu ích!
    ---------------------------------------------------------------------------------------------------------------------------------------------------
Trung Tâm Tin Học VnPro
149/1D Ung Văn Khiêm, P.25, Q.Bình Thạnh, Tp.HCM
Tel: (08) 35124257 (5 lines)
Fax: (08) 35124314

Home Page: http://www.vnpro.vn
Forum: http://www.vnpro.org
Twitter: https://twitter.com/VnVnpro
LinkedIn: https://www.linkedin.com/in/VnPro
- 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

Videos: http://www.dancisco.com
Blog: http://www.vnpro.org/blog
FB: http://facebook.com/VnPro

  • #2
    Nhìn khó nhỉ?

    Comment

    • Working...
      X