Does a site-to-site IPSEC vpn needs an always on connection/tunnel with keepalives or is it possible to only encrypts packets when needed (when it matches a route or something like that)?
Does a site-to-site IPSEC vpn needs an always on connection/tunnel with keepalives or is it possible to only encrypts packets when needed (when it matches a route or something like that)?
You can do opportunistic encryption (that is, only bringing up the tunnel when needed), with a couple of caveats:
It might not hurt to find an old Cisco BCRAN textbook and read up on the implications of Dial-On-Demand-Routing; this is essentially the same thing, only using crypto instead of PSTN/ISDN.
Out of curiosity, what is the driver for having the tunnel interface down and only establishing it when it is needed? Since the tunnle is essentially free (not tarriffed per minute like old PSTN/ISDN/PRI),having it nailed-up and a periodic heartbeet to keep it up is probably cheaper in terms of maintenance and support.