NAT RULE - IPsec VPN

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

NAT RULE - IPsec VPN

L1 Bithead

Hello all,

I am implementing an IPsec VPN and I have to NAT the source IP address, but I am very confused with the bidirectional source NAT,

Lets say my local IP=192.168.1.1 (natted to 1.1.1.1), remote IP in the other side of the VPN= 10.10.10.1

For example If I configure:

 

Src Zone        Src IP                  Dest Zone            Dest. IP             NAT 

Internal          192.168.1.1            VPN                 10.10.10.1        source nat: 1.1.1.1   (bidirectional)

 

behind the scene the returning NAT rule created will be:

 

Src Zone        Src IP                  Dest Zone            Dest. IP             NAT 

Any                   Any                       VPN                     1.1.1.1              dest. nat: 192.168.1.1 

 

My confusion is based in the fact that 1.1.1.1 is not in the VPN zone, its a external IP in the External zone so I think I cannot use bidirectional NAT in this scenario and I have to create 2 rules for each direction like:

 

Src Zone        Src IP                  Dest Zone            Dest. IP             NAT 

Internal          192.168.1.1            VPN                 10.10.10.1            source nat: 1.1.1.1 

Src Zone        Src IP                  Dest Zone            Dest. IP             NAT 

 VPN              10.10.10.1             External               1.1.1.1              dest. nat: 192.168.1.1 

 

Am I wrong about this?

 

 

 

 

 

1 accepted solution

Accepted Solutions

@joseglez,

 

Yes, for reverse rule (inbound traffic), you need to put destination zone as internal not external. Then only traffic will be forwarded to internal IP 192.168.1.1. Normally while hosting internal server also, we configure policies in same way.

 

Your NAT would be like -

 

Bi-Directional NAT

 

SZONE - Internal

S-IP - 192.168.1.1

DZONE - VPN

D-IP - 10.10.10.1

S-NAT-IP - 1.1.1.1

 

Security Policy for outbound traffic -

SZONE - Internal

S-IP - 192.168.1.1

DZONE - VPN

D-IP - 10.10.10.1

 

Security Policy for inbound traffic -

SZONE - VPN

S-IP - 10.10.10.1

DZONE - Internal

D-IP - 1.1.1.1

 

Also configure proper routes and proxy-id configuration. With this, everything should work as expected.

 

Hope it helps!

Mayur

 

M

Check out my YouTube channel - https://www.youtube.com/@NetworkTalks

View solution in original post

4 REPLIES 4

L6 Presenter

@joseglez,

 

First of all, is it bidirectional tunnel (both sides will be initiator and responder) then only you need BI-Directional NAT ?

If only any of the side is initiator and other responder, then you don't need Bi-Directional NAT.

 

Now you want to NAT IP 192.168.1.1 with 1.1.1.1, in this case,

1. IP 1.1.1.1 shouldn't be part of VPN ZONE. Destination IP addresses will be part of VPN zone (i.e. 10.10.10.1 ). Just make sure you have route towards desired tunnel interface for this IP/network.

2. Configure proper NAT Rule. So IP 1.1.1.1 would be consider to be part of internal as it is going to DNAT with internal IP 192.168.1.1

3. Also make sure NAT IP 1.1.1.1 is part of proxy ID configuration.

 

Hope it helps you!

Mayur

M

Check out my YouTube channel - https://www.youtube.com/@NetworkTalks

Hello @SutareMayur,

Yes, it will be bidirectional.

I agree with you when you said that 1.1.1.1 shouldn't be in the  VPN. Since that is what paloalto would do if I select bidirectional source NAT,

that is why I think I may have to use 2 unidirectional rules.

I do not quite understand when you said that: "IP 1.1.1.1 would be consider to be part of internal as it is going to DNAT with internal IP 192.168.1.1"

Do you mean, when creating the reverse rule, instead of external I should put Internal as  dest zone??

 

 

@joseglez,

 

Yes, for reverse rule (inbound traffic), you need to put destination zone as internal not external. Then only traffic will be forwarded to internal IP 192.168.1.1. Normally while hosting internal server also, we configure policies in same way.

 

Your NAT would be like -

 

Bi-Directional NAT

 

SZONE - Internal

S-IP - 192.168.1.1

DZONE - VPN

D-IP - 10.10.10.1

S-NAT-IP - 1.1.1.1

 

Security Policy for outbound traffic -

SZONE - Internal

S-IP - 192.168.1.1

DZONE - VPN

D-IP - 10.10.10.1

 

Security Policy for inbound traffic -

SZONE - VPN

S-IP - 10.10.10.1

DZONE - Internal

D-IP - 1.1.1.1

 

Also configure proper routes and proxy-id configuration. With this, everything should work as expected.

 

Hope it helps!

Mayur

 

M

Check out my YouTube channel - https://www.youtube.com/@NetworkTalks

Great, thank you @SutareMayur 

I included the after NAT IPs in the proxy IDs also.

 

  • 1 accepted solution
  • 9058 Views
  • 4 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!