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

    OpenVPN Split tunnelling **screenshots**

    Scheduled Pinned Locked Moved OpenVPN
    26 Posts 5 Posters 2.3k 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.
    • johnpozJ
      johnpoz LAYER 8 Global Moderator
      last edited by johnpoz

      No not really.. Since you have no idea what ports a remote p2p box (member of the swarm) might run on - could be 80, could be 443, etc. etc. Only way is to isolate the client that will be doing your p2p to the vpn is to understand the destination port(s) or do the routing via the source IP (your client).

      Your p2p client could be a vm with its own IP, your p2p client could be application bound to specific source IP - which in that case then you can filter that traffic to only use the vpn.

      To be honest, I really don't get why anyone these days runs p2p clients on their own connections. Just run it on a box somewhere else.. And just move the files you want back and forth to your network... Let the remote box in some dc on a 10g connection do the "sharing".. Much better solution if you ask me.

      Many of the swarm members prob going to be in the same DC.. Huge bandwidth, very low latency for exchanging the "linux iso images" ;) Your isp only sees you moving encrypted data between your ip and some IP X... These boxes with large amounts of storage and fast connections can be had for less than the cost of a netflix subscription... You only move the files back and forth when its convenient to you, at the full speed of your pipe.. You don't use up any of your limited upload "sharing" etc. etc.. It really makes zero sense to me to run p2p via your main connection - how much does that vpn cost you per month? When you could just use that for some seed box in p2p friendly country.. But hey you have fun! ;)

      How about sharing said remote box with some buddies that are also fans of sharing linux isos at high speed ;)

      An intelligent man is sometimes forced to be drunk to spend time with his fools
      If you get confused: Listen to the Music Play
      Please don't Chat/PM me for help, unless mod related
      SG-4860 24.11 | Lab VMs 2.7.2, 24.11

      E 1 Reply Last reply Reply Quote 0
      • L
        lifespeed
        last edited by

        I am also interested in this option, so rather than create a new thread I'll ask about a possible solution here. While I agree @johnpoz 's case for a remote P2P box may make sense for many users, I still think the OP has a valid question that wasn't answered. Let's say you have a truly high-speed connection to your home, both up and down.

        Is it possible (this may be a Windows question as well) to assign an OpenVPN connection to one's VPN provider to a VLAN, and then make this VLAN a second network connection in Windows, alongside the network card LAN already in place? Most P2P software supports binding to a specific network connection. Details of implementation for less-than-expert pfSense users would be helpful.

        1 Reply Last reply Reply Quote 0
        • johnpozJ
          johnpoz LAYER 8 Global Moderator
          last edited by johnpoz

          Yes you can policy route a source IP, already went over this... What you can not do is policy route destinations you have no idea about... What are the destination IPs, what are the ports - you have no idea what ports will be used by the other p2p nodes you will be talking to. And your not going to use the same source port, so you can not even policy route on the source port.

          But sure if you want to take an be it a standalone box, your application bound to a vip on your box.. A vm with its own IP, etc and then policy route that out your vpn service that is just clickity clickity sort of setup.

          You don't need to create vlan or anything... Say your IP on your windows machine is 192.168.1.100, add a second IP - again very simple to do, say 192.168.1.101, then bind your p2p client to this .101 IP, now any traffic from .101 you policy route out your vpn connection you setup on pfsense.

          An intelligent man is sometimes forced to be drunk to spend time with his fools
          If you get confused: Listen to the Music Play
          Please don't Chat/PM me for help, unless mod related
          SG-4860 24.11 | Lab VMs 2.7.2, 24.11

          1 Reply Last reply Reply Quote 0
          • L
            lifespeed
            last edited by

            I'm a believer that the simplest implementation is to be preferred. Not sure a VM is necessary, given the application in question can prefer a particular network connection.

            How would one set up a VPN/VLAN to appear as a second network connection in Windows?

            1 Reply Last reply Reply Quote 0
            • johnpozJ
              johnpoz LAYER 8 Global Moderator
              last edited by johnpoz

              You DON"T need to do that!!! But if you run the vpn software on your machine directly it will automatically be another interface that you can bind your p2p client too.

              As to setting up a vlan along with your normal connection. You would need a nic that supports multiple vlans on it.. windows doesn't make that easy like linux does.. Off the top the head I don't think in say normal windows 10 with direct support from the nic driver you can actually just create a vlan sub interface...

              But again you do not need to, just add a secondary IP to your interface...

              Here..

              Ethernet adapter Local:
              
                 Connection-specific DNS Suffix  . :
                 Description . . . . . . . . . . . : Realtek PCIe GbE Family Controller
                 Physical Address. . . . . . . . . : 00-13-3B-2F-67-62
                 DHCP Enabled. . . . . . . . . . . : No
                 Autoconfiguration Enabled . . . . : Yes
                 IPv4 Address. . . . . . . . . . . : 192.168.9.100(Preferred)
                 Subnet Mask . . . . . . . . . . . : 255.255.255.0
                 Default Gateway . . . . . . . . . : 192.168.9.253
                 DNS Servers . . . . . . . . . . . : 192.168.3.10
                 NetBIOS over Tcpip. . . . . . . . : Enabled
              

              Now I added a secondary IP..

              secIP.jpg

              Ethernet adapter Local:
              
                 Connection-specific DNS Suffix  . :
                 Description . . . . . . . . . . . : Realtek PCIe GbE Family Controller
                 Physical Address. . . . . . . . . : 00-13-3B-2F-67-62
                 DHCP Enabled. . . . . . . . . . . : No
                 Autoconfiguration Enabled . . . . : Yes
                 IPv4 Address. . . . . . . . . . . : 192.168.9.100(Preferred)
                 Subnet Mask . . . . . . . . . . . : 255.255.255.0
                 IPv4 Address. . . . . . . . . . . : 192.168.9.33(Tentative)
                 Subnet Mask . . . . . . . . . . . : 255.255.255.0
                 Default Gateway . . . . . . . . . : 192.168.9.253
                 DNS Servers . . . . . . . . . . . : 192.168.3.10
                 NetBIOS over Tcpip. . . . . . . . : Enabled
              

              Here is pfsense pinging that IP..

              ping.jpg

              Now just bind your p2p app to that 2nd IP, and policy route it - clickity clickity!

              An intelligent man is sometimes forced to be drunk to spend time with his fools
              If you get confused: Listen to the Music Play
              Please don't Chat/PM me for help, unless mod related
              SG-4860 24.11 | Lab VMs 2.7.2, 24.11

              1 Reply Last reply Reply Quote 0
              • L
                lifespeed
                last edited by

                Thanks, that was helpful!

                1 Reply Last reply Reply Quote 0
                • L
                  lifespeed
                  last edited by

                  Is there an IPv6 version of the above? I know where to find the network configuration in Windows, but wanting to do things correctly, there may be more to it than just typing in an IPv6 and changing the last 4 digits. The IPv6 the windows box gets now comes from prefix delegation from Comcast. Can I set up pfSense to hand out a second address to this machine? I'm getting "temporary" IPv6 addresses, but I doubt I want to use those as I believe they can change over time.

                  Thanks again for the help.

                  1 Reply Last reply Reply Quote 0
                  • johnpozJ
                    johnpoz LAYER 8 Global Moderator
                    last edited by

                    Your vpn supports IPv6? Unlikely..

                    An intelligent man is sometimes forced to be drunk to spend time with his fools
                    If you get confused: Listen to the Music Play
                    Please don't Chat/PM me for help, unless mod related
                    SG-4860 24.11 | Lab VMs 2.7.2, 24.11

                    L 1 Reply Last reply Reply Quote 0
                    • L
                      lifespeed @johnpoz
                      last edited by

                      @johnpoz said in OpenVPN Split tunnelling **screenshots**:

                      Your vpn supports IPv6? Unlikely..

                      Well, that wasn't an answer to the question at hand. I can choose a provider, some do support it, and as I've been working with pfsense I have found reasons to support IPv6.

                      1 Reply Last reply Reply Quote 0
                      • johnpozJ
                        johnpoz LAYER 8 Global Moderator
                        last edited by johnpoz

                        How exactly are you going to route traffic out your vpn that support IPv6 from a client behind pfsense? On a different IPv6 address. You would have to NAT the ipv6 for that to work. The setup makes no sense..

                        If want to do it with ipv6, then you would run the vpn client on the client - you wouldn't be policy routing traffic out a vpn connected to pfsense.

                        An intelligent man is sometimes forced to be drunk to spend time with his fools
                        If you get confused: Listen to the Music Play
                        Please don't Chat/PM me for help, unless mod related
                        SG-4860 24.11 | Lab VMs 2.7.2, 24.11

                        L 1 Reply Last reply Reply Quote 0
                        • L
                          lifespeed @johnpoz
                          last edited by lifespeed

                          @johnpoz said in OpenVPN Split tunnelling **screenshots**:

                          How exactly are you going to route traffic out your vpn that support IPv6 from a client behind pfsense? On a different IPv6 address. You would have to NAT the ipv6 for that to work. The setup makes no sense..

                          By binding the application requiring VPN to the 2nd network connection associated with an additional IPv6 address on the PC. pfSense would route traffic from that address to the VPN. Couldn't this be a firewall rule, not NAT? Agreed NAT and IPv6 don't make sense.

                          If want to do it with ipv6, then you would run the vpn client on the client - you wouldn't be policy routing traffic out a vpn connected to pfsense.

                          I don't want to run the VPN client on the server PC, I'm already doing that and it has several drawbacks, the main one is the VPN becomes the network connection for everything and screws with WAN server access.

                          1 Reply Last reply Reply Quote 0
                          • johnpozJ
                            johnpoz LAYER 8 Global Moderator
                            last edited by

                            For IPv6 vpn to work on pfsense, you would have to NAT to it... The vpn connection is not going to route your local IPv6 space..

                            An intelligent man is sometimes forced to be drunk to spend time with his fools
                            If you get confused: Listen to the Music Play
                            Please don't Chat/PM me for help, unless mod related
                            SG-4860 24.11 | Lab VMs 2.7.2, 24.11

                            L 1 Reply Last reply Reply Quote 0
                            • L
                              lifespeed @johnpoz
                              last edited by

                              @johnpoz said in OpenVPN Split tunnelling **screenshots**:

                              For IPv6 vpn to work on pfsense, you would have to NAT to it... The vpn connection is not going to route your local IPv6 space..

                              If you're referring to a link-local address, of course not. You're saying it won't route a SLAAC IPv6 that is globally routable?

                              1 Reply Last reply Reply Quote 0
                              • johnpozJ
                                johnpoz LAYER 8 Global Moderator
                                last edited by johnpoz

                                @lifespeed said in OpenVPN Split tunnelling **screenshots**:

                                You're saying it won't route a SLAAC IPv6 that is globally routable?

                                NO it wont - why would you think that would work?? VPN services work by handing you an IP they route, and then natting it to some public IP... You can not just use as source IP space they don't route.. Now if they would hand you clients IPv6 space they are routing, then you could do it.

                                Kind of how HE ipv6 works, its a tunnel - is just not encrypted, its just a GRE tunnel... If you find an vpn service that does that, then sure you could do it.

                                An intelligent man is sometimes forced to be drunk to spend time with his fools
                                If you get confused: Listen to the Music Play
                                Please don't Chat/PM me for help, unless mod related
                                SG-4860 24.11 | Lab VMs 2.7.2, 24.11

                                L 1 Reply Last reply Reply Quote 0
                                • L
                                  lifespeed @johnpoz
                                  last edited by lifespeed

                                  @johnpoz said in OpenVPN Split tunnelling **screenshots**:

                                  Kind of how HE ipv6 works, its a tunnel - is just not encrypted, its just a GRE tunnel... If you find an vpn service that does that, then sure you could do it.

                                  Thanks again for the description, I'll look into what is actually offered by these IPv6 VPN services. As you mention, a key question is do they hand you a single /128 address or a /64 or /60? For IPv6, a single /128 is not normal nor really keeping with the whole point of IPv6.

                                  You're also making me wonder if HE tunnel could be a replacement for some aspects of a VPN - the anonymizing aspect, not encryption obviously.

                                  1 Reply Last reply Reply Quote 0
                                  • johnpozJ
                                    johnpoz LAYER 8 Global Moderator
                                    last edited by

                                    The prefix they hand the vpn client doesn't matter... and /128 is perfectly valid for a point to point connection like a vpn client to the vpn server... Work just fine when you run the vpn on the client.

                                    When your doing it on the edge router, you have a problem for the other clients - you have to nat it to the IP given to the actual vpn client.. They are not routing a /64 prefix for you to use on all your clients - so if you want to use it you would have to nat to the IP they give the vpn client... Like what happens with IPv4.

                                    Natting to IPv6 does work btw... if your interested in actually doing this.. But to be honest its just easier to spend your time/effort and money on just a box somewhere.. It's a much better solution across the board.

                                    An intelligent man is sometimes forced to be drunk to spend time with his fools
                                    If you get confused: Listen to the Music Play
                                    Please don't Chat/PM me for help, unless mod related
                                    SG-4860 24.11 | Lab VMs 2.7.2, 24.11

                                    1 Reply Last reply Reply Quote 0
                                    • E
                                      ekoo @johnpoz
                                      last edited by ekoo

                                      @johnpoz
                                      Hi John,

                                      I have a 1gbe up/down fibre up and down and its the only source of "information" to the house and my rental tenants (eg: home phone, internet, even stream the local radio).
                                      The said "linux ISO's" are my main entertainment thru a said "P-server"... which is hosted on the NAS and serves about 25 accounts of "families and friends".
                                      Luckily, most of my p2p'ing is from a private tracker site. its the odd occasional public site i download.
                                      I'm in Canada, where P2P is decently friendly, depends on the tracker.
                                      ExpressVPN's pricing isn't bad at all, considering I need something reliable to climb the GFW whenever i travel to China.

                                      I was hoping in someway i could narrow down just Transmission thru VPN and not the said "P-server" on the same NAS.
                                      From your explanation, it sounds like it can only be done with IP.

                                      D 1 Reply Last reply Reply Quote 0
                                      • D
                                        DaMaGe21 @ekoo
                                        last edited by

                                        @ekoo I am doing what your asking in your OP. But my setup is different. I have multiple Nics in my server and I can bind P2P to use one of those Nics. My router is pFSense with 8 ports to do whatever I want with.

                                        So I setup pFSense to use Opt3(port3) to route all traffic through expressvpn, then on my server, I bind my P2P client to use Nic3 only.

                                        I then set each nics index priority so that traffic is routed through nic1 first and so on. Only my P2P is traveling through VPN.

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