The packet relay system encapsulates IP packets and performs network address translation (NAT) to hide IP address changes from the guest operating system and servers when VPN gateways fail over. It uses a simple IP-in-IP encapsulation and NAT to translate the source address of IP packets to allow connections to be maintained across gateway failures. The packet relay client runs as a module in the virtualization layer and the packet relay server runs as a user-level process on the server.