- Using Custom Traffic Selectors and NAT Rules Together: It is not possible to use custom traffic selectors and NAT rules together on Azure VPN Gateway. The error message you received indicates that policy-based traffic selectors cannot be used when NAT rule associations are defined on the connection. This limitation means you will need to choose between using custom traffic selectors or NAT rules, but not both simultaneously.
- Recommended Approach:
- Custom IPsec Parameters: You can configure custom IPsec parameters such as DH Group 14 and PFS by following the guidelines for creating a custom IPsec/IKE policy on your Azure VPN Gateway. Ensure that the parameters match those required by your third-party API partner.
- Static IP Visibility: To achieve static IP visibility for outbound traffic that matches the whitelisted private IP requirement, you can consider the following options:
- Bring Your Own IP (BYOIP): Azure does support BYOIP, which allows you to use your own public IP addresses in Azure. However, this is generally for public IPs rather than private IPs. You will need to check the prerequisites for BYOIP, which typically include having ownership of the IP address range and ensuring it is registered with a regional Internet registry.
- Alternative Design: If BYOIP is not feasible, you might consider setting up a dedicated virtual network (VNet) with a VPN gateway that connects to your on-premises network. From there, you can route traffic through your on-premises firewall, which can then handle the NAT and ensure that the outbound traffic appears from the whitelisted private IP. This way, you can maintain the custom IPsec parameters while achieving the required source IP visibility.
In summary, due to the limitations of Azure VPN Gateway, you will need to carefully design your solution by either utilizing BYOIP if applicable or routing traffic through an on-premises solution to meet the whitelisted IP requirement while maintaining the necessary IPsec configurations.