Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Source Address is getting translated when transversing tunnel

    WireGuard
    4
    11
    1.1k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      siwatsirichai
      last edited by

      My setup is
      Office A: 192.168.0.1/24
      Office A VTI: 10.0.0.1/24
      | |
      WireGuard Tunnel
      | |
      Office B: 192.168.1.1/24
      Office B VTI: 10.0.0.2/24

      All of the routings work correctly but the source address is getting translated to the VTI address

      For example, let's say 192.168.0.64/24 (Client A) is trying to communicate with 192.168.1.50/24 (Client B), Client A sends SRC: 192.168.0.64 DST: 192.168.1.50, but Client B receives SRC: 10.0.0.1 DST: 192.168.1.50, There seems to be some NAT Magic that had not happened before with IPSec (I recently switch from IPSec).

      Both Ends are pfSense Gateway

      1 Reply Last reply Reply Quote 0
      • M
        meluvalli
        last edited by

        I am having this same problem. Any update on this?

        Bob.DigB 1 Reply Last reply Reply Quote 0
        • Bob.DigB
          Bob.Dig LAYER 8 @meluvalli
          last edited by

          @meluvalli Shouldn't happened if you make it this way.

          M M 3 Replies Last reply Reply Quote 0
          • M
            michmoor LAYER 8 Rebel Alliance @Bob.Dig
            last edited by michmoor

            @siwatsirichai
            If you check your NAT outbound rules you will see ta raffic rule for it to get NAT;ted to the interface of the WG tunnel on your pfsense. Under the WG interface make sure that you do NOT have a gateway selected. Having a gateway present is one of the conditions that pf uses to create automatic outbound NAT rules. If you leave the gateway blank and also have static routes to the WG gateway that you create (you need to create) than the far side will see the Real IP of the client.

            Firewall: NetGate,Palo Alto-VM,Juniper SRX
            Routing: Juniper, Arista, Cisco
            Switching: Juniper, Arista, Cisco
            Wireless: Unifi, Aruba IAP
            JNCIP,CCNP Enterprise

            1 Reply Last reply Reply Quote 0
            • M
              meluvalli @Bob.Dig
              last edited by

              @bob-dig
              Thanks! This solved my problem 26 minutes later! HAHA!

              For those that also have this issue, make sure on the interface, you select "none" as the gateway. This will prevent NATing :)

              @bob-dig, great video though!

              1 Reply Last reply Reply Quote 0
              • M
                meluvalli @Bob.Dig
                last edited by

                @bob-dig
                Update:
                While this did solve the problem, it created a new problem :(....

                I currently have my setup to NAT from Site B to Site A Internal client.

                I changed my outbound NAT on Site B to my Site A Network. (It was pointing to my tunnel Network before).

                However, this doesn't seem to fix it. The only way I can go from SITE B-WAN to SITE A Client is if I use the upstream gateway. Any idea how to resolve this?

                Bob.DigB 1 Reply Last reply Reply Quote 0
                • Bob.DigB
                  Bob.Dig LAYER 8 @meluvalli
                  last edited by

                  @meluvalli I can't follow what you are doing exactly.

                  1 Reply Last reply Reply Quote 0
                  • S
                    siwatsirichai
                    last edited by

                    I actually got it working a while back, I just create a DO NOT NAT entry manually for my internal network
                    Site A: 192.168.0.0/24
                    Site B: 10.16.6.0/24

                    Site A DNN Configuration
                    fed762dd-9d49-4d90-bd29-074cb0ca2a06-image.png
                    64edcf06-819b-46a0-aa51-3585a962b9f1-image.png

                    Site B DNN Configuration
                    1e74c1c2-b379-45a0-b4c0-4a6e6b8e7ab3-image.png
                    38148155-ac40-4252-9a00-2f8a697ea603-image.png
                    Note that I'm basically saying that any traffic from B that's going to A must not be translate, note that the the configuration will have the destination of the remote network but not the local network because Outbound NAT basically translate traffic that coming out of a specific interface, this is done at the originating router (internal IP to VTI IP).

                    M 1 Reply Last reply Reply Quote 0
                    • M
                      meluvalli @siwatsirichai
                      last edited by

                      @siwatsirichai
                      So to confirm, you left upstream set on the interface (WIREGUARD Interface) and just added the NONAT rules for outbound?

                      S 1 Reply Last reply Reply Quote 0
                      • S
                        siwatsirichai @meluvalli
                        last edited by

                        @meluvalli
                        Site A have no gateway, Site B,C,D,… have site A as gateway, as this is a site-to-multisite configuration.

                        M 1 Reply Last reply Reply Quote 0
                        • M
                          michmoor LAYER 8 Rebel Alliance @siwatsirichai
                          last edited by

                          @siwatsirichai
                          I think you are handling this wrong but depends on your use case.

                          Site B,C,D will have the real IP of the client natted - Assuming this is what you want.

                          If this is not what you want, then have no gateway configured for the WireGuard Interface at site B,C,D. You then need to create a gateway at each site and for each site then you utilize static routing.

                          Firewall: NetGate,Palo Alto-VM,Juniper SRX
                          Routing: Juniper, Arista, Cisco
                          Switching: Juniper, Arista, Cisco
                          Wireless: Unifi, Aruba IAP
                          JNCIP,CCNP Enterprise

                          1 Reply Last reply Reply Quote 0
                          • S Sn3akerz referenced this topic on
                          • First post
                            Last post
                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.