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

    [SOLVED] Wireguard site2site NAT / IP of tunnel shown instead of real IP on from other site

    Scheduled Pinned Locked Moved WireGuard
    15 Posts 2 Posters 693 Views
    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.
    • Bob.DigB
      Bob.Dig LAYER 8 @ogghi
      last edited by Bob.Dig

      @ogghi said in Wireguard site2site NAT / IP of tunnel shown instead of real IP on from other site:

      Wouldn't removing the GW in the WG interface config have it use the default GW, which is WAN?

      No. Just remove them there on both sides and you will see that there is no more NAT done. You can keep the gateways, just don't put them in the interface config as upstream gateways.

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

        @ogghi said in Wireguard site2site NAT / IP of tunnel shown instead of real IP on from other site:

        Wouldn't removing the GW in the WG interface config have it use the default GW, which is WAN?

        Ok, to be more precise, that will happen if you have internet traffic (any) as source incoming on that wireguard-interface. If this is the case, then you have to have the gateway as an upstream gateway on that interface. If you don't want NAT, then you have to create the no-NAT rule (in hybrid-Mode) yourself.

        O 2 Replies Last reply Reply Quote 0
        • O
          ogghi @Bob.Dig
          last edited by

          @Bob-Dig Just tried and there were issues accessing some things via web interface, so reverted to those interfaces having an upstream gateway.

          Will look up the no-NAT thing after lunch break!
          Thanks 😊

          1 Reply Last reply Reply Quote 0
          • O
            ogghi @Bob.Dig
            last edited by

            @Bob-Dig Before I apply the noNAT rule on site2:
            As there is a staic route for 172.16.0.0/21 to use the WG GW, I can basically set it like this?
            60cd33f4-3daa-4307-a715-9354a92d8df8-image.png

            Then any traffic from LAN network (172.16.8.0/21) going to WG interface should have NAT disabled, right?

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

              @ogghi Right. But try any if you don't want to NAT in general.

              O 1 Reply Last reply Reply Quote 0
              • O
                ogghi @Bob.Dig
                last edited by

                @Bob-Dig I tried, it breaks connection, for example I coudn't SSH to a host on site2 anymore!
                Are there any possible issues with automatically created NAT rules?
                Site2
                15501bd4-4a8a-4f10-8db0-504426776099-image.png

                Site1
                8cc4da70-8b57-4aa8-b567-a1a87b077647-image.png

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

                  @ogghi said in Wireguard site2site NAT / IP of tunnel shown instead of real IP on from other site:

                  for example I coudn't SSH to a host on site2 anymore!

                  Ok, why is that? Maybe that host only allows access from local subnets?

                  Are there any possible issues with automatically created NAT rules?

                  See for yourself. Basically everything is NATed.

                  There is not more I can tell you.

                  O 1 Reply Last reply Reply Quote 0
                  • O
                    ogghi @Bob.Dig
                    last edited by

                    @Bob-Dig
                    There is no IP limitation on that host, also as soon as I disabled the NAT I loose connection to other hosts, SNMP checks failing, or even web access to some host.

                    Those NAT rules are automatic and can't be disabled.

                    Maybe somebody else has an idea?

                    Many thanks for the input though!

                    O 1 Reply Last reply Reply Quote 0
                    • O
                      ogghi @ogghi
                      last edited by

                      @ogghi other thing that shows there is NAT where it shouldn't be:
                      On site 1 I have an internal speedtest ( https://github.com/librespeed/speedtest )
                      When I open the browser from site 2 it shows the tunnel IP of site 2 instead of the local IP I have with my laptop being in site 2...

                      O 1 Reply Last reply Reply Quote 0
                      • O
                        ogghi @ogghi
                        last edited by

                        @ogghi Sorry for the spam!
                        It works just fine now.
                        I had to remove the upstream gateway from the 2 tunnel interfaces on each site and then it started...

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post
                        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.