OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • Virtual private networks »
  • [SOLVED] Outbound NAT to IPSEC tunnel
« previous next »
  • Print
Pages: [1]

Author Topic: [SOLVED] Outbound NAT to IPSEC tunnel  (Read 1664 times)

skydiablo

  • Newbie
  • *
  • Posts: 45
  • Karma: 1
    • View Profile
[SOLVED] Outbound NAT to IPSEC tunnel
« on: June 28, 2022, 03:29:37 pm »
Hi! i have an dummy network, an loopback interface with assigned IP (192.168.200.1/24). also an running IPSEC tunnel (non routed, non VTI). so i want my local LAN to NAT over this dummy network, so that any request from my local LAN is NATed by 192.168.200.1:


Code: [Select]
                                      ┌────────────────────────┐
                                      │                        │
┌───────────────────┐                 │ ┌────────────────────┐ │
│                   │                 │ │                    │ │
│  Remote Network   │   IP-SEC-Tunnel │ │  Dummy Network     │ │
│  10.22.248.0/21  ─◄─────────────────►─┼─ 192.168.200.0/24  │ │
│                   │                 │ │                    │ │
└───────────────────┘                 │ └─────────▲──────────┘ │
                                      │           │            │
                                      │           │            │
                                      │  ┌────────┴─────────┐  │
                                      │  │                  │  │
                                      │  │  Outbound NAT    │  │
                                      │  │                  │  │
                                      │  │   10.50.0.0/24   │  │
                                      │  │        │         │  │
                                      │  │        ▼         │  │
                                      │  │  192.168.200.1   │  │
                                      │  │                  │  │
                                      │  └────────▲─────────┘  │
                                      │           │            │
                                      └───────────┼────────────┘
                                                  │10.50.0.2
                                                  │
                                                  │
  ┌───────────┐                       ┌───────────┴───────────┐
  │           │                       │                       │
  │  Machine  │                       │  Local LAN            │
  │           │10.50.0.107            │  10.50.0.0/24         │
  │           ├──────────────────────►│                       │
  └───────────┘                       │                       │
                                      └───────────────────────┘

i have just add an outbound NAT, and try to ping from an machine like 10.50.0.107 to 10.22.250.1 ... the machine knows the right route (10.22.248.0/21 via 10.50.0.2 dev eth0) but no success. there is no NAT ing and no packet is arriving the IPSEC remote network.
is it possible like this to NAT the traffic to an IPSEC tunnel?
« Last Edit: June 29, 2022, 03:49:26 pm by skydiablo »
Logged

skydiablo

  • Newbie
  • *
  • Posts: 45
  • Karma: 1
    • View Profile
Re: Outbound NAT to IPSEC tunnel
« Reply #1 on: June 29, 2022, 03:49:11 pm »
okay, i have solved by my own with this post by reddit: https://www.reddit.com/r/OPNsenseFirewall/comments/hrdzti/nat_not_working_with_ipsec_vpn/

thx for attention.
Logged

Tech34

  • Newbie
  • *
  • Posts: 12
  • Karma: 0
    • View Profile
Re: [SOLVED] Outbound NAT to IPSEC tunnel
« Reply #2 on: July 17, 2024, 11:50:37 am »
Hello , i read your post on reddit, i was wondering if you could help me find a solution to my problem , i have the same issue , i've added the SPD entries and everything , the one to one NAT is correctly configured , the only difference that i have is that my WAN network isn't what i put inside the VPN tunnel in phase 2 , i have two virtual networks that needs to communicate in phase 2 ( 10.100.100.0/24 <--------IPSEC--------> 10.200.200.0/24 ), i don't know what i'm doing wrong , but if you have any idea , please share it !!
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • Virtual private networks »
  • [SOLVED] Outbound NAT to IPSEC tunnel
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2