IPsec Tunnel vs Transport Mode-Comparison and Configuration (2024)

You are here: Home / Cisco VPN / Cisco IPsec Tunnel vs Transport Mode with Example Config

Written By Harris Andrea

IP Security (IPsec) is a framework of open standards developed by the Internet Engineering Task Force (IETF). IPsec provides security for transmission of sensitive information over unprotected networks such as the Internet.

IPsec acts at the network layer, protecting and authenticating IP packets between participating IPsec devices also known as IPsec peers. IPsec has two modes of operation:

IPSec Tunnel mode:

The entire original IP packet is protected (encrypted, authenticated, or both) in tunnel mode. The packet is then encapsulated by the IPsec headers and trailers. Finally a new IP header is prefixed to the packet, specifying the IPsec endpoints as the source and destination.

Tunnel mode is the more common IPsec mode that can be used with any IP traffic. If IPsec is required to protect traffic from hosts behind the IPsec peers, tunnel mode must be used.

Virtual private networks (VPNs) make use of tunnel mode where hosts on one protected network send packets to hosts on a different protected network via a pair of IPsec peers such as Cisco routers.

In this scenario, the IPsec peers tunnel the protected traffic between the peers while the hosts on the protected networks are the actual session endpoints. Tunnel Mode is configured under a “Transform Set” as we will see below.

IPSec Transport mode:

Only the payload or data of the original IP packet is protected (encrypted, authenticated, or both) in transport mode. The protected payload is then encapsulated by the IPsec headers and trailers while the original IP header remains intact and is not protected by IPsec.

Transport mode is used only when the IP traffic to be protected has IPsec peers as both the source and destination. For example, you could use the transport mode to protect router management traffic. Transport Mode is configured under a “Transform Set” as we will see below.

Configuration of Tunnel Vs Transport Modes

IPsec Tunnel vs Transport Mode-Comparison and Configuration (1)

Figure 1 Configuring IPsec Tunnel vs Transport

Please refer to the topology where two Cisco routers R1 and R2 are configured to send protected traffic across an IPsec tunnel.

The two routers are connected over a Frame Relay connection the configuration of which is not included in this tutorial (the WAN connection does not matter. it can be anything as long as there is IP connectivity between the two devices).

MORE READING: Site-to-Site IPSEC VPN Between Two Cisco ASA - one with Dynamic IP

Each router also has a FastEthernet interface where end systems reside. The traffic sent and received by those end systems will be encrypted when flowing across the IPsec tunnel. This essentially is IPsec in tunnel mode as we defined earlier in the tutorial.

We start our IPsec configuration with Internet Security Association and Key Management Protocol (ISAKMP), which is a framework for authentication and key exchange.

Cisco uses a derivative of ISAKMP known as Internet Key Exchange (IKE). IKE is used to establish a shared security policy and authenticated keys for IPsec to use.

Let’s create policy 1 first, specifying that we’ll use MD5 to hash the IKE exchange, DES to encrypt IKE, and pre-shared key for authentication.

R1>enable
R1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#crypto isakmp policy 1
R1(config-isakmp)#hash md5
R1(config-isakmp)#authentication pre-share
R1(config-isakmp)#crypto isakmp key MyKey address 172.16.12.2

Next, we create an IPsec “Transform Set” that we call MySet. We specify Authentication Header (AH) as the authentication protocol and Encapsulating Security Payload (ESP) as the encryption protocol for IPsec. We can also use the mode command in crypto transform configuration mode to set the mode for the VPN to be either tunnel (default) or transport (“transport” setting is used only when the traffic to be protected has the same IP addresses as the IPsec peers).

R1(config)#crypto ipsec transform-set MySet ah-sha-hmac esp-aes 256
R1(cfg-crypto-trans)#mode tunnel
R1(cfg-crypto-trans)

In our example above, we configure the VPN to work in “tunnel” mode. If we wanted to have “transport mode”, the command would be:

R1(cfg-crypto-trans)#mode transport

We now proceed to create a crypto map called MyMap with sequence number 1. A crypto map can have multiple entries with different sequence numbers but we’ll use just one entry. The ipsec-isakmp argument instructs the router that this map is an IPsec map. We also tell the router about its peer 172.16.12.2 once again and also set the security-association lifetime. We also refer to the access list 101 which will be used to match interesting traffic that has to be protected by IPsec.

R1(cfg-crypto-trans)#crypto map MyMap 1 ipsec-isakmp
R1(config-crypto-map)#set peer 172.16.12.2
R1(config-crypto-map)#set security-association lifetime seconds 190
R1(config-crypto-map)#set transform-set MySet
R1(config-crypto-map)#match address 101

Now we apply our crypto map to the interface that will be sending the encrypted traffic. The interface is a Frame Relay sub-interface that connects to our IPsec peer at the other end. Our address is 172.16.12.1 while our peer is 172.16.12.2.

MORE READING: Cisco VPN Client Setup and Configuration

R1(config-crypto-map)#interface Serial0/0.12 point-to-point
R1(config-if)#crypto map MyMap
R1(config-if)#exit
R1(config)#

And finally we define access list 101 that specifies which traffic will be protected by IPsec.

R1(config)#access-list 101 permit ip 172.16.0.0 0.0.255.255 172.16.0.0 0.0.255.255

This concludes our IPsec configuration on R1. Let’s now move to R2 and apply IPsec configuration to it just the way we applied to R1.

R2>enable
R2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#crypto isakmp policy 1
R2(config-isakmp)#hash md5
R2(config-isakmp)#authentication pre-share

R2(config-isakmp)#crypto isakmp key MyKey address 172.16.12.1

R2(config)#crypto ipsec transform-set MySet ah-sha-hmac esp-aes 256
R2(cfg-crypto-trans)#mode tunnel

R2(cfg-crypto-trans)#crypto map MyMap 1 ipsec-isakmp
R2(config-crypto-map)#set peer 172.16.12.1
R2(config-crypto-map)#set security-association lifetime seconds 190
R2(config-crypto-map)#set transform-set MySet
R2(config-crypto-map)#match address 101

R2(config-crypto-map)#interface Serial0/0.21 point-to-point
R2(config-fr-dlci)#crypto map MyMap

R2(config-subif)#router ospf 100
R2(config-router)#network 172.16.0.0 0.0.255.255 area 0

R2(config-router)#access-list 101 permit ip 172.16.0.0 0.0.255.255 172.16.0.0 0.0.255.255

This finalizes our basic IPsec configuration in tunnel mode for both R1 and R2.

Let’s now verify if the configuration works as expected. A variety of Cisco IOS show commands are available to confirm that security associations (SAs) are live and interesting traffic is indeed being encrypted.

The show crypto session command verifies that the IKE session is active and R1 is indeed talking to its peer 172.16.12.2 via UDP port 500, the port for IKE.

R1#show crypto session
Crypto session current status
Interface: Serial0/0.12
Session status: UP-ACTIVE
Peer: 172.16.12.2 port 500
IKE SA: local 172.16.12.1/500 remote 172.16.12.2/500 Active
IPSEC FLOW: permit ip 172.16.0.0/255.255.0.0 172.16.0.0/255.255.0.0
Active SAs: 4, origin: crypto map

The show crypto map command verifies our IPsec status.

R1#show crypto map
Crypto Map “MyMap” 1 ipsec-isakmp
Peer = 172.16.12.2
Extended IP access list 101
access-list 101 permit ip 172.16.0.0 0.0.255.255 172.16.0.0 0.0.255.255
Current peer: 172.16.12.2
Security association lifetime: 4608000 kilobytes/190 seconds
PFS (Y/N): N
Transform sets={
MySet,
}

Interfaces using crypto map MyMap:
Serial0/0.12

The show crypto ipsec transform-set command verifies our IPsec status and shows that we are indeed using tunnel mode as opposed to transport mode.

R1#show crypto ipsec transform-set
Transform set MySet: { ah-sha-hmac }
will negotiate = { Tunnel, },
{ esp-256-aes }
will negotiate = { Tunnel, },

The same show commands can be used on R2 to obtain similar results.

Related Posts

  • VPN Failover with HSRP High Availability (Crypto Map Redundancy)
  • Cisco DMVPN Configuration Example
  • Site to Site IPSEC VPN Between Cisco Router and Juniper Security Gateway
  • Site-to-Site IPSEC VPN Between Cisco ASA and pfSense
  • Site-to-Site IPSEC VPN Between Two Cisco ASA – one with Dynamic IP
IPsec Tunnel vs Transport Mode-Comparison and Configuration (2024)

FAQs

IPsec Tunnel vs Transport Mode-Comparison and Configuration? ›

The main advantage of IPsec tunnel mode is that it creates a secure connection between two endpoints by encapsulating packets in an additional IP header. Tunnel mode also provides better security over transport mode because the entire original packet is encrypted.

How does IPSec in transport mode compare to IPSec in tunnel mode? ›

Tunnel Mode provides end-to-end security by encrypting the entire IP packet, while Transport Mode only encrypts the payload of the packet. Another difference is the use case: Tunnel Mode is used for connecting entire networks, while Transport Mode is used for host-to-host communication.

What are the advantages of tunnel mode over transport mode? ›

In tunnel mode, the entire original IP packet is encapsulated to become the payload of a new IP packet. Additionally, a new IP header is added on top of the original IP packet. Since a new packet is created using the original information, tunnel mode is useful for protecting traffic between different networks.

Which mode of IPSec should you use? ›

1. Which mode of IPsec should you use to assure the security and confidentiality of data within the same LAN? Explanation: ESP transport mode should be used to ensure the integrity and confidentiality of data that is exchanged within the same LAN.

Which of the following is a significant difference between VPN tunnel and transport mode? ›

Transport mode is often between two devices that want to protect some insecure traffic (example: telnet traffic). Tunnel mode is typically used for site-to-site VPNs where we need to encapsulate the original IP packet since these are mostly private IP addresses and can't be routed on the Internet.

What is the difference between transport mode and tunnel mode in IPSec quizlet? ›

Transport mode provides protection, primarily, for upper-layer protocols where as tunnel mode provides security for the entire IP Packet being transmitted.

What is the difference between IPSec tunnel and transport in FortiGate? ›

The main difference between tunnel and transport mode is that a new IP header is used in tunnel mode while transport mode uses the original IP packet. Transport mode is used in either of the two following scenarios: - No tunneling is necessary.

Which is better mode of transport? ›

Things to Consider When Choosing a Mode of Transport

Sea transport is the most economical choice for massive cargo shipments between countries. Meanwhile, air transport is the better option for long-distance shipments of light cargo in time-sensitive situations.

Which configuration setting of an IPSec VPN provides more security for data exchange? ›

SHA-256 provides more cryptographic security than SHA-1 or Message Digest 5 (MD5). PFS DH group 14 provides increased security because the peers perform a second DH exchange to produce the key used for IPsec encryption and decryption.

What is ah and ESP in IPSec? ›

AH provides data integrity by using an authentication algorithm. It does not encrypt the packet. ESP typically protects the packet with an encryption algorithm and provides data integrity with an authentication algorithm. Some encryption algorithms provide both encryption and authentication, such as AES GCM.

Which VPN protocol is best for IPsec? ›

Protocols Comparison
VPN ProtocolSpeedStability
IPSec/IKEv2Very GoodExcellent
WireGuard*ExcellentVery Good
SSTPFairFair
L2TP/IPSecFairGood
2 more rows

What are the 3 main protocols that IPsec uses? ›

Some IPSec protocols are given below.
  • Authentication header (AH)
  • Encapsulating security payload (ESP)
  • Internet key exchange (IKE)

What is the best IPsec tunnel? ›

Best IPsec VPNs:
  • NordVPN: The best IPsec VPN. Supports IKEv2/IPsec. ...
  • Surfshark: Best value VPN. ...
  • IPVanish: Speedy, lightweight VPN that supports the IKEv2 protocol. ...
  • ExpressVPN: Provides L2TP/IPsec. ...
  • PrivateVPN: Option of IPsec with L2TP or IKEv2. ...
  • Hotspot Shield: Multiple protocols including IKEv2/IPsec.
Apr 17, 2024

Which is better transport mode or tunnel mode? ›

Tunnel mode also provides better security over transport mode because the entire original packet is encrypted.

What is the difference between an IPSec tunnel and a VPN tunnel? ›

While an IPsec VPN allows users to connect remotely to an entire network and all its applications, SSL VPNs give users remote tunneling access to a specific system or application on the network.

What is the best VPN tunnel type? ›

OpenVPN is an open-source enhancement of the SSL/TLS framework with additional cryptographic algorithms to make your encrypted tunnel even safer. It's the go-to tunneling protocol for its high security and efficiency.

What is the difference between AH and ESP? ›

The main difference between ESP and AH authentication is this: ESP doesn't protect any IP header fields in Transport mode. Both ESP and AH authenticate all IP header fields in Tunnel mode. The AH can be applied alone or together with the ESP when IPSec is in transport mode.

What are the 2 type of transfer modes used in IPSec? ›

The IPsec standards define two distinct modes of IPsec operation, transport mode and tunnel mode. The modes do not affect the encoding of packets. The packets are protected by AH, ESP, or both in each mode.

What is the difference between IPSec tunnel and VPN tunnel? ›

In summary , a VPN and an IPSec tunnel are both types of secure connections , but they serve different purposes . A VPN is for remote access , while an IPSec tunnel is for connecting networks . To learn more about these two technologies and their differences , check out the link in the bio .

What is the difference between crypto IPSec transform set mode tunnel and transport? ›

In a quick sentence, transport mode IPsec only encapsulates the inner content excluding the original IP header, while tunnel mode encapsulates the entire inner content, including the IP header. In each case, the content needs to traverse a network, therefore the outer IP header has to come from somewhere.

Top Articles
...
How to manage your Dropbox file and folder sharing permissions
5 Bijwerkingen van zwemmen in een zwembad met te veel chloor - Bereik uw gezondheidsdoelen met praktische hulpmiddelen voor eten en fitness, deskundige bronnen en een betrokken gemeenschap.
ds. J.C. van Trigt - Lukas 23:42-43 - Preekaantekeningen
Cvs Devoted Catalog
True Statement About A Crown Dependency Crossword
Florida (FL) Powerball - Winning Numbers & Results
Used Wood Cook Stoves For Sale Craigslist
Nonuclub
Zürich Stadion Letzigrund detailed interactive seating plan with seat & row numbers | Sitzplan Saalplan with Sitzplatz & Reihen Nummerierung
Nebraska Furniture Tables
Classic Lotto Payout Calculator
Stihl Km 131 R Parts Diagram
Viha Email Login
Grayling Purnell Net Worth
Epguides Strange New Worlds
Skip The Games Fairbanks Alaska
Craigslist Pearl Ms
Joan M. Wallace - Baker Swan Funeral Home
Yosemite Sam Hood Ornament
Play It Again Sports Norman Photos
Avatar: The Way Of Water Showtimes Near Maya Pittsburg Cinemas
Craigslist Hunting Land For Lease In Ga
800-695-2780
UCLA Study Abroad | International Education Office
Ticket To Paradise Showtimes Near Cinemark Mall Del Norte
Wonder Film Wiki
Is Henry Dicarlo Leaving Ktla
How do you get noble pursuit?
Askhistorians Book List
Ringcentral Background
Desales Field Hockey Schedule
Moonrise Time Tonight Near Me
Smayperu
new haven free stuff - craigslist
Craigslist Lakeside Az
Skip The Games Grand Rapids Mi
RECAP: Resilient Football rallies to claim rollercoaster 24-21 victory over Clarion - Shippensburg University Athletics
Who Is Responsible for Writing Obituaries After Death? | Pottstown Funeral Home & Crematory
Foxxequeen
Pulaski County Ky Mugshots Busted Newspaper
Pink Runtz Strain, The Ultimate Guide
How Big Is 776 000 Acres On A Map
Bekkenpijn: oorzaken en symptomen van pijn in het bekken
Noga Funeral Home Obituaries
El Patron Menu Bardstown Ky
Goosetown Communications Guilford Ct
Houston Primary Care Byron Ga
Kenmore Coldspot Model 106 Light Bulb Replacement
Noelleleyva Leaks
Vrca File Converter
Latest Posts
Article information

Author: Domingo Moore

Last Updated:

Views: 6668

Rating: 4.2 / 5 (53 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Domingo Moore

Birthday: 1997-05-20

Address: 6485 Kohler Route, Antonioton, VT 77375-0299

Phone: +3213869077934

Job: Sales Analyst

Hobby: Kayaking, Roller skating, Cabaret, Rugby, Homebrewing, Creative writing, amateur radio

Introduction: My name is Domingo Moore, I am a attractive, gorgeous, funny, jolly, spotless, nice, fantastic person who loves writing and wants to share my knowledge and understanding with you.