FWIW though I came across this thread while troubleshooting an R80.40 standalone gateway in Google Cloud (the clusters do not have this issue because their Main IP is the floating external IP address). Even after setting the other side to accept the CheckPoint's Main IP, I still could not get policy-based VPNs working when the CheckPoint side initiated traffic.
Running debug crypto ipsec on the other side (Cisco), it would show the CheckPoint sending the main IP in the Phase 2 Transform sets. The Cisco would then reject the SA request because it was expecting either public IPs or private IPs, not a mix of both.
In working with support it seems there is a fix for this in the latest R80.30 Jumbo Hotfix. Here's the steps:
- Verify the other side will accept the CheckPoint's Main IP as the IKEv2 remote ID. On a Cisco router for example, this is done with match identity remote address under crypto ikev2 profile
- Upgrade CheckPoint to latest R80.30 Jumbo Hotfix, which should be Take 273
- Under IPSec VPN -> Link Selection -> Always use this IP address -> Statically NATed IP, enter the public IP of the gateway (example: 192.0.2.21)
- Set Link Selection -> Source IP address settings to to either topology table (ip address of external interface) or IP address of chosen interface. I prefer the latter just in case the eth0 IP address changes.
- Under IPSec VPN -> VPN Advanced, Verify NAT Traversal is enabled, which is the default
- Verify the other side also has NAT-T support
An initial SA with the public IPs as /32s will then be created, even without traffic:
+-----------------------------------------+-----------------------+---------------------+
| Peer: 203.0.113.188 - cisco-router | MSA: ffffc9004aebb220 | i: 1 ref: 2 |
| Methods: ESP Tunnel PFS AES-128 SHA1 g..| | |
| My TS: 192.0.2.21 | | |
| Peer TS: 203.0.113.188 | | |
| MSPI: 800001 (i: 1, p: 0) | Out SPI: cf538552 | |
| Tunnel created: Apr 16 16:49:15 | | |
| Tunnel expiration: Apr 16 17:49:15 | | |
+-----------------------------------------+-----------------------+---------------------+
Then, when either sides sends interior traffic, additional SAs will be brought with the interior subnets:
+-----------------------------------------+-----------------------+---------------------+
| Peer: 203.0.113.188 - cisco-router | MSA: ffffc9004aebb6f8 | i: 0 ref: -- 60/60 |
| Methods: ESP Tunnel PFS AES-128 SHA1 g..| | i: 1 ref: 3 |
| My TS: 10.22.222.0/24 | | |
| Peer TS: 172.31.33.0/24 | | |
| MSPI: 800002 (i: 1, p: 0) | Out SPI: 0cf6c107 | |
| Tunnel created: Apr 16 16:51:53 | | |
| Tunnel expiration: Apr 16 17:51:53 | | |
+-----------------------------------------+-----------------------+---------------------+
I'll admit here I don't fully understand why this only works when NAT-T is enabled, and it smells more like a hack that a design fix. But thought I'd pass it on.