
Before analyzing the packets with Wireshark, we need to configure the routers like below.ĪLSO READ: 27 nmcli command examples (cheatsheet), compare nm-settings with if-cfg file In this article, we will use tunnel mode. Following figure shows packet format for ESP when tunnel mode is used. In tunnel mode, the entire IP packet is encrypted and authenticated. The traffic between gateways will be protected. Tunnel mode is most commonly used between IPsec gateways. Following figure shows packet format for ESP when transport mode is used.

Beside that IPSec transport mode can be used when another tunneling protocol (like GRE) is used to first encapsulate the IP data packet, then IPSec is used to protect the GRE tunnel packets. This mode is usually used between client and server architecture. IPsec Transport mode is used for end to end communication. The IPsec standards define two distinct modes of IPsec operation, transport mode and tunnel mode. We will use IPsec to protect the data between IPsec-Gw-1 and IPsec-Gw-2. The following topology shows that Site1 and Site2 exchange data. The difference between ESP and the Authentication Header (AH) protocol is that ESP provides encryption, while both protocols provide authentication, integrity checking, and replay protection.ĪLSO READ: Kerberos Authentication Packet Analysis with Wireshark Unlike AH, ESP protocol provides data confidentiality, and also optionally provides data origin authentication, data integrity checking, and replay protection.

However, AH does not provide data confidentiality, which means that all of our data is sent in the clear text. AH protocol provides data origin authentication, data integrity, and replay protection. ISAKMP provides a framework for authentication, key management and supports many key exchange protocols like Oakley, Diffie-Hellman, the enhanced Diffie-Hellman and the RSA-based key exchange. Protocols such as Internet Security Association and Key Management Protocol (ISAKMP), Encapsulating Security Payload (ESP) and Authentication Header (AH) are used to protect the data.

Internet Protocol Security (IPsec) is a set of protocols that enable us to authenticate and encrypt traffic between two parties.
