banner
 .::Defense::. Cơ chế hoạt động và cách cấu hình VPN IP Sec trên router Cisco Go to original post Author: Nguyễn Ngọc Thắng - thangdiablo - Translator:  - Entry Date: 24/07/2009 00:13:50
Hôm nay có việc ngồi làm cái VPN Site to Site mới lại nhớ ra mình chưa hoàn thành cái TUT này ( Cũng hơn 2 năm rồi ).
Nhân tiện đang làm mình viết nốt phần còn lại về việc kiểm tra, debug quá trình VPN sau khi đã cấu hình xong.

Trong phần cấu hình phía trên mình có chú thích thêm 1 phần quan trọng, mà ngày trước mình quên.
Đó là appy cái crypto map vào Interface sử dụng để kết nối VPN.
Nếu không có bước này. Trong quá trình debug các bạn sẽ thấy thiếu những dòng màu đỏ phía trong cái trích dẫn ngay bên dưới.

Sử dụng lệnh show crypto map

R#sh crypto map
Crypto Map "VPN-SG-HN" 10 ipsec-isakmp
Peer = 10.252.15.6
Extended IP access list 101
access-list 101 permit ip 10.128.16.0 0.0.15.255 172.16.128.0 0.0.3.255
access-list 101 permit ip 172.16.0.0 0.0.127.255 172.16.128.0 0.0.3.255
Current peer: 10.252.15.6
Security association lifetime: 4608000 kilobytes/3600 seconds
PFS (Y/N): N
Transform sets={
SG-HN,
}
Interfaces using crypto map VPN-SG-HN:
GigabitEthernet0/1
 


Khi các bạn show crypto ipsec sa ( Kiểm tra việc trao đổi các Security Association ) của quá trình đóng gói packets giữa 2 phía, các bạn sẽ thấy chống trơn.

Nhưng khi luồng VPN đã tạo thành công khi các bạn show crypto ipsec sa các bạn sẽ thấy như sau:

R_MGW_SG.ACB.HN#sh crypto ipsec sa

interface: GigabitEthernet0/1
Crypto map tag: VPN-SG-HN, local addr 172.31.1.218

protected vrf: (none)
local ident (addr/mask/prot/port): (172.16.0.0/255.255.128.0/0/0)
remote ident (addr/mask/prot/port): (172.16.128.0/255.255.252.0/0/0)
current_peer 10.252.15.6 port 500
PERMIT, flags={origin_is_acl,}
#pkts encaps: 12699, #pkts encrypt: 12699, #pkts digest: 12699
#pkts decaps: 8707, #pkts decrypt: 8707, #pkts verify: 8707
#pkts compressed: 0, #pkts decompressed: 0
#pkts not compressed: 0, #pkts compr. failed: 0
#pkts not decompressed: 0, #pkts decompress failed: 0
#send errors 0, #recv errors 0

local crypto endpt.: 172.31.1.218, remote crypto endpt.: 10.252.15.6
path mtu 1500, ip mtu 1500, ip mtu idb GigabitEthernet0/1
current outbound spi: 0xF4B4F10(256593680)

inbound esp sas:
spi: 0x766F7231(1987015217)
transform: esp-aes esp-sha-hmac ,
in use settings ={Tunnel, }
conn id: 3005, flow_id: Onboard VPN:5, crypto map: VPN-SG-HN
sa timing: remaining key lifetime (k/sec): (4442319/3469)
IV size: 16 bytes
replay detection support: Y
Status: ACTIVE

inbound ah sas:

inbound pcp sas:

outbound esp sas:
spi: 0xF4B4F10(256593680)
transform: esp-aes esp-sha-hmac ,
in use settings ={Tunnel, }
conn id: 3006, flow_id: Onboard VPN:6, crypto map: VPN-SG-HN
sa timing: remaining key lifetime (k/sec): (4441189/3469)
IV size: 16 bytes
replay detection support: Y
Status: ACTIVE

outbound ah sas:

outbound pcp sas:

protected vrf: (none)
local ident (addr/mask/prot/port): (10.128.16.0/255.255.240.0/0/0)
remote ident (addr/mask/prot/port): (172.16.128.0/255.255.252.0/0/0)
current_peer 10.252.15.6 port 500
PERMIT, flags={origin_is_acl,}
#pkts encaps: 0, #pkts encrypt: 0, #pkts digest: 0
#pkts decaps: 6, #pkts decrypt: 6, #pkts verify: 6
#pkts compressed: 0, #pkts decompressed: 0
#pkts not compressed: 0, #pkts compr. failed: 0
#pkts not decompressed: 0, #pkts decompress failed: 0
#send errors 0, #recv errors 0

local crypto endpt.: 172.31.1.218, remote crypto endpt.: 10.252.15.6
path mtu 1500, ip mtu 1500, ip mtu idb GigabitEthernet0/1
current outbound spi: 0x7675CCC0(1987431616)

inbound esp sas:
spi: 0x2C2DE7CF(741205967)
transform: esp-aes esp-sha-hmac ,
in use settings ={Tunnel, }
conn id: 3003, flow_id: Onboard VPN:3, crypto map: VPN-SG-HN
sa timing: remaining key lifetime (k/sec): (4581032/62)
IV size: 16 bytes
replay detection support: Y
Status: ACTIVE
spi: 0x9875DB42(2557860674)
transform: esp-aes esp-sha-hmac ,
in use settings ={Tunnel, }
conn id: 3002, flow_id: Onboard VPN:2, crypto map: VPN-SG-HN
sa timing: remaining key lifetime (k/sec): (4427799/3596)
IV size: 16 bytes
replay detection support: Y
Status: ACTIVE

inbound ah sas:

inbound pcp sas:

outbound esp sas:
spi: 0x1084C9E4(277137892)
transform: esp-aes esp-sha-hmac ,
in use settings ={Tunnel, }
conn id: 3004, flow_id: Onboard VPN:4, crypto map: VPN-SG-HN
sa timing: remaining key lifetime (k/sec): (4581033/62)
IV size: 16 bytes
replay detection support: Y
Status: ACTIVE
spi: 0x7675CCC0(1987431616)
transform: esp-aes esp-sha-hmac ,
in use settings ={Tunnel, }
conn id: 3001, flow_id: Onboard VPN:1, crypto map: VPN-SG-HN
sa timing: remaining key lifetime (k/sec): (4427799/3596)
IV size: 16 bytes
replay detection support: Y
Status: ACTIVE

outbound ah sas:

outbound pcp sas:

 


Thêm 1 lệnh để kiểm tra quá trình thiết lập IKE
sh crypto isakmp sa
dst src state conn-id slot status
172.31.1.218 10.252.15.6 QM_IDLE 3 0 ACTIVE
 

Trong quá trình làm và debug. Nhớ enable debug crypto isakmp và ipsec lên để theo dõi nhé.
Các bạn sẽ thấy được quá trình làm việc, thiết lập thông số giữa 2 peers.

Thôi đi ngủ. Good night. smilie smilie
[digg] [delicious] [google] [yahoo] [technorati] [reddit] [stumbleupon]
Other posts in the same group:

Cơ chế hoạt động và cách cấu hình VPN IP Sec trên router Cisco
Go to top Go to original post  

Powered by JForum - Extended by HVAOnline
 hvaonline.net  |  hvaforum.net  |  hvazone.net  |  hvanews.net  |  vnhacker.org
1999 - 2013 © v2012|0504|218|