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

    How to bypass VPN for FTP

    Scheduled Pinned Locked Moved OpenVPN
    8 Posts 5 Posters 1.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.
    • gregeehG
      gregeeh
      last edited by

      Hi all,

      pfSense 2.4.4-RELEASE-p3

      I have OpenVPN setup on my pfSense box and all LAN traffic to the internet goes via the VPN.

      I now want FTP with TLS (Auth TLS - Explicit) port 21, passive mode (yes I know old protocol) to bypass the VPN for one client on the LAN. Done some searching but have not been able to find out how to do this or if it is even possible.

      Any comments or suggestions are welcome.

      TIA

      Greg

      PfSense running on Qotom mini PC
      CPU N3150, 2 GB memory, 32 GB SSD & 2 Realtek Gb Ethernet ports.
      UniFi AC-Lite access point

      1 Reply Last reply Reply Quote 0
      • C
        conor
        last edited by

        Policy Based Routing

        Goto Firewall > Rules
        Select LAN

        Add a rule to allow traffic on port 21 and the server IP its going t.

        Then scroll down and click 'display advanced' and scroll down to "Gateway"

        Select the interface other than default that you want the FTP connection to exgress via.

        200+ pfSense installs - best firewall ever.

        gregeehG 1 Reply Last reply Reply Quote 0
        • gregeehG
          gregeeh @conor
          last edited by

          @conor said in How to bypass VPN for FTP:

          Policy Based Routing
          Goto Firewall > Rules
          Select LAN
          Add a rule to allow traffic on port 21 and the server IP its going t.
          Then scroll down and click 'display advanced' and scroll down to "Gateway"
          Select the interface other than default that you want the FTP connection to exgress via.

          Unfortunately that does not work. I think it has something to do with how FTP works with the control and data using different ports.

          PfSense running on Qotom mini PC
          CPU N3150, 2 GB memory, 32 GB SSD & 2 Realtek Gb Ethernet ports.
          UniFi AC-Lite access point

          1 Reply Last reply Reply Quote 0
          • NogBadTheBadN
            NogBadTheBad
            last edited by

            Try using sftp if you can, that just uses a single port ans is more secure.

            Andy

            1 x Netgate SG-4860 - 3 x Linksys LGS308P - 1 x Aruba InstantOn AP22

            gregeehG 1 Reply Last reply Reply Quote 0
            • gregeehG
              gregeeh @NogBadTheBad
              last edited by

              @NogBadTheBad said in How to bypass VPN for FTP:

              Try using sftp if you can, that just uses a single port ans is more secure.

              That's a great idea, except the FTP Servers I'm connecting to do not support SFTP, only FTP with TLS (Auth TLS - Explicit) port 21, passive mode.

              PfSense running on Qotom mini PC
              CPU N3150, 2 GB memory, 32 GB SSD & 2 Realtek Gb Ethernet ports.
              UniFi AC-Lite access point

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

                So your problem is going to be especially with passive, is yes in the control channel it will tell your client with IP and port to connect to... So your policy route rule would really need to be for the dest IP and any port.. Unless you know the range of ports the server is going to give you for the passive connection..

                But I doubt you also want to talk to this server on other ports through the vpn? So on your policy route - just use the IP of the server as the dest for any port..

                Also with policy routing you really need to make sure you didn't grab routes from your vpn service..

                Who runs this ftp server? I would bring up to them that you really want sftp to talk to their server.

                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.8, 24.11

                gregeehG 1 Reply Last reply Reply Quote 0
                • gregeehG
                  gregeeh @johnpoz
                  last edited by

                  @johnpoz said in How to bypass VPN for FTP:

                  So your policy route rule would really need to be for the dest IP and any port.. Unless you know the range of ports the server is going to give you for the passive connection..

                  That should work, thanks for the suggestion. Will give that a try.

                  PfSense running on Qotom mini PC
                  CPU N3150, 2 GB memory, 32 GB SSD & 2 Realtek Gb Ethernet ports.
                  UniFi AC-Lite access point

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

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