SlideShare a Scribd company logo
I.VPN CONFIG ON CISCO ROUTER
1 Policy Base VPN Configuration on Cisco Router
1.1 Site-to-Site IPSEC VPN
1.1.1 Site-to-Site IPSEC-VPN with static IP
-Bước 1: Cấu hình Interesting trafic:
R1(config)#ip access-list extended VPN-ACL
R1(config-ext-nacl)#permit ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255
R2(config)#ip access-list extended VPN-ACL
R2(config-ext-nacl)#permit ip 192.168.2.0 0.0.0.255 192.168.1.0 0.0.0.255
-Bước 2: Cấu hình loại bỏ các traffic sử dụng internet:
+R1:
R1(config)#ip access-list extended NAT-ACL
R1(config-ext-nacl)#deny ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255 : loại bỏ traffic từ
LAN1 đến LAN2 trong hoạt động của NAT
R1(config-ext-nacl)#permit ip 192.168.1.0 0.0.0.255 any : cho phep tat ca traffic khac tu
LAN1 duoc NAT
Kích hoạt chức năng NAT trên port:
R1(config)#ip nat inside source list NAT-ACL interface fa0/0 overload
R1(config)#int fa0/0
R1(config-if)#ip nat outside
R1(config)#int fa0/1
R1(config-if)#ip nat inside
+R2: Làm tương tự như R1
-Bước 3: Cấu hình Phase 1(ISAKMP) : Để thiết lập 1 kênh sercure channel
+R1:
R1(config)#crypto isakmp policy 1 : tạo policy 1. Có thể có nhiều policy
R1(config-isakmp)#encryption 3des(hoặc aes hoặc des)
R1(config-isakmp)#hash md5(hoặc sha)
R1(config-isakmp)#authentication pre-share : để xác thực
R1(config-isakmp)#group 2 (hoặc 5)
R1(config-isakmp)#exit
R1(config)# crypto isakmp key “secretkey” address “200.200.200.1”: định nghĩa 1 pre-shared
key(“secretkey”) cho xác thực với remote peer IP 200.200.200.1
+R2: Làm tương tự như R1
-Bước 4: Cấu hình Phase 2(IPSec)
Để mã hóa và xác thực mạnh ta dùng 1 trong 2 cặp sau:
+ESP-3DES and ESP-MD5-HMAC
+ESP-AES and ESP-SHA-HMAC
+R1:
R1(config)#crypto ipsec transform-set “TRSET” esp-md5-hmac : cấu hình 1 transform set với
3des để mã hóa và MD5-HMAC để xác thực
R1(cfg-crypto-trans)# exit
R1(config)#crypto map VPNMAP 10 ipsec-isakmp
R1(config-crypto-map)# set peer 200.200.200.1
R1(config-crypto-map)#set transform-set “TRSET”
R1(config-crypto-map)# match address VPN-ACL
R1(config-crypto-map)# exit
Gán crypto-map vào interface WAN:
R1(config)# int fa0/0
R1(config-if)# crypto map VPNMAP
+R2: Làm tương tự như R1
Note: Kiểm tra
R#show crypto isakmp sa : để kiểm tra thiết lập tunnel
R#show crypto ipsec sa : để kiểm tra encrypted dữ liệu ở 2 đầu
1.1.2 IPSEC VPN Site-To-Site with dynamic IP
-Bước 1 & Bước 2 làm tương tự như mục 1.1: Cấu hình Interesting Traffic và loại bỏ traffic
NAT
-Bước 3: Phase 1 Configuration
+R1:
R1(config)#crypto isakmp policy 1 : tạo policy 1. Có thể có nhiều policy
R1(config-isakmp)#encryption 3des(hoặc aes hoặc des)
R1(config-isakmp)#hash md5(hoặc sha)
R1(config-isakmp)#authentication pre-share : để xác thực
R1(config-isakmp)#group 2 (hoặc 5)
R1(config-isakmp)#exit
R1(config)# crypto isakmp key “secretkey” address 0.0.0.0 0.0.0.0 : định nghĩa 1 pre-shared
key(“secretkey”) cho xác thực với remote peer IP
+R2: Config Phase 1 tương tự như cấu hình site-to-site
-Bước 4 : Cấu hình Phase 2:
R1(config)#crypto ipsec transform-set “TRSET” esp-md5-hmac : cấu hình 1 transform set với
3des để mã hóa và MD5-HMAC để xác thực
Đầu tiên tạo 1 dynamic crypto map(DYNMAP) trong đó có Transform Set và Crypto ACL:
R1(config)# crypto dynamic-map “DYNMAP” 10
R1(config-crypto-map)# set transform-set “TRSET”
R1(config-crypto-map)#match address “VPN-ACL”
R1(config-crypto-map)# exit
Tạo 1 static crypto map (VPNMAP) sử dụng dynamic map đã cấu hình trước đó
R1(config)# crypto map “VPNMAP” 10 ipsec-isakmp dynamic DYNMAP
Gán static crypto map (VPNMAP) vào cổng out WAN outside of router R1:
R1(config)# int fa0/0
R1(config-if)# crypto map “VPNMAP”
+R2: Cấu hình Phase 2 cho R2 tương tự như trong trường hợp Site-to-Site with static IP
1.2. HUB and SPOKE IPSEC VPN
-R1(HUB):
+Đầu tiên cấu hình xác định Interesting traffic:
R1(config)# ip access-list extended VPN-TO-REMOTE1
R1(config-ext-nacl)# permit ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255
R1(config)# ip access-list extended VPN-TO-REMOTE2
R1(config-ext-nacl)# permit ip 192.168.1.0 0.0.0.255 192.168.3.0 0.0.0.255
+Loại bỏ Interesting traffic trong NAT:
R1(config)# ip access-list extended NAT-ACL
R1(config-ext-nacl)# deny ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255
R1(config-ext-nacl)# deny ip 192.168.1.0 0.0.0.255 192.168.3.0 0.0.0.255
R1(config-ext-nacl)# permit ip 192.168.1.0 0.0.0.255 any
+ Cấu hình Phase 1 ISAKMP Parameters:
R1(config)# crypto isakmp policy 1
R1(config-isakmp)# encryption 3des
R1(config-isakmp)# hash md5
R1(config-isakmp)# authentication pre-share
R1(config-isakmp)# group 2
R1(config-isakmp)# exit
+ Cấu hình 1 pre-share key khác nhau cho mỗi Spoke Site:
R1(config)# crypto isakmp key “secretkey1” address 30.30.30.2
R1(config)# crypto isakmp key “secretkey2” address 40.40.40.2
+ Cấu hình Phase 2 Transform-set and Crypto Map:
R1(config)# crypto ipsec transform-set “TRSET” esp-3des esp-md5-hmac
R1(cfg-crypto-trans)# exit
+ Tạo crypto cho mỗi Spoke :
R1(config)# crypto map “VPNMAP 10” ipsec-isakmp
R1(config-crypto-map)# set peer 30.30.30.2
R1(config-crypto-map)# set transform-set “TRSET”
R1(config-crypto-map)# match address VPN-TO-REMOTE1
R1(config-crypto-map)# exit
R1(config)# crypto map “VPNMAP 20” ipsec-isakmp
R1(config-crypto-map)# set peer 40.40.40.2
R1(config-crypto-map)# set transforms-set “TRSET”
R1(config-crypto-map)# match address VPN-TO-REMOTE2
R1(config-crypto-map)# exit
+ Gán crypto map vào interface WAN:
R1(config)# int fa0/0
R1(config-if)# crypto map VPNMAP
Note: R1 & R2 cấu hình tương tự như cấu hình R2 trong trường hợp Site-to-Site.
1.3 Remote Access IPSEC VPN
-Cấu hình trên Router R1:
+Bước 1: Cấu hình VPN POOL để gán IP cho remote access client:
R1(config)# ip local pool vpnpool “192.168.50.1 192.168.5.10”
+Bước 2: Cấu hình VPN Interesting Traffic and NAT Exemption:
Tạo access-list xác định traffic cho phép đi qua VPN
R1(config)# ip access-list extended “VPN-ACL”
R1(config-ext-nacl)# permit ip 192.168.1.0 .0.0.0.255 192.168.50.0 0.0.0.255
Loại bỏ interesting traffic va cho phep NAT traffic nao đi ra internet:
R1(config)# ip access-list extended NAT-ACL
R1(config-ext-nacl)# deny ip 192.168.1.0 0.0.0.255 192.168.50.0 0.0.0.255
R1(config-ext-nacl)# permit ip 192.168.1.0 0.0.0.255 any
Gán NAT vào interface fa0/0(inside) & interface fa0/1(outside):
R1(config)# ip nat inside source list NAT-ACL int fa0/1 overload
R1(config)# int fa0/1
R1(config-if)# ip nat outside
R1(config)#int fa0/0
R1(config-if)# ip nat inside
+Bước 3: Cấu hình xác thực user:
Tạo 1 username/password cho mỗi remote user:
R1(config)# username “vpnuser” password “strongpassword”
Sau đó kích hoạt cơ chế AAA trên router:
R1(config)# aaa new-model
Cấu hình đăng nhập & ủy quyền:
R1(config)# aaa authentication login “USERAUTH” local
R1(config)# aaa authorization network “NETAUTHORIZE” local
+ Bước 4: Cấu hình IPSEC Phase 1(isakmp parameters):
Đầu tiên cấu hình 1 isakmp policy tương tự như site-to-site IPSEC:
R1(config)# crypto isakmp policy 10
R1(config-isakmp)# encryption 3des
R1(config-isakmp)# hash md5
R1(config-isakmp)# authentication pre-share
R1(config-isakmp)# group 2
Keyring : để lưu trữ pre-shared-keys.
Cấu hình 1 pre-shared key cho remote access VPN clients:
R1(config)# crypto keyring “vpnclientskey”
R1(config-keyring)# pre-shared-key address 0.0.0.0 0.0.0.0 key “cisco123”
Cấu hình policy and parameters cho Group of remote users sẽ kế thừa:
R1(config)# crypto isakmp client configuration group remotevpn <- Group name (see below)
R1(config-isakmp-group)# key cisco123 <- Group Password (see picture below)
R1(config-isakmp-group)# dns 192.168.1.2
R1(config-isakmp-group)# wins 192.168.1.2
R1(config-isakmp-group)# domain “mycompany.com”
R1(config-isakmp-group)# pool vpnpool <- IP address pool configured before
R1(config-isakmp-group)# acl VPN-ACL <- Split-Tunnel Access List
Note: - Câu lệnh “acl VPN-ACL” thiết lập chia nhỏ tunnel. Nghĩa là, traffic sẽ đi qua VPN
tunnel chỉ nếu nó matches với access-list VPN-ACL. Nếu bạn remove ACL này thì tất cả
traffic sẽ đi qua VPN tunnel (tức là không cho phép truy cập internet từ vị trí của remote user).
- Tên của Group cấu hình ở trên (remotevpn) and key (cisco123) phải được sử dụng
trong “Group Authentication” (“Name”/”Password”) của phần mềm VPN client
như hình dưới đây:
Cấu hình 1 isakmp profile:
R1(config)# crypto isakmp profile remoteclients
R1(config-isa-prof)# description “Remote Access VPN clients”
R1(config-isa-prof)# keyring “vpnclientskey” : cấu hình trước đó
R1(config-isa-prof)# match identity group “remotevpn” : cấu hình trước đó
R1(config-isa-prof)# client authentication list “USERAUTH” : cấu hình trước đó
R1(config-isa-prof)# isakmp authorization list “NETAUTHORIZE” : cấu hình trước đó
R1(config-isa-prof)# client configuration addres respond : Respond IP address request từ
client.
+ Bước 5 : Cấu hình IPSEC Phase 2 (tương tự như trường hợp Site—to-Site with dynamic
IP) :
Cấu hình Phase 2 Transform Set and Crypto Map (tương tự trường hợp site-to-site VPN):
R1(config)# crypto ipsec transform-set “TRSET” esp-3des esp-md5-hmac
R1(cfg-crypto-trans)# exit
Tạo 1 dynamic crypto map (DYNMAP) có Transform Set ở trên và isakmp profile
(“remoteclients”) cấu hình trước đó :
R1(config)# crypto dynamic-map DYNMAP 10
R1(config-crypto-map)# set transform-set “TRSET” : sử dụng tranform-set có tên “TRSET”
đã tạo trước đó
R1(config-crypto-map)# set isakmp-profile “remoteclients”
R1(config-crypto-map)# exit
Tạo 1 static crypto map (VPNMAP) sử dụng dynamic map cấu hình trước đó:
R1(config)# crypto map VPNMAP 10 ipsec-isakmp dynamic DYNMAP
Gán static crypto map (VPNMAP) vào int fa0/1 WAN outside của router :
R1(config)# int fa0/1
R1(config-if)# crypto map VPNMAP
1.4 Site-to-Site and Remote Access IPSEC VPN on same device
-Router R1 (HUB)
+Bước 1: Cấu hình VPN POOL để gán IP cho remote access client:
R1(config)# ip local pool vpnpool “192.168.50.1 192.168.5.10”
+ Bước 2 : Cấu hình Interesting Traffic and NAT Exemption:
Đầu tiên xác định Interesting Traffic để mã hóa. Có 3 crypto ACLs:
R1(config)# ip access-list extended VPNsite1-ACL
R1(config-ext-nacl)# permit ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255
R1(config)# ip access-list extended VPNsite2-ACL
R1(config-ext-nacl)# permit ip 192.168.1.0 .0.0.255 192.168.3.0 0.0.0.255
R1(config)# ip access-list extended VPNclient-ACL
R1(config-ext-nacl)# permit ip 192.168.1.0 0.0.0. 255 192.168.50.0 0.0.0.255
Loại bỏ Interesting traffic từ hoạt động của NAT:
R1(config)# ip access-list extended NAT-ACL
R1(config-ext-nacl)# deny ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255
R1(config-ext-nacl)# deny ip 192.168.1.0 0.0.0.255 192.168.3.0 0.0.0.255
R1(config-ext-nacl)# deny ip 192.168.1.0 0.0.0.255 192.168.50.0 0.0.0.255
R1(config-ext-nacl)# permit ip 192.168.1.0 0.0.0.255 any
Gán NAT vào interface fa0/0(inside) & interface fa0/1(outside):
R1(config)# ip nat inside source list NAT-ACL int fa0/1 overload
R1(config)# int fa0/1
R1(config-if)# ip nat outside
R1(config)#int fa0/0
R1(config-if)# ip nat inside
+Bước 2: Cấu hình xác thực user:
Tạo 1 username/password cho mỗi remote user:
R1(config)# username “vpnuser” password “strongpassword”
Sau đó kích hoạt cơ chế AAA trên router:
R1(config)# aaa new-model
Cấu hình đăng nhập & ủy quyền:
R1(config)# aaa authentication login “USERAUTH” local
R1(config)# aaa authorization network “NETAUTHORIZE” local
+ Bước 3: Cấu hình Phase 1 IPSEC:
Cấu hình phase 1 isakmp policy:
R1(config)# crypto isakmp policy 10
R1(config-isakmp)# encryption 3des
R1(config-isamkp)# hash md5
R1(config-isakmp)# authentication pre-share
R1(config-isakmp)# group 2
R1(config-isakmp)# exit
Cấu hình crypto keyring để lưu trữ pre-shared keys:
R1(config)# crypto keyring “vpnclientskey” : cho remote user
R1(conf-keyring)# pre-shared-key address 0.0.0.0 0.0.0.0 key “cisco123”
R1(conf-keyring)# exit
R1(config)# crypto keyring “staticbranch” : cho site with static IP
R1(conf-keyring)# pre-shared-key address 30.30.30.2 key “secretkey1” : nếu có nhiều site sử
dụng static IP public thì thêm địa chỉ bởi câu lệnh này.
R1(conf-keyring)# exit
R1(config)# crypto keyring “dynamicbranch”
R1(conf-keyring)# pre-shared-key address 0.0.0.0 0.0.0.0 key “secretkey2”
R1(conf-keyring)# exit
Cấu hình policy and parameters cho Group of remote users sẽ kế thừa:
R1(config)# crypto isakmp client configuration group “remotevpn” <- Group name (see
below)
R1(config-isakmp-group)# key “cisco123” <- Group Password (see picture below)
R1(config-isakmp-group)# dns 192.168.1.2
R1(config-isakmp-group)# wins 192.168.1.2
R1(config-isakmp-group)# domain “asahi-intecc.com”
R1(config-isakmp-group)# pool vpnpool <- IP address pool configured before
R1(config-isakmp-group)# acl VPNclient-ACL<- Split-Tunnel Access List
Cấu hình of ISAKMP Profiles.
R1(config)# crypto isakmp profile “staticL2L” : cho Branch với static IP public
R1(conf-isa-prof)# keyring “staticbranch” : “staticbranch” đã tạo trước đó
R1(conf-isa-prof)# match identity address 30.30.30.2 255.255.255.255 ->Router R2 static IP
R1(conf-isa-prof)# exit
R1(config)# crypto isakmp profile “dynamicL2L” : cho Branch với dynamic IP public
R1(conf-isa-prof)# keyring “dynamicbranch” : cấu hình trước đó
R1(conf-isa-prof)# match identity address 0.0.0.0 : Bất kỳ 1 Remote Branch nào đều truy cập
được.
R1(config)# crypto isakmp profile “remoteclients” :cho Remote User
R1(conf-isa-prof)# keyring vpnclientskey
R1(conf-isa-prof)# match identity group remotevpn
R1(conf-isa-prof)# client authentication list USERAUTHEN
R1(conf-isa-prof)# isakmp authorization list NETAUTHORIZE
R1(conf-isa-prof)# client configuration address respond : trả lời yêu cầu IP từ remote user
+ Bước 4 : Cấu hình IPSEC Phase 2:
Cấu hình Transform Set and Crypto Map:
R1(config)# crypto ipsec transform-set “TRSET” esp-3des esp-md5-hmac
R1(cfg-crypto-trans)# exit
Cấu hình dynamic crypto map & static crypto map:
R1(config)# crypto dynamic-map DYNMAP 10
R1(config-crypto-map)# set transform-set “TRSET”
R1(config-crypto-map)# set isakmp-profile “remoteclients” : Attach isakmp profile of VPN
clients configured before
R1(config-crypto-map)# exit
R1(config)# crypto dynamic-map DYNMAP 20
R1(config-crypto-map)# set transform-set “TRSET”
R1(config-crypto-map)# set isakmp-profile “dynamicL2L” : attach isakmp profileof dynamic
IP branch configured before
R1(config-crypto-map)# match address VPNsite2-ACL
R1(config-crypto-map)# exit
R1(config)# crypto map VPNMAP 10 ipsec-isakmp : This is the static tunnel crypto map
R1(config-crypto-map)# set peer 30.30.30.2
R1(config-crypto-map)# set transform-set “TRSET”
R1(config-crypto-map)# set isakmp-profile “staticL2L” : Attach isakmp profile of static IP
branch configured before
R1(config-crypto-map)# match address VPNsite1-ACL
R1(config-crypto-map)# exit
R1(config)# crypto map VPNMAP 20ipsec-isakmp dynamic DYNMAP : Attach the dynamic
crypto map on a new entry of the static crypto map
Attach the static crypto map VPNMAP to the WAN outside finterface(fa0/1) of the Hub
router:
R1(config)# int fa0/1
R1(config-if)# crypto map VPNMAP
Những điểm cần nhớ:
-Tạo 1 keyring cho mỗi loại VPN tunnel(static IP branch, dynamic IP branch, VPN clients).
-Gán mỗi keyring cho 1 “isakmp profile” tương ứng
-Tạo một dynamic crypto map với 2 entries. Trên 1 entry gán “isakmp profile” cho dynamic
Lan-to-Lan tunnel và trên entry khác gán “isakmp profile” cho remote clients tunnel.
-Tạo 1 static crypto map với 2 entries. Trên 1 entry gán cho “isakmp profile” của static Lan-
to-Lan tunnel, và trên entry tiếp theo gán dynamic crypto map.
2. Route Base VPN Configuration On Cisco Router
2.1 Site-to-Site VPN Using GRE with IPSEC Protection
-Bước 1: Cấu hình GRE Tunnel:
Router R1:
R1(config)# int Tunnel 0
R1(config-if)# ip address 10.0.0.1 255.255.255.0
R1(config-if)# tunnel source 20.20.20.2
R1(config-if)# tunnel destination 30.30.30.2
R1(config-if)# exit
Router R2:
R2(config)# int Tunnel 0
R2(config-if)# ip address 10.0.0.2 255.255.255.0
R2(config-if)# tunnel source 30.30.30.2
R2(config-if)# tunnel destination 20.20.20.2
R2(config-if)# exit
-Bước 2: Cấu hình định tuyến giữa 2 đầu VPN Tunnel
Có thể sử dụng dynamic routing(khi đó ta network dải mạng của tunnel) hoặc static routing
-Bước 3: Cấu hình IPSEC Phase 1:
Router R1:
R1(config)# crypto isakmp policy 10
R1(config-isakmp)# encryption 3des
R1(config-isakmp)# hash md5
R1(config-isakmp)# authentication pre-share
R1(config-isakmp)# group 2
R1(config-isakmp)# exit
R1(config)# crypto isakmp key “testkey123” address 30.30.30.2
Router R2:
R2(config)# crypto isakmp policy 10
R2(config-isakmp# encryption 3des
R2(config-isakmp)# hash md5
R2(config-isakmp)# authenication pre-share
R2(config-isakmp)# group 2
R2(config-isakmp)# exit
R2(config)# crypto isakmp key “testkey123” address 20.20.20.2
-Bước 4: Cấu hình IPSEC Phase 2 (IPSEC Profile):
Router R1:
R1(config)# crypto ipsec transform-set “TRSET” esp-3des esp-md5-hmac : Transform-set
này định nghĩa giao thức mã hóa và xác thực của IPSEC.
R1(cfg-crypto-trans)# exit
R1(config)# crypto ipsec profile “GRE-PROTECTION” : Đây là ipsec profile sẽ sử dụng để
bảo vệ GRE Tunnel.
R1(ipsec-profile)# set transform-set “TRSET” : Gán transform-set đã cấu hình ở trên
R1(ipsec-profile)# exit
Router R2:
R2(config)# crypto ipsec transform-set “TRSET” esp-3des esp-md5-hmac : Transform-set
này định nghĩa giao thức mã hóa và xác thực của IPSEC.
R2(cfg-crypto-trans)# exit
R2(config)# crypto ipsec profile “GRE-PROTECTION” : Đây là ipsec profile sẽ sử dụng để
bảo vệ GRE Tunnel.
R2(ipsec-profile)# set transform-set “TRSET” : Gán transform-set đã cấu hình ở trên
R2(ipsec-profile)# exit
-Bước 5: Attach IPSEC Protectionprofile to GRE Tunnel
Router R1:
R1(config)# int Tunnel 0
R1(config-if)# tunnel protection ipsec profile GRE-PROTECTION : Gắn IPSEC Profile cấu
hình trước đó để bảo vệ cho GRE tunnel.
Router R2:
R2(config)# int Tunnel 0
R2(config-if)# tunnel protection ipsec profile GRE-PROTECTION
2.2 Hub-and-Spoke VPN Using with GRE IPSEC Protection
Cấu hình tương tự như Site-to-Site GRE with IPSEC Protection. Router HUB cấu hình mỗi
tunnel riêng tương ứng với 1 Spoke, điều này không hợp lý trong một mạng lớn. GRE VPN
yêu cầu tất cả các site đều phải có static IP Public.
-Bước 1: Cấu hình GRE Tunnels:
Router R1:
R1(config)# interface Tunnel0 : GRE Tunnel for Site-to-Site VPN with R2
R1(config-if)# ip address 10.0.0.1 255.255.255.0 : Đặt IP cho tunnel
R1(config-if)# tunnel source 20.20.20.2 : IP public of port WAN
R1(config-if)# tunnel destination 30.30.30.2 : IP public of R2
R1(config-if)# exit
R1(config)# interface Tunnel1 : GRE tunnel for site-to-site VPN with R3
R1(config-if)# ip address 10.1.1.1 255.255.255.0
R1(config-if)# tunnel source 20.20.20.2
R1(config-if)# tunnel destination 40.40.40.2
R1(config-if)# exit
-Bước 2: Cấu hình định tuyến giữa các tunnel và IP LAN
-Bước 3: Cấu hình IPSEC Phase 1:
Router Hub :R1
R1(config)# cypto isakmp policy 10
R1(config-isakmp)# encryption 3des
R1(config-isakmp)# hash md5
R1(config-isakmp)# authentication pre-share
R1(config-isakmp)# group 2
R1(config-isakmp)# exit
Tạo 2 pre-share key cho mỗi Spoke Branch Router:
R1(config)# crypto isakmp key “testkey123” address 30.30.30.2
R1(config)# crypto isakmp key “testkey1234” address 40.40.40.2
-Bước 4: Cấu hình IPSEC Phase 2 (ipsec profile):
Router R1:
R1(config)# crypto transform-set “TRSET” esp-3des esp-md5-hmac
R1(cfg-crypto-trans)#exit
R1(config)# crypto ipsec profile “GRE-PROTECTION”
R1(config)# set transform-set “TRSET”
R1(config-profile)# exit
-Bước 5: Gán IPSEC Protectionprofile to GRE Tunnels
Router R1:
R1(config)#interface Tunnel0
R1(config-if)# tunnel protection ipsec profile “GRE-PROTECTION”
R1(config)# interface Tunnel1
R1(config-if)# tunnel protection ipsec profile “GRE-PROTECTION”
Note: R2 và R3 cấu hình tương tự như trong trường hợp Site-to-Site GRE with IPSEC
Protection.
2.3 Dynamic Multipoint VPN (DMVPN)
Config trên các Spoke tương tự nhau, dưới đây ta chỉ cấu hình Spoke R3.
-Bước 1 : Cấu hình Multipoint GRE Tunnel:
+Router R1 (HUB):
R1(config)# interface fa0/1 : Public WAN interface on Hub router
R1(config-if)# ip address 20.20.20.2 255.255.255.0 : Đặt ip public cho port WAN
R1(config-if)# exit
R1(config)# int Tunnel : mGRE interface
R1(config-if)# ip add 10.0.0.1 255.255.255.0 : IP address of Tunnel
R1(config-if)# tunnel source fa0/1 : Source of Tunnel is the WAN interface
R1(config-if)# tunnel mode gre multipoint : Set tunnel mode as mGRE
R1(config-if)#ip mtu 1440: Reduce the MTU to allow extra overhead from mGRE and IPSEC
+Router Spoke : 2 Spoke config tương tự nhau
R3(config)# int fa0/1 : public WAN interface on Spoke Router.
R3(config-if)# ip address dhcp : R3 sử dụng dynamic ip public
R3(config-if)# exit
R3(config)# int Tunnel0 : This is the mGRE interface
R3(config-if)# ip address 10.0.0.3 255.255.255.0 : IP of Tunnel cùng subnet với ip tunnel of
HUB
R3(config-if)#tunnel source fa0/1 : source của tunnel là cổng WAN
R3(config-if)# tunnel mode gre multipoint : Set the tunnel mode as mGRE
R3(config-if)#ip mtu 1440: Reduce the MTU to allow extra overhead from mGRE and IPSEC
-Bước 2 : Cấu hình Next Hop Resolution Protocol (NHRP) :
Router R1 (HUB):
Note : Địa chỉ của NHRP Server (NHS) luôn luôn là địa chỉa của Tunnel Interface of Hub.
R1(config)# int Tunnel0
R1(config-if)# ip nhrp authentication “NHRPkey” : Key để xác thực clients.
R1(config-if)# ip nhrp map multicast dynamic : Enable forwarding of multicast traffic across
the tunnel.
R1(config-if)# ip nhrp network-id “100” : Indentifies the DMVPN cloud. Tất cả router phải
có network-id giống nhau.
R1(config-if)# tunnel key “100” : Có thể có hoặc ko. Chỉ từ IOS 12.3 trở lên mới có option
này
SPOKE (ROUTER R3) :
R3(config)# interface Tunnel0 : Get back into the Tunnel Interface
R3(config-if)# ip nhrp authentication “NHRPkey” : Secret key for authenticating with Hub
R3(config-if)# ip nhrp map multicast dynamic : Enables forwarding of multicast traffic
across the tunnel.
R3(config-if)# ip nhrp network-id 100 : Identifies the DMVPN cloud. All routers must have
the same network ID.
R3(config-if)# tunnel key 100 : OPTIONAL. Needed only on older IOS versions such as 12.3
R3(config-if)# ip nhrp map 10.0.0.1 20.20.20.2 : Map the NHS address (10.0.0.1 on Hub)
with the Hub’s WAN public IP (20.20.20.2)
R3(config-if)# ip nhrp map multicast 20.20.20.2 : Send multicast traffic to the Hub only. Hub
will receive all multicast traffic (e.g routing protocol updates) and then send out updates to
all the Spoke routers.
R3(config-if)# ip nhrp nhs 10.0.0.1 : Specify the NHS IP (this is always the private IP of the
Tunnel Interface on Hub router)
R3(config-if)# exit
-Bước 3: Cấu hình giao thức định tuyến động (Dynamic Routing):
Nhớ quảng bá dải IP của tunnel
Nếu sử dụng EIGRP thì phải disable split-horizon như sau:
HUB :
R1(config)# router eigrp 90 Create an EIGRP instance with Autonomous System 90
R1(config-router)# no auto-summary Disable automatic summarization of subnets
R1(config-router)# network 10.0.0.0 0.0.0.255 DMVPN Tunnel Interface Subnet
R1(config-router)# network 192.168.1.0 0.0.0.255 Hub LAN subnet
R1(config-router)# exit
R1(config)# interface Tunnel0 Get back into the Tunnel Interface
R1(config-if)# no ip split-horizon eigrp 90 Disable Split Horizon
R1(config-if)# no ip next-hop-self eigrp 90 Disable next hop self
R1(config-if)# no ip redirects  Useful to have
R1(config-if)# exit
Spoke (Router R3):
R3(config)# router eigrp 90Create an EIGRP instance with Autonomous System 90
R3(config-router)# no auto-summaryDisable automatic summarization of subnets
R3(config-router)# network 10.0.0.0 0.0.0.255DMVPN Tunnel Interface Subnet
R3(config-router)# network 192.168.3.0 0.0.0.255LAN subnet
R3(config-router)# exit
R3(config)# interface Tunnel0Get back into the Tunnel Interface
R3(config-if)# no ip split-horizon eigrp 90Disable Split Horizon
R3(config-if)# no ip next-hop-self eigrp 90Disable next hop self
R3(config-if)# no ip redirects Useful to have
R1(config-if)# exit
Bước 4: Cấu hình IPSEC PROTECTION:
Router-1 (HUB):
R1(config)# crypto isakmp policy 10
R1(config-isakmp)# encryption 3des
R1(config-isakmp)# hash md5
R1(config-isakmp)# authentication pre-share
R1(config-isakmp)# group 2
R1(config-isakmp)# exit
R1(config)# crypto isakmp key strongsecretkey address 0.0.0.0 0.0.0.0
R1(config)# crypto ipsec transform-set TRSET esp-3des esp-sha-hmac
R1(cfg-crypto-trans)# exit
R1(config)# crypto ipsec profile PROTECT-DMVPN
R1(ipsec-profile)# set transform-set TRSET
R1(ipsec-profile)# exit
R1(config)# interface Tunnel0
R1(config-if)# tunnel protection ipsec profile PROTECT-DMVPN
Router-3 (SPOKE):
R3(config)# crypto isakmp policy 10
R3(config-isakmp)# encryption 3des
R3(config-isakmp)# hash md5
R3(config-isakmp)# authentication pre-share
R3(config-isakmp)# group 2
R3(config-isakmp)# exit
R3(config)# crypto isakmp ke
allow also connections from any IP in order to form IPSEC VPN tunnels with other Spokes.
R3(config)# crypto ipsec transform-set TRSET esp-3des esp-sha-hmac
R3(cfg-crypto-trans)# exit
R3(config)# crypto ipsec profile PROTECT-DMVPN
R3(ipsec-profile)# set transform-set TRSET
R3(ipsec-profile)# exit
R3(config)# interface Tunnel0
R3(config-if)# tunnel protection ipsec profile PROTECT-DMVPN
Vpn config-on-cisco-devices

More Related Content

What's hot

Cấu hình cisco auto qos (cisco ios software)
Cấu hình cisco auto qos (cisco ios software)Cấu hình cisco auto qos (cisco ios software)
Cấu hình cisco auto qos (cisco ios software)
VNG
 
Lab 1 nbar – khám phá những lưu lượng chạy qua router
Lab 1  nbar – khám phá những lưu lượng chạy qua routerLab 1  nbar – khám phá những lưu lượng chạy qua router
Lab 1 nbar – khám phá những lưu lượng chạy qua router
VNG
 
Mô hình demo giữa cisco router
Mô hình demo giữa cisco routerMô hình demo giữa cisco router
Mô hình demo giữa cisco router
lOng DưƠng
 
Báo cáo thực tập tuần 3
Báo cáo thực tập tuần 3Báo cáo thực tập tuần 3
Báo cáo thực tập tuần 3duytruyen1993
 
Tích hợp microsoft lync, asterisk va skype
Tích hợp microsoft lync, asterisk va skypeTích hợp microsoft lync, asterisk va skype
Tích hợp microsoft lync, asterisk va skype
laonap166
 
Lab ccna ttg_v1
Lab ccna ttg_v1Lab ccna ttg_v1
Lab ccna ttg_v1
Ngo Kiet
 
Lab 7 cấu hình thực hiện cuộc gọi giữa 2 vùng được quản lý bởi 2 gatekeeper (...
Lab 7 cấu hình thực hiện cuộc gọi giữa 2 vùng được quản lý bởi 2 gatekeeper (...Lab 7 cấu hình thực hiện cuộc gọi giữa 2 vùng được quản lý bởi 2 gatekeeper (...
Lab 7 cấu hình thực hiện cuộc gọi giữa 2 vùng được quản lý bởi 2 gatekeeper (...
VNG
 
Vpn Site-to-site trên Cisco
Vpn Site-to-site trên CiscoVpn Site-to-site trên Cisco
Vpn Site-to-site trên CiscoTài Bùi
 

What's hot (9)

Acl
AclAcl
Acl
 
Cấu hình cisco auto qos (cisco ios software)
Cấu hình cisco auto qos (cisco ios software)Cấu hình cisco auto qos (cisco ios software)
Cấu hình cisco auto qos (cisco ios software)
 
Lab 1 nbar – khám phá những lưu lượng chạy qua router
Lab 1  nbar – khám phá những lưu lượng chạy qua routerLab 1  nbar – khám phá những lưu lượng chạy qua router
Lab 1 nbar – khám phá những lưu lượng chạy qua router
 
Mô hình demo giữa cisco router
Mô hình demo giữa cisco routerMô hình demo giữa cisco router
Mô hình demo giữa cisco router
 
Báo cáo thực tập tuần 3
Báo cáo thực tập tuần 3Báo cáo thực tập tuần 3
Báo cáo thực tập tuần 3
 
Tích hợp microsoft lync, asterisk va skype
Tích hợp microsoft lync, asterisk va skypeTích hợp microsoft lync, asterisk va skype
Tích hợp microsoft lync, asterisk va skype
 
Lab ccna ttg_v1
Lab ccna ttg_v1Lab ccna ttg_v1
Lab ccna ttg_v1
 
Lab 7 cấu hình thực hiện cuộc gọi giữa 2 vùng được quản lý bởi 2 gatekeeper (...
Lab 7 cấu hình thực hiện cuộc gọi giữa 2 vùng được quản lý bởi 2 gatekeeper (...Lab 7 cấu hình thực hiện cuộc gọi giữa 2 vùng được quản lý bởi 2 gatekeeper (...
Lab 7 cấu hình thực hiện cuộc gọi giữa 2 vùng được quản lý bởi 2 gatekeeper (...
 
Vpn Site-to-site trên Cisco
Vpn Site-to-site trên CiscoVpn Site-to-site trên Cisco
Vpn Site-to-site trên Cisco
 

Viewers also liked

Giai phap ERP cho ngan hang
Giai phap ERP cho ngan hangGiai phap ERP cho ngan hang
Giai phap ERP cho ngan hangtthanh03t2
 
Sap business one solution in detail gain efficiency, maintain control, and ...
Sap business one solution in detail   gain efficiency, maintain control, and ...Sap business one solution in detail   gain efficiency, maintain control, and ...
Sap business one solution in detail gain efficiency, maintain control, and ...
Duc-Kien Nguyen
 
CÁC YẾU TỐ ẢNH HƯỞNG ĐẾN SỰ CHẤP NHẬN SỬ DỤNG PHẦN MỀM ERP MÃ NGUỒN MỞ Ở VIỆT...
CÁC YẾU TỐ ẢNH HƯỞNG ĐẾN SỰ CHẤP NHẬN SỬ DỤNG PHẦN MỀM ERP MÃ NGUỒN MỞ Ở VIỆT...CÁC YẾU TỐ ẢNH HƯỞNG ĐẾN SỰ CHẤP NHẬN SỬ DỤNG PHẦN MỀM ERP MÃ NGUỒN MỞ Ở VIỆT...
CÁC YẾU TỐ ẢNH HƯỞNG ĐẾN SỰ CHẤP NHẬN SỬ DỤNG PHẦN MỀM ERP MÃ NGUỒN MỞ Ở VIỆT...
Vu Hung Nguyen
 
CÁC YẾU TỐ ẢNH HƢỞNG ĐẾN SỰ CHẤP NHẬN SỬ DỤNG PHẦN MỀM ERP MÃ NGUỒN MỞ Ở VI...
CÁC YẾU TỐ ẢNH HƢỞNG ĐẾN SỰ CHẤP NHẬN   SỬ DỤNG PHẦN MỀM ERP MÃ NGUỒN MỞ Ở VI...CÁC YẾU TỐ ẢNH HƢỞNG ĐẾN SỰ CHẤP NHẬN   SỬ DỤNG PHẦN MỀM ERP MÃ NGUỒN MỞ Ở VI...
CÁC YẾU TỐ ẢNH HƢỞNG ĐẾN SỰ CHẤP NHẬN SỬ DỤNG PHẦN MỀM ERP MÃ NGUỒN MỞ Ở VI...
Vu Hung Nguyen
 
BAC- OpenERP Offline
BAC- OpenERP OfflineBAC- OpenERP Offline
BAC- OpenERP OfflinePhung Tran
 
Ke hoach trien khai du an
Ke hoach trien khai du anKe hoach trien khai du an
Ke hoach trien khai du antrungthaydo1
 
ERP cho doanh nghiệp du lịch
ERP cho doanh nghiệp du lịchERP cho doanh nghiệp du lịch
ERP cho doanh nghiệp du lịch
Le Ngoc Quang
 
ERP 9. Lộ trình đầu tư giải pháp
ERP 9. Lộ trình đầu tư giải phápERP 9. Lộ trình đầu tư giải pháp
ERP 9. Lộ trình đầu tư giải pháp
Le Ngoc Quang
 
Phần mềm quản lý doanh nghiệp ERP
Phần mềm quản lý doanh nghiệp ERPPhần mềm quản lý doanh nghiệp ERP
Phần mềm quản lý doanh nghiệp ERP
Cao Thừa
 
02 vietsoft erp
02 vietsoft erp02 vietsoft erp
02 vietsoft erp
Vietsoft Co., Ltd
 
ERP 2. ERP đại cương và thực tiễn
ERP 2. ERP đại cương và thực tiễnERP 2. ERP đại cương và thực tiễn
ERP 2. ERP đại cương và thực tiễn
Le Ngoc Quang
 
Hệ sinh thái doanh nghiệp thông minh
Hệ sinh thái doanh nghiệp thông minhHệ sinh thái doanh nghiệp thông minh
Hệ sinh thái doanh nghiệp thông minh
Le Ngoc Quang
 
56123159 android
56123159 android56123159 android
56123159 androidHieu Pham
 
ERP 4. Yếu tố thành công hay thất bại
ERP 4. Yếu tố thành công hay thất bạiERP 4. Yếu tố thành công hay thất bại
ERP 4. Yếu tố thành công hay thất bại
Le Ngoc Quang
 
ERP 3. Nhận thức lãnh đạo về ERP
ERP 3. Nhận thức lãnh đạo về ERPERP 3. Nhận thức lãnh đạo về ERP
ERP 3. Nhận thức lãnh đạo về ERP
Le Ngoc Quang
 
Bài 3: Hệ thống quản trị quan hệ khách hàng và nghiệp vụ kinh doanh
Bài 3: Hệ thống quản trị quan hệ khách hàng và nghiệp vụ kinh doanhBài 3: Hệ thống quản trị quan hệ khách hàng và nghiệp vụ kinh doanh
Bài 3: Hệ thống quản trị quan hệ khách hàng và nghiệp vụ kinh doanh
MasterCode.vn
 
Ssl Vpn presentation at CoolTech club
Ssl Vpn presentation at CoolTech clubSsl Vpn presentation at CoolTech club
Ssl Vpn presentation at CoolTech club
iplotnikov
 

Viewers also liked (18)

Erp acb cn dn
Erp acb cn dnErp acb cn dn
Erp acb cn dn
 
Giai phap ERP cho ngan hang
Giai phap ERP cho ngan hangGiai phap ERP cho ngan hang
Giai phap ERP cho ngan hang
 
Sap business one solution in detail gain efficiency, maintain control, and ...
Sap business one solution in detail   gain efficiency, maintain control, and ...Sap business one solution in detail   gain efficiency, maintain control, and ...
Sap business one solution in detail gain efficiency, maintain control, and ...
 
CÁC YẾU TỐ ẢNH HƯỞNG ĐẾN SỰ CHẤP NHẬN SỬ DỤNG PHẦN MỀM ERP MÃ NGUỒN MỞ Ở VIỆT...
CÁC YẾU TỐ ẢNH HƯỞNG ĐẾN SỰ CHẤP NHẬN SỬ DỤNG PHẦN MỀM ERP MÃ NGUỒN MỞ Ở VIỆT...CÁC YẾU TỐ ẢNH HƯỞNG ĐẾN SỰ CHẤP NHẬN SỬ DỤNG PHẦN MỀM ERP MÃ NGUỒN MỞ Ở VIỆT...
CÁC YẾU TỐ ẢNH HƯỞNG ĐẾN SỰ CHẤP NHẬN SỬ DỤNG PHẦN MỀM ERP MÃ NGUỒN MỞ Ở VIỆT...
 
CÁC YẾU TỐ ẢNH HƢỞNG ĐẾN SỰ CHẤP NHẬN SỬ DỤNG PHẦN MỀM ERP MÃ NGUỒN MỞ Ở VI...
CÁC YẾU TỐ ẢNH HƢỞNG ĐẾN SỰ CHẤP NHẬN   SỬ DỤNG PHẦN MỀM ERP MÃ NGUỒN MỞ Ở VI...CÁC YẾU TỐ ẢNH HƢỞNG ĐẾN SỰ CHẤP NHẬN   SỬ DỤNG PHẦN MỀM ERP MÃ NGUỒN MỞ Ở VI...
CÁC YẾU TỐ ẢNH HƢỞNG ĐẾN SỰ CHẤP NHẬN SỬ DỤNG PHẦN MỀM ERP MÃ NGUỒN MỞ Ở VI...
 
BAC- OpenERP Offline
BAC- OpenERP OfflineBAC- OpenERP Offline
BAC- OpenERP Offline
 
Ke hoach trien khai du an
Ke hoach trien khai du anKe hoach trien khai du an
Ke hoach trien khai du an
 
ERP cho doanh nghiệp du lịch
ERP cho doanh nghiệp du lịchERP cho doanh nghiệp du lịch
ERP cho doanh nghiệp du lịch
 
ERP 9. Lộ trình đầu tư giải pháp
ERP 9. Lộ trình đầu tư giải phápERP 9. Lộ trình đầu tư giải pháp
ERP 9. Lộ trình đầu tư giải pháp
 
Phần mềm quản lý doanh nghiệp ERP
Phần mềm quản lý doanh nghiệp ERPPhần mềm quản lý doanh nghiệp ERP
Phần mềm quản lý doanh nghiệp ERP
 
02 vietsoft erp
02 vietsoft erp02 vietsoft erp
02 vietsoft erp
 
ERP 2. ERP đại cương và thực tiễn
ERP 2. ERP đại cương và thực tiễnERP 2. ERP đại cương và thực tiễn
ERP 2. ERP đại cương và thực tiễn
 
Hệ sinh thái doanh nghiệp thông minh
Hệ sinh thái doanh nghiệp thông minhHệ sinh thái doanh nghiệp thông minh
Hệ sinh thái doanh nghiệp thông minh
 
56123159 android
56123159 android56123159 android
56123159 android
 
ERP 4. Yếu tố thành công hay thất bại
ERP 4. Yếu tố thành công hay thất bạiERP 4. Yếu tố thành công hay thất bại
ERP 4. Yếu tố thành công hay thất bại
 
ERP 3. Nhận thức lãnh đạo về ERP
ERP 3. Nhận thức lãnh đạo về ERPERP 3. Nhận thức lãnh đạo về ERP
ERP 3. Nhận thức lãnh đạo về ERP
 
Bài 3: Hệ thống quản trị quan hệ khách hàng và nghiệp vụ kinh doanh
Bài 3: Hệ thống quản trị quan hệ khách hàng và nghiệp vụ kinh doanhBài 3: Hệ thống quản trị quan hệ khách hàng và nghiệp vụ kinh doanh
Bài 3: Hệ thống quản trị quan hệ khách hàng và nghiệp vụ kinh doanh
 
Ssl Vpn presentation at CoolTech club
Ssl Vpn presentation at CoolTech clubSsl Vpn presentation at CoolTech club
Ssl Vpn presentation at CoolTech club
 

Similar to Vpn config-on-cisco-devices

đinh tuyến tĩnh và định tuyến động
đinh tuyến tĩnh và định tuyến độngđinh tuyến tĩnh và định tuyến động
đinh tuyến tĩnh và định tuyến độngnguyenhoangbao
 
Báo cáo thực tập athena trần trọng thái
Báo cáo thực tập athena trần trọng tháiBáo cáo thực tập athena trần trọng thái
Báo cáo thực tập athena trần trọng tháitran thai
 
Ccna lap
Ccna lapCcna lap
Ccna lap
hoangculis
 
Lab 3 phân loại dùng nbar
Lab 3 phân loại dùng nbarLab 3 phân loại dùng nbar
Lab 3 phân loại dùng nbar
VNG
 
Cấu hình rip cơ bản
Cấu hình rip cơ bảnCấu hình rip cơ bản
Cấu hình rip cơ bản
VNG
 
Ccip tổng quan mpls
Ccip tổng quan mplsCcip tổng quan mpls
Ccip tổng quan mpls
VNG
 
Báo cáo thực tập tuần 4
Báo cáo thực tập tuần 4Báo cáo thực tập tuần 4
Báo cáo thực tập tuần 4tran thai
 
Hướng dẫn cài đặt và cấu hình cacti trên cent os
Hướng dẫn cài đặt và cấu hình cacti trên cent osHướng dẫn cài đặt và cấu hình cacti trên cent os
Hướng dẫn cài đặt và cấu hình cacti trên cent os
laonap166
 
Lab_basic_config_router.pptx
Lab_basic_config_router.pptxLab_basic_config_router.pptx
Lab_basic_config_router.pptx
HuyAnhPhan1
 
Bao cao final
Bao cao finalBao cao final
Bao cao final
Quân Quạt Mo
 
Cisco vpn client to site by woonshine
Cisco vpn client to site by woonshineCisco vpn client to site by woonshine
Cisco vpn client to site by woonshinewoonshine
 
Báo cáo thực tập tuần 1
Báo cáo thực tập tuần 1Báo cáo thực tập tuần 1
Báo cáo thực tập tuần 1tran thai
 
Báo cáo thực tập tuần 7 - 8 tại athena - đàm văn sáng
Báo cáo thực tập tuần 7 - 8 tại athena - đàm văn sángBáo cáo thực tập tuần 7 - 8 tại athena - đàm văn sáng
Báo cáo thực tập tuần 7 - 8 tại athena - đàm văn sáng
Đàm Văn Sáng
 
Gatekeeper
GatekeeperGatekeeper
Gatekeeper
VNG
 
Cấu hình osp fv3 cơ bản
Cấu hình osp fv3 cơ bảnCấu hình osp fv3 cơ bản
Cấu hình osp fv3 cơ bản
VNG
 
Cai dat va_cau_hinh_iptables
Cai dat va_cau_hinh_iptablesCai dat va_cau_hinh_iptables
Cai dat va_cau_hinh_iptables
Nguyen Van Hung
 
Thực hành cơ sở mạng truyền thông
Thực hành cơ sở mạng truyền thôngThực hành cơ sở mạng truyền thông
Thực hành cơ sở mạng truyền thông
Ai Tôi
 
Clien tositegns3
Clien tositegns3Clien tositegns3
Clien tositegns3td1021
 
Cấu hình nat – pt
Cấu hình nat – ptCấu hình nat – pt
Cấu hình nat – ptHate To Love
 

Similar to Vpn config-on-cisco-devices (20)

địNh tuyến tĩnh
địNh tuyến tĩnhđịNh tuyến tĩnh
địNh tuyến tĩnh
 
đinh tuyến tĩnh và định tuyến động
đinh tuyến tĩnh và định tuyến độngđinh tuyến tĩnh và định tuyến động
đinh tuyến tĩnh và định tuyến động
 
Báo cáo thực tập athena trần trọng thái
Báo cáo thực tập athena trần trọng tháiBáo cáo thực tập athena trần trọng thái
Báo cáo thực tập athena trần trọng thái
 
Ccna lap
Ccna lapCcna lap
Ccna lap
 
Lab 3 phân loại dùng nbar
Lab 3 phân loại dùng nbarLab 3 phân loại dùng nbar
Lab 3 phân loại dùng nbar
 
Cấu hình rip cơ bản
Cấu hình rip cơ bảnCấu hình rip cơ bản
Cấu hình rip cơ bản
 
Ccip tổng quan mpls
Ccip tổng quan mplsCcip tổng quan mpls
Ccip tổng quan mpls
 
Báo cáo thực tập tuần 4
Báo cáo thực tập tuần 4Báo cáo thực tập tuần 4
Báo cáo thực tập tuần 4
 
Hướng dẫn cài đặt và cấu hình cacti trên cent os
Hướng dẫn cài đặt và cấu hình cacti trên cent osHướng dẫn cài đặt và cấu hình cacti trên cent os
Hướng dẫn cài đặt và cấu hình cacti trên cent os
 
Lab_basic_config_router.pptx
Lab_basic_config_router.pptxLab_basic_config_router.pptx
Lab_basic_config_router.pptx
 
Bao cao final
Bao cao finalBao cao final
Bao cao final
 
Cisco vpn client to site by woonshine
Cisco vpn client to site by woonshineCisco vpn client to site by woonshine
Cisco vpn client to site by woonshine
 
Báo cáo thực tập tuần 1
Báo cáo thực tập tuần 1Báo cáo thực tập tuần 1
Báo cáo thực tập tuần 1
 
Báo cáo thực tập tuần 7 - 8 tại athena - đàm văn sáng
Báo cáo thực tập tuần 7 - 8 tại athena - đàm văn sángBáo cáo thực tập tuần 7 - 8 tại athena - đàm văn sáng
Báo cáo thực tập tuần 7 - 8 tại athena - đàm văn sáng
 
Gatekeeper
GatekeeperGatekeeper
Gatekeeper
 
Cấu hình osp fv3 cơ bản
Cấu hình osp fv3 cơ bảnCấu hình osp fv3 cơ bản
Cấu hình osp fv3 cơ bản
 
Cai dat va_cau_hinh_iptables
Cai dat va_cau_hinh_iptablesCai dat va_cau_hinh_iptables
Cai dat va_cau_hinh_iptables
 
Thực hành cơ sở mạng truyền thông
Thực hành cơ sở mạng truyền thôngThực hành cơ sở mạng truyền thông
Thực hành cơ sở mạng truyền thông
 
Clien tositegns3
Clien tositegns3Clien tositegns3
Clien tositegns3
 
Cấu hình nat – pt
Cấu hình nat – ptCấu hình nat – pt
Cấu hình nat – pt
 

Vpn config-on-cisco-devices

  • 1. I.VPN CONFIG ON CISCO ROUTER 1 Policy Base VPN Configuration on Cisco Router 1.1 Site-to-Site IPSEC VPN 1.1.1 Site-to-Site IPSEC-VPN with static IP -Bước 1: Cấu hình Interesting trafic:
  • 2. R1(config)#ip access-list extended VPN-ACL R1(config-ext-nacl)#permit ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255 R2(config)#ip access-list extended VPN-ACL R2(config-ext-nacl)#permit ip 192.168.2.0 0.0.0.255 192.168.1.0 0.0.0.255 -Bước 2: Cấu hình loại bỏ các traffic sử dụng internet: +R1: R1(config)#ip access-list extended NAT-ACL R1(config-ext-nacl)#deny ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255 : loại bỏ traffic từ LAN1 đến LAN2 trong hoạt động của NAT R1(config-ext-nacl)#permit ip 192.168.1.0 0.0.0.255 any : cho phep tat ca traffic khac tu LAN1 duoc NAT Kích hoạt chức năng NAT trên port: R1(config)#ip nat inside source list NAT-ACL interface fa0/0 overload R1(config)#int fa0/0 R1(config-if)#ip nat outside R1(config)#int fa0/1 R1(config-if)#ip nat inside +R2: Làm tương tự như R1 -Bước 3: Cấu hình Phase 1(ISAKMP) : Để thiết lập 1 kênh sercure channel +R1: R1(config)#crypto isakmp policy 1 : tạo policy 1. Có thể có nhiều policy R1(config-isakmp)#encryption 3des(hoặc aes hoặc des) R1(config-isakmp)#hash md5(hoặc sha) R1(config-isakmp)#authentication pre-share : để xác thực R1(config-isakmp)#group 2 (hoặc 5) R1(config-isakmp)#exit R1(config)# crypto isakmp key “secretkey” address “200.200.200.1”: định nghĩa 1 pre-shared key(“secretkey”) cho xác thực với remote peer IP 200.200.200.1 +R2: Làm tương tự như R1
  • 3. -Bước 4: Cấu hình Phase 2(IPSec) Để mã hóa và xác thực mạnh ta dùng 1 trong 2 cặp sau: +ESP-3DES and ESP-MD5-HMAC +ESP-AES and ESP-SHA-HMAC +R1: R1(config)#crypto ipsec transform-set “TRSET” esp-md5-hmac : cấu hình 1 transform set với 3des để mã hóa và MD5-HMAC để xác thực R1(cfg-crypto-trans)# exit R1(config)#crypto map VPNMAP 10 ipsec-isakmp R1(config-crypto-map)# set peer 200.200.200.1 R1(config-crypto-map)#set transform-set “TRSET” R1(config-crypto-map)# match address VPN-ACL R1(config-crypto-map)# exit Gán crypto-map vào interface WAN: R1(config)# int fa0/0 R1(config-if)# crypto map VPNMAP +R2: Làm tương tự như R1 Note: Kiểm tra R#show crypto isakmp sa : để kiểm tra thiết lập tunnel R#show crypto ipsec sa : để kiểm tra encrypted dữ liệu ở 2 đầu 1.1.2 IPSEC VPN Site-To-Site with dynamic IP -Bước 1 & Bước 2 làm tương tự như mục 1.1: Cấu hình Interesting Traffic và loại bỏ traffic NAT
  • 4. -Bước 3: Phase 1 Configuration +R1: R1(config)#crypto isakmp policy 1 : tạo policy 1. Có thể có nhiều policy R1(config-isakmp)#encryption 3des(hoặc aes hoặc des) R1(config-isakmp)#hash md5(hoặc sha) R1(config-isakmp)#authentication pre-share : để xác thực R1(config-isakmp)#group 2 (hoặc 5) R1(config-isakmp)#exit R1(config)# crypto isakmp key “secretkey” address 0.0.0.0 0.0.0.0 : định nghĩa 1 pre-shared key(“secretkey”) cho xác thực với remote peer IP +R2: Config Phase 1 tương tự như cấu hình site-to-site -Bước 4 : Cấu hình Phase 2: R1(config)#crypto ipsec transform-set “TRSET” esp-md5-hmac : cấu hình 1 transform set với 3des để mã hóa và MD5-HMAC để xác thực
  • 5. Đầu tiên tạo 1 dynamic crypto map(DYNMAP) trong đó có Transform Set và Crypto ACL: R1(config)# crypto dynamic-map “DYNMAP” 10 R1(config-crypto-map)# set transform-set “TRSET” R1(config-crypto-map)#match address “VPN-ACL” R1(config-crypto-map)# exit Tạo 1 static crypto map (VPNMAP) sử dụng dynamic map đã cấu hình trước đó R1(config)# crypto map “VPNMAP” 10 ipsec-isakmp dynamic DYNMAP Gán static crypto map (VPNMAP) vào cổng out WAN outside of router R1: R1(config)# int fa0/0 R1(config-if)# crypto map “VPNMAP” +R2: Cấu hình Phase 2 cho R2 tương tự như trong trường hợp Site-to-Site with static IP
  • 6. 1.2. HUB and SPOKE IPSEC VPN -R1(HUB): +Đầu tiên cấu hình xác định Interesting traffic: R1(config)# ip access-list extended VPN-TO-REMOTE1 R1(config-ext-nacl)# permit ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255 R1(config)# ip access-list extended VPN-TO-REMOTE2 R1(config-ext-nacl)# permit ip 192.168.1.0 0.0.0.255 192.168.3.0 0.0.0.255 +Loại bỏ Interesting traffic trong NAT: R1(config)# ip access-list extended NAT-ACL R1(config-ext-nacl)# deny ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255 R1(config-ext-nacl)# deny ip 192.168.1.0 0.0.0.255 192.168.3.0 0.0.0.255
  • 7. R1(config-ext-nacl)# permit ip 192.168.1.0 0.0.0.255 any + Cấu hình Phase 1 ISAKMP Parameters: R1(config)# crypto isakmp policy 1 R1(config-isakmp)# encryption 3des R1(config-isakmp)# hash md5 R1(config-isakmp)# authentication pre-share R1(config-isakmp)# group 2 R1(config-isakmp)# exit + Cấu hình 1 pre-share key khác nhau cho mỗi Spoke Site: R1(config)# crypto isakmp key “secretkey1” address 30.30.30.2 R1(config)# crypto isakmp key “secretkey2” address 40.40.40.2 + Cấu hình Phase 2 Transform-set and Crypto Map: R1(config)# crypto ipsec transform-set “TRSET” esp-3des esp-md5-hmac R1(cfg-crypto-trans)# exit + Tạo crypto cho mỗi Spoke : R1(config)# crypto map “VPNMAP 10” ipsec-isakmp R1(config-crypto-map)# set peer 30.30.30.2 R1(config-crypto-map)# set transform-set “TRSET” R1(config-crypto-map)# match address VPN-TO-REMOTE1 R1(config-crypto-map)# exit R1(config)# crypto map “VPNMAP 20” ipsec-isakmp R1(config-crypto-map)# set peer 40.40.40.2 R1(config-crypto-map)# set transforms-set “TRSET” R1(config-crypto-map)# match address VPN-TO-REMOTE2 R1(config-crypto-map)# exit
  • 8. + Gán crypto map vào interface WAN: R1(config)# int fa0/0 R1(config-if)# crypto map VPNMAP Note: R1 & R2 cấu hình tương tự như cấu hình R2 trong trường hợp Site-to-Site. 1.3 Remote Access IPSEC VPN -Cấu hình trên Router R1: +Bước 1: Cấu hình VPN POOL để gán IP cho remote access client: R1(config)# ip local pool vpnpool “192.168.50.1 192.168.5.10” +Bước 2: Cấu hình VPN Interesting Traffic and NAT Exemption: Tạo access-list xác định traffic cho phép đi qua VPN R1(config)# ip access-list extended “VPN-ACL” R1(config-ext-nacl)# permit ip 192.168.1.0 .0.0.0.255 192.168.50.0 0.0.0.255
  • 9. Loại bỏ interesting traffic va cho phep NAT traffic nao đi ra internet: R1(config)# ip access-list extended NAT-ACL R1(config-ext-nacl)# deny ip 192.168.1.0 0.0.0.255 192.168.50.0 0.0.0.255 R1(config-ext-nacl)# permit ip 192.168.1.0 0.0.0.255 any Gán NAT vào interface fa0/0(inside) & interface fa0/1(outside): R1(config)# ip nat inside source list NAT-ACL int fa0/1 overload R1(config)# int fa0/1 R1(config-if)# ip nat outside R1(config)#int fa0/0 R1(config-if)# ip nat inside +Bước 3: Cấu hình xác thực user: Tạo 1 username/password cho mỗi remote user: R1(config)# username “vpnuser” password “strongpassword” Sau đó kích hoạt cơ chế AAA trên router: R1(config)# aaa new-model Cấu hình đăng nhập & ủy quyền: R1(config)# aaa authentication login “USERAUTH” local R1(config)# aaa authorization network “NETAUTHORIZE” local + Bước 4: Cấu hình IPSEC Phase 1(isakmp parameters): Đầu tiên cấu hình 1 isakmp policy tương tự như site-to-site IPSEC: R1(config)# crypto isakmp policy 10 R1(config-isakmp)# encryption 3des R1(config-isakmp)# hash md5 R1(config-isakmp)# authentication pre-share R1(config-isakmp)# group 2
  • 10. Keyring : để lưu trữ pre-shared-keys. Cấu hình 1 pre-shared key cho remote access VPN clients: R1(config)# crypto keyring “vpnclientskey” R1(config-keyring)# pre-shared-key address 0.0.0.0 0.0.0.0 key “cisco123” Cấu hình policy and parameters cho Group of remote users sẽ kế thừa: R1(config)# crypto isakmp client configuration group remotevpn <- Group name (see below) R1(config-isakmp-group)# key cisco123 <- Group Password (see picture below) R1(config-isakmp-group)# dns 192.168.1.2 R1(config-isakmp-group)# wins 192.168.1.2 R1(config-isakmp-group)# domain “mycompany.com” R1(config-isakmp-group)# pool vpnpool <- IP address pool configured before R1(config-isakmp-group)# acl VPN-ACL <- Split-Tunnel Access List Note: - Câu lệnh “acl VPN-ACL” thiết lập chia nhỏ tunnel. Nghĩa là, traffic sẽ đi qua VPN tunnel chỉ nếu nó matches với access-list VPN-ACL. Nếu bạn remove ACL này thì tất cả traffic sẽ đi qua VPN tunnel (tức là không cho phép truy cập internet từ vị trí của remote user). - Tên của Group cấu hình ở trên (remotevpn) and key (cisco123) phải được sử dụng trong “Group Authentication” (“Name”/”Password”) của phần mềm VPN client như hình dưới đây:
  • 11. Cấu hình 1 isakmp profile: R1(config)# crypto isakmp profile remoteclients R1(config-isa-prof)# description “Remote Access VPN clients” R1(config-isa-prof)# keyring “vpnclientskey” : cấu hình trước đó R1(config-isa-prof)# match identity group “remotevpn” : cấu hình trước đó R1(config-isa-prof)# client authentication list “USERAUTH” : cấu hình trước đó R1(config-isa-prof)# isakmp authorization list “NETAUTHORIZE” : cấu hình trước đó R1(config-isa-prof)# client configuration addres respond : Respond IP address request từ client. + Bước 5 : Cấu hình IPSEC Phase 2 (tương tự như trường hợp Site—to-Site with dynamic IP) : Cấu hình Phase 2 Transform Set and Crypto Map (tương tự trường hợp site-to-site VPN): R1(config)# crypto ipsec transform-set “TRSET” esp-3des esp-md5-hmac R1(cfg-crypto-trans)# exit Tạo 1 dynamic crypto map (DYNMAP) có Transform Set ở trên và isakmp profile (“remoteclients”) cấu hình trước đó : R1(config)# crypto dynamic-map DYNMAP 10
  • 12. R1(config-crypto-map)# set transform-set “TRSET” : sử dụng tranform-set có tên “TRSET” đã tạo trước đó R1(config-crypto-map)# set isakmp-profile “remoteclients” R1(config-crypto-map)# exit Tạo 1 static crypto map (VPNMAP) sử dụng dynamic map cấu hình trước đó: R1(config)# crypto map VPNMAP 10 ipsec-isakmp dynamic DYNMAP Gán static crypto map (VPNMAP) vào int fa0/1 WAN outside của router : R1(config)# int fa0/1 R1(config-if)# crypto map VPNMAP 1.4 Site-to-Site and Remote Access IPSEC VPN on same device
  • 13. -Router R1 (HUB) +Bước 1: Cấu hình VPN POOL để gán IP cho remote access client: R1(config)# ip local pool vpnpool “192.168.50.1 192.168.5.10” + Bước 2 : Cấu hình Interesting Traffic and NAT Exemption: Đầu tiên xác định Interesting Traffic để mã hóa. Có 3 crypto ACLs: R1(config)# ip access-list extended VPNsite1-ACL R1(config-ext-nacl)# permit ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255 R1(config)# ip access-list extended VPNsite2-ACL R1(config-ext-nacl)# permit ip 192.168.1.0 .0.0.255 192.168.3.0 0.0.0.255 R1(config)# ip access-list extended VPNclient-ACL R1(config-ext-nacl)# permit ip 192.168.1.0 0.0.0. 255 192.168.50.0 0.0.0.255 Loại bỏ Interesting traffic từ hoạt động của NAT: R1(config)# ip access-list extended NAT-ACL R1(config-ext-nacl)# deny ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255 R1(config-ext-nacl)# deny ip 192.168.1.0 0.0.0.255 192.168.3.0 0.0.0.255 R1(config-ext-nacl)# deny ip 192.168.1.0 0.0.0.255 192.168.50.0 0.0.0.255 R1(config-ext-nacl)# permit ip 192.168.1.0 0.0.0.255 any Gán NAT vào interface fa0/0(inside) & interface fa0/1(outside): R1(config)# ip nat inside source list NAT-ACL int fa0/1 overload R1(config)# int fa0/1 R1(config-if)# ip nat outside R1(config)#int fa0/0 R1(config-if)# ip nat inside +Bước 2: Cấu hình xác thực user: Tạo 1 username/password cho mỗi remote user:
  • 14. R1(config)# username “vpnuser” password “strongpassword” Sau đó kích hoạt cơ chế AAA trên router: R1(config)# aaa new-model Cấu hình đăng nhập & ủy quyền: R1(config)# aaa authentication login “USERAUTH” local R1(config)# aaa authorization network “NETAUTHORIZE” local + Bước 3: Cấu hình Phase 1 IPSEC: Cấu hình phase 1 isakmp policy: R1(config)# crypto isakmp policy 10 R1(config-isakmp)# encryption 3des R1(config-isamkp)# hash md5 R1(config-isakmp)# authentication pre-share R1(config-isakmp)# group 2 R1(config-isakmp)# exit Cấu hình crypto keyring để lưu trữ pre-shared keys: R1(config)# crypto keyring “vpnclientskey” : cho remote user R1(conf-keyring)# pre-shared-key address 0.0.0.0 0.0.0.0 key “cisco123” R1(conf-keyring)# exit R1(config)# crypto keyring “staticbranch” : cho site with static IP R1(conf-keyring)# pre-shared-key address 30.30.30.2 key “secretkey1” : nếu có nhiều site sử dụng static IP public thì thêm địa chỉ bởi câu lệnh này. R1(conf-keyring)# exit R1(config)# crypto keyring “dynamicbranch” R1(conf-keyring)# pre-shared-key address 0.0.0.0 0.0.0.0 key “secretkey2” R1(conf-keyring)# exit
  • 15. Cấu hình policy and parameters cho Group of remote users sẽ kế thừa: R1(config)# crypto isakmp client configuration group “remotevpn” <- Group name (see below) R1(config-isakmp-group)# key “cisco123” <- Group Password (see picture below) R1(config-isakmp-group)# dns 192.168.1.2 R1(config-isakmp-group)# wins 192.168.1.2 R1(config-isakmp-group)# domain “asahi-intecc.com” R1(config-isakmp-group)# pool vpnpool <- IP address pool configured before R1(config-isakmp-group)# acl VPNclient-ACL<- Split-Tunnel Access List Cấu hình of ISAKMP Profiles. R1(config)# crypto isakmp profile “staticL2L” : cho Branch với static IP public R1(conf-isa-prof)# keyring “staticbranch” : “staticbranch” đã tạo trước đó R1(conf-isa-prof)# match identity address 30.30.30.2 255.255.255.255 ->Router R2 static IP R1(conf-isa-prof)# exit R1(config)# crypto isakmp profile “dynamicL2L” : cho Branch với dynamic IP public R1(conf-isa-prof)# keyring “dynamicbranch” : cấu hình trước đó R1(conf-isa-prof)# match identity address 0.0.0.0 : Bất kỳ 1 Remote Branch nào đều truy cập được. R1(config)# crypto isakmp profile “remoteclients” :cho Remote User R1(conf-isa-prof)# keyring vpnclientskey R1(conf-isa-prof)# match identity group remotevpn R1(conf-isa-prof)# client authentication list USERAUTHEN R1(conf-isa-prof)# isakmp authorization list NETAUTHORIZE R1(conf-isa-prof)# client configuration address respond : trả lời yêu cầu IP từ remote user
  • 16. + Bước 4 : Cấu hình IPSEC Phase 2: Cấu hình Transform Set and Crypto Map: R1(config)# crypto ipsec transform-set “TRSET” esp-3des esp-md5-hmac R1(cfg-crypto-trans)# exit Cấu hình dynamic crypto map & static crypto map: R1(config)# crypto dynamic-map DYNMAP 10 R1(config-crypto-map)# set transform-set “TRSET” R1(config-crypto-map)# set isakmp-profile “remoteclients” : Attach isakmp profile of VPN clients configured before R1(config-crypto-map)# exit R1(config)# crypto dynamic-map DYNMAP 20 R1(config-crypto-map)# set transform-set “TRSET” R1(config-crypto-map)# set isakmp-profile “dynamicL2L” : attach isakmp profileof dynamic IP branch configured before R1(config-crypto-map)# match address VPNsite2-ACL R1(config-crypto-map)# exit R1(config)# crypto map VPNMAP 10 ipsec-isakmp : This is the static tunnel crypto map R1(config-crypto-map)# set peer 30.30.30.2 R1(config-crypto-map)# set transform-set “TRSET” R1(config-crypto-map)# set isakmp-profile “staticL2L” : Attach isakmp profile of static IP branch configured before R1(config-crypto-map)# match address VPNsite1-ACL R1(config-crypto-map)# exit
  • 17. R1(config)# crypto map VPNMAP 20ipsec-isakmp dynamic DYNMAP : Attach the dynamic crypto map on a new entry of the static crypto map Attach the static crypto map VPNMAP to the WAN outside finterface(fa0/1) of the Hub router: R1(config)# int fa0/1 R1(config-if)# crypto map VPNMAP Những điểm cần nhớ: -Tạo 1 keyring cho mỗi loại VPN tunnel(static IP branch, dynamic IP branch, VPN clients). -Gán mỗi keyring cho 1 “isakmp profile” tương ứng -Tạo một dynamic crypto map với 2 entries. Trên 1 entry gán “isakmp profile” cho dynamic Lan-to-Lan tunnel và trên entry khác gán “isakmp profile” cho remote clients tunnel. -Tạo 1 static crypto map với 2 entries. Trên 1 entry gán cho “isakmp profile” của static Lan- to-Lan tunnel, và trên entry tiếp theo gán dynamic crypto map. 2. Route Base VPN Configuration On Cisco Router 2.1 Site-to-Site VPN Using GRE with IPSEC Protection -Bước 1: Cấu hình GRE Tunnel: Router R1: R1(config)# int Tunnel 0 R1(config-if)# ip address 10.0.0.1 255.255.255.0
  • 18. R1(config-if)# tunnel source 20.20.20.2 R1(config-if)# tunnel destination 30.30.30.2 R1(config-if)# exit Router R2: R2(config)# int Tunnel 0 R2(config-if)# ip address 10.0.0.2 255.255.255.0 R2(config-if)# tunnel source 30.30.30.2 R2(config-if)# tunnel destination 20.20.20.2 R2(config-if)# exit -Bước 2: Cấu hình định tuyến giữa 2 đầu VPN Tunnel Có thể sử dụng dynamic routing(khi đó ta network dải mạng của tunnel) hoặc static routing -Bước 3: Cấu hình IPSEC Phase 1: Router R1: R1(config)# crypto isakmp policy 10 R1(config-isakmp)# encryption 3des R1(config-isakmp)# hash md5 R1(config-isakmp)# authentication pre-share R1(config-isakmp)# group 2 R1(config-isakmp)# exit R1(config)# crypto isakmp key “testkey123” address 30.30.30.2 Router R2: R2(config)# crypto isakmp policy 10 R2(config-isakmp# encryption 3des R2(config-isakmp)# hash md5 R2(config-isakmp)# authenication pre-share R2(config-isakmp)# group 2
  • 19. R2(config-isakmp)# exit R2(config)# crypto isakmp key “testkey123” address 20.20.20.2 -Bước 4: Cấu hình IPSEC Phase 2 (IPSEC Profile): Router R1: R1(config)# crypto ipsec transform-set “TRSET” esp-3des esp-md5-hmac : Transform-set này định nghĩa giao thức mã hóa và xác thực của IPSEC. R1(cfg-crypto-trans)# exit R1(config)# crypto ipsec profile “GRE-PROTECTION” : Đây là ipsec profile sẽ sử dụng để bảo vệ GRE Tunnel. R1(ipsec-profile)# set transform-set “TRSET” : Gán transform-set đã cấu hình ở trên R1(ipsec-profile)# exit Router R2: R2(config)# crypto ipsec transform-set “TRSET” esp-3des esp-md5-hmac : Transform-set này định nghĩa giao thức mã hóa và xác thực của IPSEC. R2(cfg-crypto-trans)# exit R2(config)# crypto ipsec profile “GRE-PROTECTION” : Đây là ipsec profile sẽ sử dụng để bảo vệ GRE Tunnel. R2(ipsec-profile)# set transform-set “TRSET” : Gán transform-set đã cấu hình ở trên R2(ipsec-profile)# exit -Bước 5: Attach IPSEC Protectionprofile to GRE Tunnel Router R1: R1(config)# int Tunnel 0
  • 20. R1(config-if)# tunnel protection ipsec profile GRE-PROTECTION : Gắn IPSEC Profile cấu hình trước đó để bảo vệ cho GRE tunnel. Router R2: R2(config)# int Tunnel 0 R2(config-if)# tunnel protection ipsec profile GRE-PROTECTION 2.2 Hub-and-Spoke VPN Using with GRE IPSEC Protection Cấu hình tương tự như Site-to-Site GRE with IPSEC Protection. Router HUB cấu hình mỗi tunnel riêng tương ứng với 1 Spoke, điều này không hợp lý trong một mạng lớn. GRE VPN yêu cầu tất cả các site đều phải có static IP Public.
  • 21. -Bước 1: Cấu hình GRE Tunnels: Router R1: R1(config)# interface Tunnel0 : GRE Tunnel for Site-to-Site VPN with R2 R1(config-if)# ip address 10.0.0.1 255.255.255.0 : Đặt IP cho tunnel R1(config-if)# tunnel source 20.20.20.2 : IP public of port WAN R1(config-if)# tunnel destination 30.30.30.2 : IP public of R2 R1(config-if)# exit R1(config)# interface Tunnel1 : GRE tunnel for site-to-site VPN with R3 R1(config-if)# ip address 10.1.1.1 255.255.255.0 R1(config-if)# tunnel source 20.20.20.2 R1(config-if)# tunnel destination 40.40.40.2 R1(config-if)# exit -Bước 2: Cấu hình định tuyến giữa các tunnel và IP LAN -Bước 3: Cấu hình IPSEC Phase 1: Router Hub :R1 R1(config)# cypto isakmp policy 10 R1(config-isakmp)# encryption 3des R1(config-isakmp)# hash md5 R1(config-isakmp)# authentication pre-share R1(config-isakmp)# group 2 R1(config-isakmp)# exit Tạo 2 pre-share key cho mỗi Spoke Branch Router: R1(config)# crypto isakmp key “testkey123” address 30.30.30.2 R1(config)# crypto isakmp key “testkey1234” address 40.40.40.2
  • 22. -Bước 4: Cấu hình IPSEC Phase 2 (ipsec profile): Router R1: R1(config)# crypto transform-set “TRSET” esp-3des esp-md5-hmac R1(cfg-crypto-trans)#exit R1(config)# crypto ipsec profile “GRE-PROTECTION” R1(config)# set transform-set “TRSET” R1(config-profile)# exit -Bước 5: Gán IPSEC Protectionprofile to GRE Tunnels Router R1: R1(config)#interface Tunnel0 R1(config-if)# tunnel protection ipsec profile “GRE-PROTECTION” R1(config)# interface Tunnel1 R1(config-if)# tunnel protection ipsec profile “GRE-PROTECTION” Note: R2 và R3 cấu hình tương tự như trong trường hợp Site-to-Site GRE with IPSEC Protection.
  • 23. 2.3 Dynamic Multipoint VPN (DMVPN) Config trên các Spoke tương tự nhau, dưới đây ta chỉ cấu hình Spoke R3. -Bước 1 : Cấu hình Multipoint GRE Tunnel: +Router R1 (HUB): R1(config)# interface fa0/1 : Public WAN interface on Hub router R1(config-if)# ip address 20.20.20.2 255.255.255.0 : Đặt ip public cho port WAN R1(config-if)# exit R1(config)# int Tunnel : mGRE interface R1(config-if)# ip add 10.0.0.1 255.255.255.0 : IP address of Tunnel R1(config-if)# tunnel source fa0/1 : Source of Tunnel is the WAN interface R1(config-if)# tunnel mode gre multipoint : Set tunnel mode as mGRE
  • 24. R1(config-if)#ip mtu 1440: Reduce the MTU to allow extra overhead from mGRE and IPSEC +Router Spoke : 2 Spoke config tương tự nhau R3(config)# int fa0/1 : public WAN interface on Spoke Router. R3(config-if)# ip address dhcp : R3 sử dụng dynamic ip public R3(config-if)# exit R3(config)# int Tunnel0 : This is the mGRE interface R3(config-if)# ip address 10.0.0.3 255.255.255.0 : IP of Tunnel cùng subnet với ip tunnel of HUB R3(config-if)#tunnel source fa0/1 : source của tunnel là cổng WAN R3(config-if)# tunnel mode gre multipoint : Set the tunnel mode as mGRE R3(config-if)#ip mtu 1440: Reduce the MTU to allow extra overhead from mGRE and IPSEC -Bước 2 : Cấu hình Next Hop Resolution Protocol (NHRP) : Router R1 (HUB): Note : Địa chỉ của NHRP Server (NHS) luôn luôn là địa chỉa của Tunnel Interface of Hub. R1(config)# int Tunnel0 R1(config-if)# ip nhrp authentication “NHRPkey” : Key để xác thực clients. R1(config-if)# ip nhrp map multicast dynamic : Enable forwarding of multicast traffic across the tunnel. R1(config-if)# ip nhrp network-id “100” : Indentifies the DMVPN cloud. Tất cả router phải có network-id giống nhau. R1(config-if)# tunnel key “100” : Có thể có hoặc ko. Chỉ từ IOS 12.3 trở lên mới có option này
  • 25. SPOKE (ROUTER R3) : R3(config)# interface Tunnel0 : Get back into the Tunnel Interface R3(config-if)# ip nhrp authentication “NHRPkey” : Secret key for authenticating with Hub R3(config-if)# ip nhrp map multicast dynamic : Enables forwarding of multicast traffic across the tunnel. R3(config-if)# ip nhrp network-id 100 : Identifies the DMVPN cloud. All routers must have the same network ID. R3(config-if)# tunnel key 100 : OPTIONAL. Needed only on older IOS versions such as 12.3 R3(config-if)# ip nhrp map 10.0.0.1 20.20.20.2 : Map the NHS address (10.0.0.1 on Hub) with the Hub’s WAN public IP (20.20.20.2) R3(config-if)# ip nhrp map multicast 20.20.20.2 : Send multicast traffic to the Hub only. Hub will receive all multicast traffic (e.g routing protocol updates) and then send out updates to all the Spoke routers. R3(config-if)# ip nhrp nhs 10.0.0.1 : Specify the NHS IP (this is always the private IP of the Tunnel Interface on Hub router) R3(config-if)# exit -Bước 3: Cấu hình giao thức định tuyến động (Dynamic Routing): Nhớ quảng bá dải IP của tunnel Nếu sử dụng EIGRP thì phải disable split-horizon như sau: HUB : R1(config)# router eigrp 90 Create an EIGRP instance with Autonomous System 90 R1(config-router)# no auto-summary Disable automatic summarization of subnets R1(config-router)# network 10.0.0.0 0.0.0.255 DMVPN Tunnel Interface Subnet R1(config-router)# network 192.168.1.0 0.0.0.255 Hub LAN subnet R1(config-router)# exit R1(config)# interface Tunnel0 Get back into the Tunnel Interface
  • 26. R1(config-if)# no ip split-horizon eigrp 90 Disable Split Horizon R1(config-if)# no ip next-hop-self eigrp 90 Disable next hop self R1(config-if)# no ip redirects  Useful to have R1(config-if)# exit Spoke (Router R3): R3(config)# router eigrp 90Create an EIGRP instance with Autonomous System 90 R3(config-router)# no auto-summaryDisable automatic summarization of subnets R3(config-router)# network 10.0.0.0 0.0.0.255DMVPN Tunnel Interface Subnet R3(config-router)# network 192.168.3.0 0.0.0.255LAN subnet R3(config-router)# exit R3(config)# interface Tunnel0Get back into the Tunnel Interface R3(config-if)# no ip split-horizon eigrp 90Disable Split Horizon R3(config-if)# no ip next-hop-self eigrp 90Disable next hop self R3(config-if)# no ip redirects Useful to have R1(config-if)# exit Bước 4: Cấu hình IPSEC PROTECTION: Router-1 (HUB): R1(config)# crypto isakmp policy 10 R1(config-isakmp)# encryption 3des R1(config-isakmp)# hash md5 R1(config-isakmp)# authentication pre-share R1(config-isakmp)# group 2 R1(config-isakmp)# exit R1(config)# crypto isakmp key strongsecretkey address 0.0.0.0 0.0.0.0 R1(config)# crypto ipsec transform-set TRSET esp-3des esp-sha-hmac
  • 27. R1(cfg-crypto-trans)# exit R1(config)# crypto ipsec profile PROTECT-DMVPN R1(ipsec-profile)# set transform-set TRSET R1(ipsec-profile)# exit R1(config)# interface Tunnel0 R1(config-if)# tunnel protection ipsec profile PROTECT-DMVPN Router-3 (SPOKE): R3(config)# crypto isakmp policy 10 R3(config-isakmp)# encryption 3des R3(config-isakmp)# hash md5 R3(config-isakmp)# authentication pre-share R3(config-isakmp)# group 2 R3(config-isakmp)# exit R3(config)# crypto isakmp ke allow also connections from any IP in order to form IPSEC VPN tunnels with other Spokes. R3(config)# crypto ipsec transform-set TRSET esp-3des esp-sha-hmac R3(cfg-crypto-trans)# exit R3(config)# crypto ipsec profile PROTECT-DMVPN R3(ipsec-profile)# set transform-set TRSET R3(ipsec-profile)# exit R3(config)# interface Tunnel0 R3(config-if)# tunnel protection ipsec profile PROTECT-DMVPN