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

    pfSense behind 4g router

    Scheduled Pinned Locked Moved General pfSense Questions
    35 Posts 3 Posters 3.0k 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.
    • G
      Gérald
      last edited by

      If I understand, I have to install pfSense also on the VPS and set up a site to site ?

      1 Reply Last reply Reply Quote 0
      • stephenw10S
        stephenw10 Netgate Administrator
        last edited by

        Yes. Or it could be a remote access style but as long as the client is at the 4G end and the server is in the VPS.

        Steve

        1 Reply Last reply Reply Quote 0
        • G
          Gérald
          last edited by

          Or it could be a remote access style

          What can I use as other remote access style?
          If the installation and configuration could be simple on the server side ...
          My main wish is to not use a client to connect to my LAN.

          1 Reply Last reply Reply Quote 0
          • JKnottJ
            JKnott @Gérald
            last edited by

            @Gérald said in pfSense behind 4g router:

            I am on the private network of my access provider with a private IP and it is impossible for me to access my cameras and my home automation from the outside.

            Don't you just love NAT?

            This is just one reason we need to move to IPv6. NAT requires hacks upon hacks to get around the problems it causes.

            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...

            1 Reply Last reply Reply Quote 0
            • stephenw10S
              stephenw10 Netgate Administrator
              last edited by

              You can use site-to-site or multi-client style setup. Both will work as long as you have the server end of the tunnel at the VPS and the client end behind the 4G router. That is required since the client initiates the connection to the server outbound.

              Once the tunnel is up you can just access hosts on your LAN by port forwarding from the VPS end.

              Steve

              1 Reply Last reply Reply Quote 0
              • G
                Gérald
                last edited by Gérald

                Thanks a lot for all these informations.
                I will try that ...

                1 Reply Last reply Reply Quote 0
                • G
                  Gérald
                  last edited by

                  I come back to you after testing a lot of things.
                  I tested the reverse ssh and it works exactly as I described in my first post myPublicIP: myPort
                  I installed on my VPS a Debian distribution and I initiate a tunnel with the command: ssh -R remote_port: host: localport your_username @ IP address of the server.
                  Is it possible to do the same thing in pfSense?

                  1 Reply Last reply Reply Quote 0
                  • stephenw10S
                    stephenw10 Netgate Administrator
                    last edited by

                    Yes: https://www.freebsd.org/cgi/man.cgi?query=ssh

                    But you should use a VPN for this really.

                    Steve

                    stephenw10S 1 Reply Last reply Reply Quote 0
                    • G
                      Gérald
                      last edited by

                      Thanks for this !!!
                      But no package for that ?

                      1 Reply Last reply Reply Quote 0
                      • stephenw10S
                        stephenw10 Netgate Administrator
                        last edited by

                        For SSH? It's included by default, client and server.

                        1 Reply Last reply Reply Quote 0
                        • G
                          Gérald
                          last edited by

                          Really !!!
                          And it's where ??

                          JKnottJ 1 Reply Last reply Reply Quote 0
                          • JKnottJ
                            JKnott @Gérald
                            last edited by

                            @Gérald said in pfSense behind 4g router:

                            Really !!!
                            And it's where ??

                            SSH is built in to pfSense, or rather the FreeBSD it runs on. If you're running Linux, it's also built in, but you need something like Putty on Windows.

                            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...

                            1 Reply Last reply Reply Quote 0
                            • G
                              Gérald
                              last edited by

                              I know that SSH is integrated with freeBSD.
                              I use it this way to access my servers.
                              But it seems that there is no interface in pfSense to make SSH tunnel creation more user frendly

                              JKnottJ 1 Reply Last reply Reply Quote 0
                              • stephenw10S
                                stephenw10 Netgate Administrator @stephenw10
                                last edited by

                                @stephenw10 said in pfSense behind 4g router:

                                ...you should use a VPN for this really.

                                😉

                                But I'm not sure what you expect to see here for SSH. Once it's enabled in System > Advanced > Admin Access you can tunnel stuff to it or use it as a proxy, which I generally prefer.

                                Steve

                                1 Reply Last reply Reply Quote 0
                                • JKnottJ
                                  JKnott @Gérald
                                  last edited by

                                  @Gérald said in pfSense behind 4g router:

                                  But it seems that there is no interface in pfSense to make SSH tunnel creation more user frendly

                                  ????

                                  You don't need a tunnel for SSH. It's encrypted on it's own.

                                  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...

                                  1 Reply Last reply Reply Quote 0
                                  • stephenw10S
                                    stephenw10 Netgate Administrator
                                    last edited by

                                    Looks like he's trying to setup this sort of tunnel:
                                    https://www.ssh.com/ssh/tunneling/example#sec-Remote-Forwarding

                                    1 Reply Last reply Reply Quote 0
                                    • G
                                      Gérald
                                      last edited by

                                      @stephenw10 said in pfSense behind 4g router:

                                      Looks like he's trying to setup this sort of tunnel:
                                      https://www.ssh.com/ssh/tunneling/example#sec-Remote-Forwarding

                                      That's exactly it, as previously stated ...

                                      1 Reply Last reply Reply Quote 0
                                      • stephenw10S
                                        stephenw10 Netgate Administrator
                                        last edited by

                                        Ok, so it's exactly the same as it would be for Debian. What do you expect to see in a 'package' for this?

                                        Steve

                                        1 Reply Last reply Reply Quote 0
                                        • G
                                          Gérald
                                          last edited by

                                          Thanks for your interest !

                                          I would like a package that would allow me to set up SSH tunnels quickly between my LAN and my VPS
                                          To be able to control their states and an automatic reconnection (autossh) in case of disconnection.

                                          1 Reply Last reply Reply Quote 0
                                          • stephenw10S
                                            stephenw10 Netgate Administrator
                                            last edited by

                                            Hmm, I see. So maybe something like the port forward setup page but including configuring the actual SSH connections?

                                            I've never seen anything like that offered on any firewall to be honest. Really this is exactly where you would usually just use a VPN. Is there some reason you don't want to use a VPN?

                                            Steve

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