OPNsense Forum

English Forums => General Discussion => Topic started by: Tech34 on June 28, 2024, 04:02:44 PM

Title: VPN IPSEC site to site with virutal networks
Post by: Tech34 on June 28, 2024, 04:02:44 PM
Hello Forum,

I hope you're doing well.

I need some information about configuring an IPsec VPN on an OPNsense firewall.

I created an IPsec tunnel with a Stormshield firewall using virtual networks, but I'm unable to test the VPN tunnel. I don't know how to create virtual IP addresses and attach them to a physical interface using NAT in OPNsense. There are three types of NAT in OPNsense, and I'm unsure which one to use: NAT 1:1, outbound NAT, or port forward NAT.

I need your help to understand what I'm doing wrong. On the Stormshield firewall, I created a virtual network, which is preceded by a physical network. On the OPNsense firewall, I didn't create a virtual network, but I added it in the IPsec Phase 2 configuration.

Can you guys give me an idea of the NAT and filtering configurations that i should add in the opnsense.

Here's what the VPN tunnel looks like:


| 192.168.2.0/24 | -------------- (Stormshield [virt: 10.100.100.0/24]) ====ipsec==== (Opnsense[virt: 10.200.200.0/24]) -------------- | 192.168.100.0/24 |


This is what i'm trying to test:

Ping from 192.168.100.0/24 to 10.100.100.0/24 , i have created an object in stormshield network , that is NATTED to a physical ip address 192.168.2.201/24, but i don't know how to do the same thing in opnsense for a physical machine !

Thank you for your time guys !
Title: Re: VPN IPSEC site to site with virutal networks
Post by: Tech34 on July 02, 2024, 03:49:15 PM
Can anyone who knows how take time to answer?
i would really appreciate it !
Title: Re: VPN IPSEC site to site with virutal networks
Post by: Monviech (Cedrik) on July 02, 2024, 04:03:39 PM
Why do you need to NAT?

You have two networks:

192.168.2.0/24
192.168.100.0/24

There is no overlap between those networks.

Just create a policy based tunnel that connects these networks directly in Phase2.
Title: Re: VPN IPSEC site to site with virutal networks
Post by: Tech34 on July 11, 2024, 03:23:49 PM
Hello , thank you for your answer,

I need to NAT because the two networks are behind a virutal Network :

| 192.168.2.0/24 | -------------- (Stormshield [virt: 10.100.100.0/24]) ====ipsec==== (Opnsense[virt: 10.200.200.0/24]) -------------- | 192.168.100.0/24 |


in my case my LAN 192.168.100.0/24 has to be behind the network 10.200.200.0/24 ,

First i wanna know if it's possible to do it in opnsense because i tried to do it with Stormshield and it worked perfectly , and if it's possible how could we do it ( create the virtual network and apply the nat rules to translate from the virtual network to the local network )




Title: Re: VPN IPSEC site to site with virutal networks
Post by: Tech34 on July 11, 2024, 03:25:23 PM
Also , because we got alot of VPN tunnels in our stormshield firewall , we have to create virtual networks in order to avoid ip adress conflict
Title: Re: VPN IPSEC site to site with virutal networks
Post by: Monviech (Cedrik) on July 11, 2024, 04:30:24 PM
Do you mean this?

https://docs.opnsense.org/manual/how-tos/ipsec-s2s-conn-binat.html
Title: Re: VPN IPSEC site to site with virutal networks
Post by: Tech34 on July 11, 2024, 04:44:55 PM
Hello,

thanks for the document , it worked !


Title: Re: VPN IPSEC site to site with virutal networks
Post by: Tech34 on July 12, 2024, 10:45:52 AM
Hello again ,

It worked from the stormshield to the OPNsense :

<a href="https://ibb.co/qMDt3JL"><img src="https://i.ibb.co/SX6h4fD/Capture.png" alt="Capture" border="0" /></a>
but not from the OPNsense to stormshield !
Title: Re: VPN IPSEC site to site with virutal networks
Post by: Tech34 on July 12, 2024, 02:21:56 PM
Quick update , the ICMP works, but when i try RDP , it doesn't work , i have a question , does the BINAT do PAT ?
Title: Re: VPN IPSEC site to site with virutal networks
Post by: Monviech (Cedrik) on July 12, 2024, 02:26:05 PM
MTU - MSS problem?

Ipsec uses PMTUD to discover the maximum trasmission size, that requires some more ICMP options to be allowed, not only echo request and reply.

Otherwise set a hard MSS size with a Firewall - Normalization rule in OPNsense.

Here its explained for wireguard but it applies to any vpn technology when PMTUD doesnt work. https://docs.opnsense.org/manual/how-tos/wireguard-s2s.html
Title: Re: VPN IPSEC site to site with virutal networks
Post by: Tech34 on July 15, 2024, 09:11:56 AM
when i sniffed packets using wireshark , this is what i see : (https://i.postimg.cc/mhbYTr0f/Capture2.png) (https://postimg.cc/mhbYTr0f)
Title: Re: VPN IPSEC site to site with virutal networks
Post by: Monviech (Cedrik) on July 15, 2024, 11:31:35 AM
That looks like there is a SYN but no SYN-ACK. I don't know what the issue is though, it's a bit out of my reach right now.
Title: Re: VPN IPSEC site to site with virutal networks
Post by: Tech34 on July 15, 2024, 02:13:01 PM
it's okay, thank you for your help , you really helped me alot , in the opnsense , it keeps blocking the RDP traffic :

(https://i.postimg.cc/0rDzc9w4/Capture2.png) (https://postimg.cc/0rDzc9w4)
Title: [Solved] VPN IPSEC site to site with virutal networks
Post by: Tech34 on July 23, 2024, 12:26:07 PM
Hello, i solved my issue by reading this guy's post :

https://www.reddit.com/r/OPNsenseFirewall/comments/hrdzti/nat_not_working_with_ipsec_vpn/