Port 500/UDP is used by IKE (Internet Key Exchange, ISAKMP) to negotiate and exchange keys for IPsec VPNs (IKEv2: RFC 7296), e.g. with strongSwan, FRITZ!Box or site-to-site tunnels. If a device is behind NAT, IKE switches to UDP 4500 (NAT traversal) and the payload travels encapsulated there instead of as plain ESP.
On a VPN gateway, 500/UDP and 4500/UDP must be reachable, plus ESP (IP protocol 50) – that is not a port but a protocol of its own. If possible, allow only the IPs of the peers; on systems without a VPN service, keep 500 closed.
Typical: phase 1 succeeds but the tunnel does not come up because ESP or UDP 4500 is filtered on the path, or the proposals (encryption, DH group) do not match.
Check
nmap -sU -p 500,4500 vpn.example.com