S2S Connection

Mushtaq Ahmad 0 Reputation points
2025-12-01T11:20:41.67+00:00

Hello Community,

I am configuring an Azure VPN Gateway connection and need to meet the following requirements:

  • Enable custom IPsec policy with partner-required parameters (e.g., IKEv2, AES-256, SHA-256, DH Group 14, PFS enabled).
  • Attach an Egress NAT rule so that outbound traffic appears from a specific static IP address.

The issue arises only when I enable Use Custom Traffic Selector. After enabling this option and saving the configuration, I receive the following error:

Failed to update the configuration for connection 'Tunnel'. 
Error: Policy-Based Traffic Selectors cannot be used while NAT rule associations are defined on 
RG/providers/Microsoft.Network/connections/Tunnel

Questions:

  1. Is it possible to use custom traffic selectors and NAT rules together on Azure VPN Gateway?
  2. If not, what is the recommended approach to achieve:
    • Custom IPsec parameters (e.g., DH Group 14, PFS)
      • Static IP visibility for outbound traffic?

Any expert guidance or best practices would be greatly appreciated.

Thank you!Hello Community,

I am configuring an Azure VPN Gateway connection and need to meet the following requirements:

  • Enable custom IPsec policy with partner-required parameters (e.g., IKEv2, AES-256, SHA-256, DH Group 14, PFS enabled).
  • Attach an Egress NAT rule so that outbound traffic appears from a specific static IP address.

The issue arises only when I enable Use Custom Traffic Selector. After enabling this option and saving the configuration, I receive the following error:

Failed to update the configuration for connection 'Tunnel error: Policy-Based Traffic Selectors cannot be used while NAT rule associations are defined on 
RG-/providers/Microsoft.Network/connections/Tunnel

Questions:

  1. Is it possible to use custom traffic selectors and NAT rules together on Azure VPN Gateway?
  2. If not, what is the recommended approach to achieve:
    • Custom IPsec parameters (e.g., DH Group 14, PFS)
      • Static IP visibility for outbound traffic?

Any expert guidance or best practices would be greatly appreciated.

Thank you!msedge_UvZJpmP4FL

Azure VPN Gateway
Azure VPN Gateway
An Azure service that enables the connection of on-premises networks to Azure through site-to-site virtual private networks.
{count} votes

1 answer

Sort by: Most helpful
  1. Vallepu Venkateswarlu 1,235 Reputation points Microsoft External Staff Moderator
    2025-12-01T11:39:41.1633333+00:00

    Hi @ Mushtaq Ahmad,

    It sounds like you're facing some challenges trying to set up your Azure VPN Gateway connection with custom IPsec policies and NAT rules. Let's break down your questions and address your concerns.

    Custom Traffic Selectors and NAT Rules

    1. Can you use custom traffic selectors and NAT rules together? Unfortunately, Azure VPN Gateway does not support using custom traffic selectors in conjunction with NAT rules. You are specifically encountering that error because the gateway can't handle both configurations at the same time.

    To meet your requirements for both custom IPsec parameters and static IP visibility for outbound traffic, you'll need to take a different approach since you can't combine the two directly. Here's how you can achieve each one:

    1. Custom IPsec parameters (e.g., DH Group 14, PFS):
    2. Static IP visibility for outbound traffic:
      • For outbound traffic to have a static IP, you might need to use a different method, like associating a Public IP address directly with your Azure resources or configuring Azure Load Balancer in front of your service. This way, your outbound traffic can have a stable, known IP address that you can control.

    Ref:

    Kindly let us know if the above helps or you need further assistance on this issue.

     

    Please "upvote" if the information helped you. This will help us and others in the community as well.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.