Ports / IKE (IPsec)

UDP port

Port 500: IKE (IPsec)

UDP port 500 is IKE: two IPsec gateways agree their keys on it. With a NAT between them they move to UDP port 4500, which then carries the encrypted traffic as well.

  • Without NAT the encrypted traffic is ESP, an IP protocol of its own with no ports; wrapping it in UDP port 4500 gives a NAT ports to map.

Check port 500 on Linux

Put the server's name or address in place of HOST.

ss -ulnp 'sport = :500'
On the server: is a program listening on UDP port 500, and which? How to read ss.
tcpdump -ni any udp port 500
On either end: the datagrams to and from UDP port 500. With UDP this is the sure test, since nothing is acknowledged. How to read tcpdump.
nmap -sU -p 500 HOST
From outside: a UDP scan of port 500. No answer reads open|filtered: UDP does not say which. How to read nmap.

What runs on it

IPsec
Encryption at the IP layer: IKE agrees keys between two gateways, ESP carries their traffic encrypted.
NAT traversal
Getting traffic through NAT: wrapping protocols in UDP, whose ports NAT can map, and punching holes between peers.
VPN
Packets wrapped, encrypted, in UDP to a VPN server, which unwraps them on the far side.

Use port 500 on real machines

Open IPsec tunnels: encrypt what your carrier can read

Sources

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab