09-03-2024 08:36 AM - edited 09-03-2024 10:39 AM
IPSec over GRE
Generic Routing Encapsulation (GRE) protocol
Internet Protocol Security (IPSec)
GRE Tunnel Configuration
IPSec Configuation
Generic Routing Encapsulation
Internet Protocol Security (IPSec)
To know more details about IPSec and it's Phases (Phases 1 and Phase 2 ), please go through the following link:
https://community.cisco.com/t5/security-knowledge-base/implemention-of-ipsec-vpns/ta-p/5129081
Configuration Example
R1(config)# ip route 192.168.23.0 255.255.255.0 fa0/0
R3(config)# ip route 192.168.12.0 255.255.255.0 fa0/0
R1# ping 192.168.23.3
! ! ! ! !
R1(config)# Interface Tunnel 0
R1(config-if)# ip address 172.16.0.1 255.255.255.0
R1(config-if)#Tunnel Source fa0/0
R1(config-if)#Tunnel destination 192.168.23.3
R1(config-if)#Tunnel mode gre ip
R1(config-if)#exit
%LINEPROTO-5-UPDOWN: Line protocol on Interface Tunnel0, changed state to up
R3(config)# Interface Tunnel 0
R3(config-if)# ip address 172.16.0.2 255.255.255.0
R3(config-if)#Tunnel Source fa0/0
R3(config-if)#Tunnel destination 192.168.12.1
R3(config-if)#Tunnel mode gre ip
R3(config-if)# exit
%LINEPROTO-5-UPDOWN: Line protocol on Interface Tunnel0, changed state to up
R1# ping 172.16.0.2
! ! ! ! !
Now, GRE tunnel is established between R1 and R3…!
As mentioned earlier, GRE is an encapsulation protocol and does not perform any encryption. Creating a point-to-point GRE tunnel without any encryption is extremely risky..!! That’s why we are going to implement IPsec to encrypt the traffic that is passing through our GRE Tunnel.
Configuring IPSec Encryption For GRE Tunnel (GRE over IPSec)
IPSec encryption involves two steps for each router. These steps are:
(1) Configure ISAKMP (ISAKMP Phase 1)
R1(config)#crypto isakmp policy 1
R1(config-isakmp)#hash sha512
R1(config-isakmp)#authentication pre-share
R1(config-isakmp)#group 14
R1(config-isakmp)#lifetime 3600
R1(config-isakmp)#encryption aes 256
R1(config-isakmp)#exit
R1(config)#crypto isakmp key 6 xxxxxxxx address 192.168.23.3
Same way configure R3 Router…
R3(config)#crypto isakmp policy 1
R3(config-isakmp)#hash sha512
R3(config-isakmp)#authentication pre-share
R3(config-isakmp)#group 14
R3(config-isakmp)#lifetime 3600
R3(config-isakmp)#encryption aes 256
R3(config-isakmp)#exit
R3(config)#crypto isakmp key 6 xxxxxxxx address 192.168.12.1
(2) Configure IPSec (ISAKMP Phase 2)
R1(config)#Crypto ipsec transform-set TS1 esp-aes 256 esp-sha512-hmac
R1(cfg-crypto-trans)#mode tunnel
R1(cfg-crypto-trans)#exit
R1(config)# crypto ipsec profile profile-1
R1(ipsec-profile)# set transform-set TS1
R1(ipsec-profile)# exit
R1(config)# interface Tunnel 0
R1(config-if)# tunnel protection ipsec profile profile-1
R1(config-if)#exit
Same way in R3 complete phase-2 configuration...
R3(config)#Crypto ipsec transform-set TS3 esp-aes 256 esp-sha512-hmac
R3(cfg-crypto-trans)#mode tunnel
R3(cfg-crypto-trans)#exit
R3(config)# crypto ipsec profile profile-1
R3(ipsec-profile)# set transform-set TS3
R3(ipsec-profile)# exit
R3(config-if)# tunnel protection ipsec profile profile-1
R3(config-if)#exit
R1# ping 172.16.0.2
! ! ! ! !
Our tunnel is successfully established and secured using IPsec. Now, to see the communication between loopbacks, configure any routing protocol.. In my case I am going to configure eigrp-100
R1(config)# router eigrp 100
R1(config-router)# network 1.1.1.1 0.0.0.0
R1(config-router)# network 172.16.0.0 0.0.0.255
R1(config-router)# no auto-summary
R1(config-router)#exit
R3(config)# router eigrp 100
R3(config-router)# network 3.3.3.3 0.0.0.0
R3(config-router)# network 172.16.0.0 0.0.0.255
R3(config-router)# no auto-summary
R3(config-router)#exit
Thank you very much..!!
--------------------------------------------------------- THE END ------------------------------------------
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: