Octet

Which protocols and ports must a firewall allow for an IPsec VPN to come up?

Show the answer

Say this first

UDP 500 for IKE, and ESP (IP protocol 50) for the data. When NAT traversal is in use, both IKE and ESP move to UDP 4500, so allow that too. AH (IP protocol 51) only if someone really uses AH. If any device in the path does NAT, plan on UDP 500 and UDP 4500 only.

Go deeper

TrafficProtocol and portWhen
IKEv1 and IKEv2UDP 500always, to start
IKE and ESP with NAT-TUDP 4500NAT detected on the path, or NAT-T forced
ESPIP protocol 50no NAT on the path
AHIP protocol 51rare

On an IOS router with an outside ACL

Cisco IOS
ip access-list extended OUTSIDE-IN
 permit udp host 203.0.113.2 host 198.51.100.1 eq isakmp
 permit udp host 203.0.113.2 host 198.51.100.1 eq non500-isakmp
 permit esp host 203.0.113.2 host 198.51.100.1

isakmp is UDP 500 and non500-isakmp is UDP 4500.

GRE inside IPsec

When GRE is protected by IPsec, the firewall never sees protocol 47; it only sees ESP or UDP 4500.

Traps

  • Saying "ESP uses port 50". ESP has no ports; it is IP protocol 50.
How did you do?Book 8.5 Example Systems