Implementing GRE over IPsec (ISAKMP mode) on Huawei routers.
- August 25, 2024
- Posted by: James Majani
- Category: Networking

Generic Routing Encapsulation, or GRE, is a protocol for encapsulating data packets that use one routing protocol inside the packets of another protocol. GRE is one way to set up a direct point-to-point connection across a network, for the purpose of simplifying connections between separate networks. It works with a variety of network layer protocols.
IPSec is a suite of protocols and services that provide security for IP networks. It is a widely used Virtual Private Network (VPN) technology. IP packets lack effective security mechanisms and may be forged, stolen, or tampered with when being transmitted on a public network, such as the Internet. To solve this problem, the communicating parties establish an IPsec tunnel for encrypted transmission of IP packets. This ensures secure transmission of IP packets on an insecure network, such as the Internet.
Pros and Cons of Using GRE:
Pros: Highly flexible, can encapsulate a variety of protocols, simplifies the setup of VPNs.
Cons: Lacks built-in security features; susceptible to certain types of cyber attacks if not paired with a security protocol like IPsec.
The Advantages and Limitations of IPsec:
Advantages: Provides comprehensive security measures, supports advanced encryption standards, and is widely adopted in established security frameworks.
Limitations: Can be complex to configure and manage; may incur more overhead than GRE in terms of performance. Another limitation is that it is only IP based offering no flexibility in terms of protocols supported.
While GRE and IPsec can be used separately, combining them leverages the strengths of both technologies. This combination allows for the flexibility of GRE in terms of protocol support alongside the robust security features of IPsec. In this setup, GRE is used to create a tunnel and handle the encapsulation duties, while IPsec is focused on the encryption and integrity of the data passing through that tunnel.
Networking Description.
As shown in our topology, HQ router and Branch router, are gateways of the enterprise headquarters and branch. The service provider has allocated a public network IP address to each gateway and the gateways can communicate with each other.
The enterprise requires a highly secure and cost-effective mechanism to implement communication between the headquarters and branches through Internet. GRE over IPSec can be implemented between the headquarters and branches to meet this requirement.
In this environment, BGP and IS-IS is used in the backbone network, between Branch1 and ISP router (PE_1) BGP is used to exchange Public IPS of the gateways across the Internet. For underlay routing, eBGP is deployed between branch/ HQ and respective PEs . For overlay, HQ gateway and Branch gateway exchange LAN-side routes on the GRE tunnel using OSPF. IPSec is deployed on the GRE tunnel between Branch and HQ for secure transmission of data over the internet between the two sites.
Step 1: Basic configurations.
*******************************************AR222_BRANCH_GW
system-view
sysname AR222_BRANCH_GW
#
interface GigabitEthernet0/0/0
ip address 11.1.2.1 255.255.255.254
#
interface LoopBack0
ip address 192.168.2.1 255.255.255.0
#
interface LoopBack1
ip address 192.168.22.1 255.255.255.0
*******************************************AR222_PE_1
system-view
system-view
sysname AR222_PE_1
#
interface GigabitEthernet0/0/0
ip address 11.1.2.0 255.255.255.254
#
interface GigabitEthernet0/0/1
ip address 192.169.1.0 255.255.255.254
*******************************************AR222_P_1
system-view
sysname AR222_P_1
#
interface GigabitEthernet0/0/1
ip address 192.169.1.1 255.255.255.254
#
interface GigabitEthernet0/0/0
ip address 192.169.1.2 255.255.255.254
*******************************************AR222_PE_2
system-view
sysname AR222_PE_2
#
interface GigabitEthernet0/0/0
ip address 192.169.1.3 255.255.255.254
#
interface GigabitEthernet0/0/1
ip address 11.1.1.0 255.255.255.254
*******************************************AR222_HQ_GW
system-view
sysname AR222_HQ_GW
#
interface GigabitEthernet0/0/1
ip address 11.1.1.1 255.255.255.254
ipsec policy P1
#
interface LoopBack0
ip address 192.168.1.1 255.255.255.0
#
interface LoopBack1
ip address 192.168.11.1 255.255.255.0
Step 2: Configure routing protocols for route exchange on the underlay.
*******************************************AR222_BRANCH_GW
bgp 65100
peer 11.1.2.0 as-number 64511
#
ipv4-family unicast
undo synchronization
network 11.1.1.0 255.255.255.254
peer 11.1.2.0 enable
*******************************************AR222_PE_1
isis 1
is-level level-1-2
is-name AR222_PE_1
network-entity 49.0001.0000.0000.0001.00
#
interface GigabitEthernet 0/0/0
isis enable 1
#
interface GigabitEthernet 0/0/1
isis enable 1
#
bgp 64511
peer 11.1.2.1 as-number 65100
peer 11.1.1.0 as-number 64511
#
ipv4-family unicast
undo synchronization
import-route direct
peer 11.1.2.1 enable
peer 11.1.1.0 enable
*******************************************AR222_P_1
isis 1
is-level level-1-2
is-name AR222_P_1
network-entity 49.0001.0000.0000.0002.00
#
interface GigabitEthernet 0/0/0
isis enable 1
#
interface GigabitEthernet 0/0/1
isis enable 1
*******************************************AR222_PE_2
isis 1
is-level level-1-2
is-name AR222_PE_2
network-entity 49.0001.0000.0000.0001.00
#
interface GigabitEthernet 0/0/0
isis enable 1
#
interface GigabitEthernet 0/0/1
isis enable 1
#
bgp 64511
peer 11.1.1.1 as-number 65100
peer 11.1.2.0 as-number 64511
#
ipv4-family unicast
undo synchronization
import-route direct
peer 11.1.1.1 enable
peer 11.1.2.0 enable
#
*******************************************AR222_HQ_GW
bgp 65100
peer 11.1.1.0 as-number 64511
#
ipv4-family unicast
undo synchronization
peer 11.1.1.0 enable
network 11.1.1.0 255.255.255.254
Results confirmation.


It’s confirmed that the routing protocols states are as expected and the Branch GW is learning the public IP address of the HQ gateway and vice versa.
Step 3: Create overlay VPN instance and bind the overlay service to the VPN instance.
*******************************************AR222_BRANCH_GW
ip vpn-instance VRFB
ipv4-family
route-distinguisher 21:21
vpn-target 21:21 both
#
interface LoopBack0
ip binding vpn-instance VRFB
ip address 192.168.2.1 255.255.255.0
#
interface LoopBack1
ip binding vpn-instance VRFB
ip address 192.168.22.1 255.255.255.0
*******************************************AR222_HQ_GW
ip vpn-instance VRFA
ipv4-family
route-distinguisher 12:12
vpn-target 21:21 both
#
interface LoopBack0
ip binding vpn-instance VRFA
ip address 192.168.1.1 255.255.255.0
#
interface LoopBack1
ip binding vpn-instance VRFA
ip address 192.168.11.1 255.255.255.0
Step 4: Create GRE tunnels and add them to respective VRFs.
*******************************************AR222_BRANCH_GW
interface tunnel 0/0/0
ip binding vpn-instance VRFB
tunnel-protocol gre
ip address 172.16.2.2 26
source 11.1.2.1
destination 11.1.1.1
*******************************************AR222_HQ_GW
interface tunnel 0/0/0
ip binding vpn-instance VRFA
tunnel-protocol gre
ip address 172.16.2.1 26
source 11.1.1.1
destination 11.1.2.1
Results confirmation.

Step 5: Configure IPSec parameters and bind the IPSec profile to the GRE tunnel interface.
*******************************************AR222_BRANCH_GW
IPsec proposal PRP1
transform esp
esp authentication-algorithm sha2-256
esp encryption-algorithm aes-128
encapsulation-mode tunnel
#
Ike proposal 1
authentication-algorithm sha1
encryption-algorithm aes-cbc-128
dh group14
#
Ike peer peer1 v2
peer-id-type
pre-shared-key cipher Huawei@123
ike proposal 1
#
IPsec profile PRF1
ike-peer peer1
proposal PRP1
#
interface tunnel 0/0/0
IPsec profile PRF1
*******************************************AR222_HQ_GW
IPsec proposal PRP1
transform esp
esp authentication-algorithm sha2-256
esp encryption-algorithm aes-128
encapsulation-mode tunnel
#
Ike proposal 1
authentication-algorithm sha1
encryption-algorithm aes-cbc-128
dh group14
#
Ike peer peer1 v2
peer-id-type
pre-shared-key cipher Huawei@123
ike proposal 1
#
IPsec profile PRF1
ike-peer peer1
proposal PRP1
#
interface tunnel 0/0/0
IPsec profile PRF1
Step 6: Configure OSPF over the tunnels.
*******************************************AR222_BRANCH_GW
ospf 1 router-id 2.2.2.2 vpn-instance VRFB
area 0.0.0.0
network 172.16.2.0 0.0.0.63
network 192.168.2.0 0.0.0.255
network 192.168.22.0 0.0.0.255
*******************************************AR222_HQ_GW
ospf 1 router-id 1.1.1.1 vpn-instance VRFA
area 0.0.0.0
network 172.16.2.0 0.0.0.63
network 192.168.1.0 0.0.0.255
network 192.168.11.0 0.0.0.255
Results confirmation.

A packet capture done on interface GigabitEthernet 0/0/0 of AR222_BRANCH_GW



The two sites have exchanged routes via a secure GRE over IPSec tunnel and LAN side routes of the two sites are reachable over the tunnel.
viagra mail order pharmacy: Pharm Express 24 – try our ed pack
best price for sildenafil 20 mg: VGR Sources – price of viagra 100mg tablet
where can i get viagra without a prescription VGR Sources viagra 100mg uk
viagra tablet price in india: can you buy viagra without a prescription – cheapest price for generic viagra
how to purchase viagra in india: sildenafil uk – viagra usa
where to buy viagra tablets: buy viagra from india – viagra 150
sildenafil pharmacy viagra cost mexico viagra australia pharmacy
https://vgrsources.com/# viagra samples
sildenafil 50mg best price: VGR Sources – viagra tablets in india online
can i buy viagra over the counter australia: buy 10 viagra pills – viagra 25 mg coupon
sildenafil rx coupon VGR Sources viagra online us
where can i get genuine viagra: generic viagra online purchase – can i buy viagra over the counter nz
viagra compare prices: VGR Sources – sildenafil prescription australia
sildenafil cream: generic viagra lowest price – Precio de Viagra 50 mg
https://vgrsources.com/# sildenafil 50 mg cost
buy viagra for female online india generic viagra 50mg online order no prescription viagra
soft tabs viagra: viagra for sale canada – where can i buy 1 viagra pill
how to get generic viagra online: VGR Sources – viagra prescription price
buy viagra express: VGR Sources – order generic viagra online canada
pharmacy viagra canada VGR Sources where can i get viagra without a prescription
purchase 200mg sildenafil: VGR Sources – female viagra drug canada
generic viagra sold in united states: VGR Sources – order generic viagra from india
https://vgrsources.com/# cheap viagra generic online
sildenafil fast shipping: viagra pfizer 100mg – sildenafil 20 mg tablet brand name
where to get viagra online VGR Sources viagra for men for sale
average cost of viagra 50mg: viagra tablets over the counter – sildenafil 100 mg uk
sildenafil price canada: VGR Sources – authentic viagra
viagra generic 50 mg: buy generic viagra online india – where can i get viagra without a prescription
sildenafil medication how can i get viagra prescription viagra generic online india
viagra capsule price in india: generic viagra 20 mg – cost of sildenafil 20 mg
viagra 800mg: how much is viagra 50 mg – sildenafil 25 mg coupon
generic viagra fast delivery: how to purchase viagra in india – buy viagra pills online india
https://vgrsources.com/# viagra tablets 50 mg online
sildenafil india paypal generic viagra from india online online sildenafil
viagra professional canada: harga viagra 50mg – sildenafil generic price
viagra canada online pharmacy: cheap generic viagra from india – cheapest price for viagra 100mg
viagra from india pharmacy: viagra 100mg online australia – where can i buy viagra online
cheap generic viagra india VGR Sources best viagra coupon
female viagra nz: how much is viagra online – cost of viagra 100mg in canada
buy cheap sildenafil: VGR Sources – best place buy viagra online
sildenafil 50mg india: generic sildenafil in canada – how to order generic viagra online
how to get female viagra pills VGR Sources can i buy viagra over the counter
https://vgrsources.com/# where can i buy female viagra uk
buy viagra 100 mg online: purchase viagra mexico – viagra cheap canadian pharmacy
sildenafil online australia: VGR Sources – mail order viagra
50 mg viagra for sale: VGR Sources – generic viagra online pharmacy india
viagra tablets online india VGR Sources cheap viagra for sale
sildenafil sale in india: VGR Sources – brand viagra price
online real viagra: VGR Sources – viagra soft 100mg
sildenafil online purchase: VGR Sources – generic viagra 10mg
purchase viagra in mexico VGR Sources sildenafil 100 capsules
price of viagra in us: VGR Sources – best viagra
best viagra coupon: how do i buy viagra – lowest price viagra
where to order viagra online VGR Sources price of sildenafil in canada
best place buy viagra online: VGR Sources – 400 mg sildenafil
buy female viagra online canada: VGR Sources – price for 100mg viagra
buy viagra online without rx: VGR Sources – discount online pharmacy viagra
sildenafil tablets 50mg price: female viagra where to buy – buy female viagra in india
sildenafil 50mg sildenafil 50 mg price in india canadian medicine viagra
sildenafil: VGR Sources – how to get viagra in usa
https://vgrsources.com/# buy generic sildenafil
Predni Pharm: PredniPharm – PredniPharm
Lipi Pharm: Lipi Pharm – Lipi Pharm
prednisone 5mg cost PredniPharm prednisone 1 mg daily
PredniPharm: buy prednisone canadian pharmacy – Predni Pharm
Predni Pharm: prednisone pak – Predni Pharm
https://semaglupharm.com/# SemagluPharm
prednisone otc uk Predni Pharm where can i get prednisone
PredniPharm: prednisone 50 mg tablet canada – PredniPharm
SemagluPharm: tirzepatide semaglutide equivalent dose – SemagluPharm
Cheap Lipitor 10mg / 20mg / 40mg atorvastatin erectile dysfunction п»їBuy Lipitor without prescription USA
Over-the-counter Crestor USA: Crestor Pharm – Order rosuvastatin online legally
PredniPharm: where can i buy prednisone – PredniPharm
CrestorPharm: rosuvastatin rhabdomyolysis – CrestorPharm
https://crestorpharm.com/# advantages of rosuvastatin over atorvastatin
LipiPharm FDA-approved generic statins online USA-based pharmacy Lipitor delivery
thuoc atorvastatin 20 mg: LipiPharm – does lipitor cause cancer
Crestor home delivery USA: how long after drinking coffee can i take rosuvastatin – CrestorPharm
LipiPharm LipiPharm Lipi Pharm
Semaglu Pharm: Semaglu Pharm – Semaglu Pharm
crestor every other day Safe online pharmacy for Crestor crestor 20mg price
prednisone 40 mg rx: PredniPharm – PredniPharm
LipiPharm: Lipi Pharm – Lipi Pharm
prednisone buy without prescription Predni Pharm PredniPharm
Crestor Pharm: Crestor Pharm – Online statin therapy without RX
https://semaglupharm.com/# FDA-approved Rybelsus alternative
Crestor 10mg / 20mg / 40mg online: CrestorPharm – CrestorPharm
LipiPharm FDA-approved generic statins online LipiPharm
Crestor Pharm: CrestorPharm – Rosuvastatin tablets without doctor approval
symptoms of semaglutide: SemagluPharm – semaglutide headache
what happens if i take too much atorvastatin: FDA-approved generic statins online – LipiPharm
Crestor Pharm Online statin therapy without RX Safe online pharmacy for Crestor
purchase prednisone from india: PredniPharm – cheap prednisone online
cheap prednisone 20 mg: Predni Pharm – Predni Pharm
https://semaglupharm.com/# Semaglu Pharm
buy prednisone mexico: prednisone online australia – no prescription online prednisone
Affordable Rybelsus price how much does rybelsus cost Semaglutide tablets without prescription
Lipi Pharm: LipiPharm – can lipitor cause erectile dysfunction
prednisone 10 mg tablet Predni Pharm prednisone 2.5 mg tab
Semaglu Pharm: Semaglu Pharm – Semaglu Pharm
rybelsus alternatives: SemagluPharm – semaglutide drug class
http://lipipharm.com/# Generic Lipitor fast delivery
PredniPharm PredniPharm Predni Pharm
Safe online pharmacy for Crestor: CrestorPharm – crestor ed
PredniPharm PredniPharm PredniPharm
LipiPharm: Atorvastatin online pharmacy – does lipitor cause leg cramps
Where to buy Semaglutide legally rybelsus drug п»їBuy Rybelsus online USA
https://semaglupharm.com/# best foods to eat on semaglutide
Predni Pharm: prednisone 50 mg for sale – 10mg prednisone daily
https://lipipharm.com/# Lipi Pharm
Lipi Pharm: atorvastatin side effects weight gain – Lipi Pharm
http://semaglupharm.com/# Semaglu Pharm
FDA-approved Rybelsus alternative oral vs injectable semaglutide Where to buy Semaglutide legally
Online statin therapy without RX: CrestorPharm – Crestor Pharm
Crestor Pharm: when should i take rosuvastatin 5 mg – CrestorPharm
https://semaglupharm.com/# SemagluPharm
prednisone cost in india where can i buy prednisone online without a prescription Predni Pharm
Crestor Pharm: Crestor Pharm – pros and cons of crestor
https://crestorpharm.shop/# No doctor visit required statins
does rybelsus cause diarrhea: SemagluPharm – semaglutide mounjaro
https://semaglupharm.com/# Buy Rybelsus online USA
is zepbound a semaglutide: Semaglu Pharm – Semaglu Pharm
atorvastatin dosage 40 mg: LipiPharm – Lipi Pharm
https://semaglupharm.com/# rybelsus singapore
iv prednisone medicine prednisone 10mg Predni Pharm
Online statin therapy without RX: Crestor mail order USA – what’s the difference between crestor and lipitor
Rybelsus side effects and dosage: rybelsus insulin – SemagluPharm
http://semaglupharm.com/# SemagluPharm
https://prednipharm.com/# Predni Pharm
LipiPharm LipiPharm Online statin drugs no doctor visit
Semaglu Pharm: novo nordisk semaglutide – how many units is 0.25 mg of semaglutide
http://semaglupharm.com/# can i drink coffee 30 minutes after taking rybelsus
Lipi Pharm: Safe atorvastatin purchase without RX – can atorvastatin cause dizziness
LipiPharm does lipitor lower triglycerides FDA-approved generic statins online
buying prednisone without prescription: buy prednisone online no script – Predni Pharm
https://semaglupharm.shop/# Semaglu Pharm
Semaglu Pharm: Online pharmacy Rybelsus – Order Rybelsus discreetly