An IPv6 ESP tunnel connection between the gateways moon and sun is set up. It connects the two IPv6 subnets hiding behind their respective gateways. The authentication is based on X.509 certificates and the kernel-libipsec plugin is used for userland IPsec ESP encryption. In this scenario, UDP encapsulation isn't enforced by the plugin as sending of raw ESP packets is enabled.
Upon the successful establishment of the IPsec tunnel, an updown script automatically inserts iptables-based firewall rules that let pass the traffic tunneled via the ipsec0 tun interface. In order to test both tunnel and firewall, client alice behind gateway moon sends an IPv6 ICMP request to client bob behind sun using the ping6 command.