Enhanced Security Measures in Place:   To ensure a safer experience, we’ve implemented additional, temporary security measures for all users.

IPSec VPN with overlapping networks

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

IPSec VPN with overlapping networks

L2 Linker

To begin with I know the document Configuring IPSec VPN between overlapping networks.

Due to my lack of experience still I am not able to understand how I should create the NAT rules.

My objective is to configure the IPSec tunnel only on "my" side - one that will be accessed and should allow access to some servers in the 192.168.2.0/24 network. 

 

Below I put some aqnonymised configuration info: 

  IKE Gateway

Parameter

Value

Version

IKEv1 only mode

Address type

IPv4

Local IP Address

a.b.c.99

Peer IP Address

x.y.z.255

Exchange mode

auto

IPSec Tunnel Proxy IDs

Parameter

Value

Local

10.0.2.0/24 (NAT 1:1 – original subnet 192.168.2.0/24 )

Remote

10.95.0.0/16

 

The overlapping network addresses are 192.168.2.0/24

I have to create a NAT rule to show them to the accessing partner as 10.0.2.0/24 network.

 

I would be grateful if someone could tell me how to create this NAT rule with static translation.

 

Thank You a LOT! 🙂

1 accepted solution

Accepted Solutions

L2 Linker

Below is the configuration that finally worked.

 

Static Route

 

01_Static_Route.png

 

NAT

02_NAT.png

 

Security rules

03_Security.png

View solution in original post

23 REPLIES 23

L6 Presenter

Let's say partners want to access server at 192.168.2.10. Chose an IP you will use for NAT, let's say it's 10.0.2.10 (though any from that network would do).

All you need is a static destination NAT: source 10.95.0.0/16, destination 10.0.2.10, Destination Address Translation 192.168.2.10 (with apropriate zones).

 

And also you will need a firewall rule to allow access with pre-NAT IP address and post-NAT destination zone.

 

 

I would like a rule that will translate any address in 192.168.2.0 into a coresponding address in 10.0.2.0 (192.168.2.1-->10.0.2.1, 192.168.2.2-->10.0.2.2 etc).

Can it bo done?


@Filip_Fronczak wrote:

I would like a rule that will translate any address in 192.168.2.0 into a coresponding address in 10.0.2.0 (192.168.2.1-->10.0.2.1, 192.168.2.2-->10.0.2.2 etc).

Can it bo done?


Yes, this is possible.

  • Destination address object: 192.168.2.0/24
  • Destination translation address object: 10.0.2.0/24

Is this enough or should there be something more?

Do I need on my side a NAT rule to translate the source too or a rule in the other direction?

Sorry for asking basic questions...

 

IPSecVPN_1
{
to [ LAN_Servers ]; from [ IPSec_xxx ]; source [ any ]; destination [ 192.168.2.0/24 ]; service any; disabled no; destination-translation
{
translated-address 10.0.2.0/24;
}
}

Ignore my last post ... 

The NAT rule shoild look like this

  • Original source: 192.168.2.0/24
  • Original destination: 10.95.0.0/16
  • Type: Static IP
  • Translated source: 10.0.2.0/24
  • Translated destination: none

And what about the other way?

Traffic from the oher side that wants to arrive to servers in our network - 192.168.2.0/24?

Check the bi-directional checkbox

So, it's this, right?

 

IPSecVPN_xxx-1
{
to [ IPSec_xxx ]; from [ LAN_Servers ]; source [ 192.168.2.0/24 ]; destination [ 10.95.0.0/16 ]; source-translation
{
static-ip
{
bi-directional yes; translated-address 10.0.2.0/24;
}
}
}

Yes, looks correct.

Something is not right.

 

The phase-2 config on the connecting party is like this:

 

config vpn ipsec phase2-interface

    edit "VPN"

        set phase1name "VPN"

        set proposal aes256-sha256

        set dhgrp 14

        set keylifeseconds 3600

        set src-subnet 10.95.0.0 255.255.0.0

        set dst-subnet 10.0.2.0 255.255.255.0

    next

end

 

The tunnel is established but they are not able to ping servers on our side.

I do not see any traffic even in the "Session Browser".

Assuming you log everything; untill you don't see a packet arriving from their side it means they are not sending it correctly.

You can also try sending traffic towards them.

Fist I would suggest you to disable the bi-directional for the source NAT and configure manually destination NAT. The main reason for that is - What does the Bi-directional NAT Feature Provide? My phisosofy is to enable bi-directional only for static NAT going to public. NATing for VPN could be little bit tricky. So I would suggest the following:

 

## Source NAT

IPSecVPN_xxx-1 {
  to [ IPSec_xxx ]; 
  from [ LAN_Servers ];  
  source [ 192.168.2.0/24 ]; 
  destination [ 10.95.0.0/16 ]; 
  source-translation {
    static-ip {
      bi-directional no; translated-address 10.0.2.0/24;
    }
  }
}

#### Destination NAT

IPSecVPN_xxx-2 {
 to [ Untrust ] 
 from [ IPSec_xxx] 
 source [ 10.95.0.0/16 ] 
 destination [ 10.0.2.0/24 ] 
 destination-translation {
    translated-address 192.168.2.0/24;
  }

 Note: that the to zone in your destination NAT should  be zone based on your routing table for 10.0.2.0/24. If you don't have route for such network, traffic will be routed with default route to outside (or your what ever default is related). if you have route matching this network (for example 10.0.0.0/8) you need to put the zone following this route)

 

Remember:

	• NAT rule must be configured with pre-NAT zones (zones matching the addresses before the NAT)
	• Security rule must be configured with pre-NAT addresses, but post-NAT zones

 

Having the bidirectional enabled should work indeed, so if the traffic is failing I would suggest:
- Check the rule on the Fortigate at the other end
- Check the routing on the Fortigate at the other end
- Check if encrypted packets are increasing on the Fortigate

- Check for decrypted packets on your end
- As per revious comment - check if you can send traffic
- Check the log to confirm the NAT is applied
- Check for encrypted packets at your end and decrypted packets at Forti end

I am still stuck here. There is not much I can check on the other side. They say that the traffic is entering the tunnel.

I do not see any traffic on my side.

In vRouter I have a static route for 10.95.0.0/16 directing it to the tunnel.

Should I have anything more there?

Go to Network > IPSec Tunnels

In Status column of the tunnel you have "Tunnel Info"

Click on it.

While they ping does Pkt Decap counter increase?

 

If yes then you are receiving packets.

 

Have you overrided last 2 intrazone-default and interzone-default rules to log?

If yes do you see any sessions in Monitor > Traffic ?

 

 

Enterprise Architect, Security @ Cloud Carib Ltd
Palo Alto Networks certified from 2011
  • 1 accepted solution
  • 20919 Views
  • 23 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!