Preserve NAT mappings across reboot

1

My Linux router is able to reboot and reconnect all network interfaces pretty fast (~10 seconds, thanks to systemd and a SSD disk), and comes up with the same IP addresses. Unfortunately the reboot causes all TCP/UDP connections that passed across NAT to break, since the NAT mappings were sent to /dev/null.

How could one save the NAT mappings prior to reboot and restore them afterwards, allowing connections to stay alive? The short downtime of the router will probably be tolerated by most applications, as long as the router doesn't forget about the NAT mappings.

I am not looking for a ready-made solution (and there may not be any), and I understand that some programming may be needed. Assume that I have complete control over all aspects of network configuration on this router.

Ambroz Bizjak

Posted 2014-11-08T10:52:33.433

Reputation: 4 265

No answers