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

    Traceroute on nested VPNs

    Scheduled Pinned Locked Moved OpenVPN
    9 Posts 3 Posters 1.1k 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.
    • U
      User172643
      last edited by

      Hi

      I've been experimenting with the full tinfoil hat for some weeks now, trying various nested VPN setups, mostly because I can really. I have a generally stable connection as it stands, latency isnt as bad as I thought but I have a question. Actually I have two but I'll save the MTU can of worms for another day.

      If you run a traceroute over a nested vpn connection, will it show hops across both of the vpns or just the second (outside?) one? I think I can see the 'nest' in OpenVPN, all traffic in my network is sent out over the AirVPN gateway which uses NordVPN as its interface, but if I run a tracetoute from inside the network I can only see traffic going into the AirVPN servers, I see no hint of NordVPN. Do I actually have a nested VPN or am I sadly deluded, or even worse, am I actually sending traffic out over both VPNs in a sad mockery of my intentions?

      8d91be06-039a-4333-a319-efb60b7d1a87-image.png

      9204caab-bd88-4616-9598-9038391e75a1-image.png

      Cheers for your thoughts here, I'm operating waaaaay above my networking comfort level here and for no good reason really, its not like im running Silkroad or anything but sod it, them snoopers are going to work for their money.

      JKnottJ 1 Reply Last reply Reply Quote 0
      • JKnottJ
        JKnott @User172643
        last edited by

        @user172643

        It will only show hops on the "inside" VPN. It can't see any others.

        PfSense running on Qotom mini PC
        i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
        UniFi AC-Lite access point

        I haven't lost my mind. It's around here...somewhere...

        J 1 Reply Last reply Reply Quote 0
        • J
          John2893ax @JKnott
          last edited by John2893ax

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • J
            John2893ax
            last edited by

            Do I actually have a nested VPN or am I sadly deluded, or even worse, am I actually sending traffic out over both VPNs in a sad mockery of my intentions?

            There is already a package for nested VPN. You can check your setup/theory with it.

            https://forum.netgate.com/topic/161162/openvpn-multihop-package

            1 Reply Last reply Reply Quote 0
            • U
              User172643
              last edited by

              Thanks JKnott, thats what I was hoping.

              John, this is very cool, im using it now and I have a connection, no fuss no muss. What I dont understand though is what this is doing compared to what I was doing before.

              I can see this adds a route to the first VPN to send traffic through the second VPN, but when i look under status the local address for VPN 2 remains my WAN address, not VPN1, is it all handled in the routing table? This might be one of those maddening questions from someone over his head but what is the difference between:

              Original:
              0d7691ee-1db2-4d84-bbee-a456521f9c11-image.png
              which I got by setting the interface for VPN 2 to VPN1, you can see the source for the one is the virtual address of the other.

              and

              746d70ec-df2e-4083-bd03-9185d3e362aa-image.png
              with "route-up "/usr/local/etc/openvpn-multihop/addroute.sh 62.102.148.148"

              If that first setup is wrong, what was it actually doing with the traffic or is this just two roads to the same destination? Thanks again,

              1 Reply Last reply Reply Quote 0
              • J
                John2893ax
                last edited by John2893ax

                @user172643

                There are still a few things to consider:

                1. OpenVPN Client:
                • Set "Interface" to -> any
                • "Don't add/remove routes" are set automatically by the package.
                • "route-up" command is automatically set by the package
                1. NAT rules must be present

                2. Gateway for firewall LAN does not have to be set

                Everything else is done by the package.

                Example when AirVPN is Hop1 and NorthVPN is Hop2.

                You can check the route under Diagnostics-> States.

                Hop1:
                Interface: WAN
                Filter expression: 443

                Output: "WAN 	udp 	XXXXXXXXXXXXXXXX -> 62.102.148.148:443 	MULTIPLE:MULTIPLE 	9.23 K / 4.975 K 	1.87 MiB / 2.04 MiB"
                

                Hop2:
                Interface: Hop2InterfacefromNordVPN
                Filter expression: 1194

                Output: "Hop2InterfacefromNordVPN 	udp 	XXXXXXXXXXXXXXXX -> 37.120.204.59:1194 	MULTIPLE:MULTIPLE 	9.23 K / 4.975 K 	1.87 MiB / 2.04 MiB"
                

                Edit: The OpenVPN connection always goes via the last hop

                1 Reply Last reply Reply Quote 0
                • U
                  User172643
                  last edited by

                  Hi John

                  Nice one, thanks. Im still curious as to how these two methods differ, did the old method of setting VPN 2 to use VPN1 as the interface work or was it always balls? Does this package also ensure hop 2 never sees my source IP, it seems to but I just want to check.

                  When you say firewall rules on LAN arent needed any more, if I'm selectively routing some clients out on the clearnet, can i just deactivate "Add default route" and still use LAN rules as normal? If i do so, do I still set the VPN gateway to go out over VPN2 or is there some new nested gateway to use, would the below still work?
                  06d650fc-dc24-42e9-866f-bbebfb8c57a7-image.png

                  Your a good man John, I've found very surprisingly few good resources for doing this on Pfsense, this package seems to be a godsend...

                  J 1 Reply Last reply Reply Quote 0
                  • J
                    John2893ax @User172643
                    last edited by

                    @user172643

                    I'm not an expert in this configuration myself and I don't know if I understood you correctly. English is not my first language.

                    If you fear IP leakage, then again there are different methods to secure that.
                    For example, you can add kill switch.
                    Another possibility would be to activate only the last hop in NAT Outbound. There are enough examples here in the forum.

                    If you remove "Add default route" from the last hop, then selective routing is possible. Then you can use any VPN gateway in LAN->Gateway.

                    If you leave "Add default route" activated, then you don't have to enter anything under LAN-> Gateway.The last hop always remains the default route everywhere.

                    1 Reply Last reply Reply Quote 0
                    • U
                      User172643
                      last edited by

                      Hi John

                      Thanks again for your help here, I have found your older thread where you were discussing this and developing your ideas for this script, that is a damn fine thread btw and I'm a bit embarassed I didnt find it before... https://forum.netgate.com/topic/157520/openvpn-client-cascade/46 for anyone else reading (who is also an idiot who cant use search), its a very solid description of the process for manually setting up a nested VPN.

                      I will have to look into this script a bit more, it seems to automate the later steps nicely but im not sure I understand all the details, especially the "Don't pull routes" settings, more research required. All the best mate

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