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

    Accessing linux box the pfsense

    Problems Installing or Upgrading pfSense Software
    3
    10
    2.6k
    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.
    • B
      Bugs78
      last edited by

      Hi all,

      I'm working on a project with a virtual hosting company. I have a virtual network with a pfsense firewall which everything uses to access the internet. I have a Windows 2012 server and 2 Centos boxes

      I would like to be able to access the 2 linux boxes from outside the firewall using SSH keys I have created the keys which work fine from inside the network however, I can't get it working externally. I'm assuming pfsense needs to forward on the traffic from the WAN (the outside world) to my linux box but I can't get it working. Has anyone done this before or know of a help document which may point me in right direction.

      Thanks in advance

      Craig

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

        https://doc.pfsense.org/index.php/How_can_I_forward_ports_with_pfSense

        Yes I would say the vast majority of users of pfsense have a port or two forwarded, so yeah like everyone has done it.

        It really is click click.  Firewall, Nat port forward.  For your ssh forward its like 3 clicks.. Select ssh as dest, put in your IP address you want to forward to.  Save.  It defaults to wan and tcp..  So this is really like 1.3 seconds and done.

        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
        • B
          Bugs78
          last edited by

          Hi I have been playing around with it and can't seem to get get it to work correctly. In the source I have tried both any and the network up of my machine, destination I have both the network public up and the local ip of the machine and finally the redirect up I have as the local ip of the machine but I can't get it to work I'm sure it's something daft but, I can't see it

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

            Why would you be touching anything but the dest port and IP?  See attached.

            Put in your machine IP where I have 192.168.1.100, your pfsense has a wan IP that is public right?  And your machines behind pfsense have private IPs rfc1918 right?  Then this is how you would forward ssh to one of those machines.  You don't have to mess with source.. You only have to set the dest, and the IP.  The defaults are fine for everything else, wan and tcp.

            If your having problems https://doc.pfsense.org/index.php/Port_Forward_Troubleshooting

            thisisit.png
            thisisit.png_thumb

            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
            • B
              Bugs78
              last edited by

              I have been playing round with it and still not had any success I have set the following so not sure why its not working.

              I have attached a screen shot of my port and IP settings, I have also tried changing the default destination from WAN address to network, Alias, Any

              Thanks

              Untitled.jpg
              Untitled.jpg_thumb

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

                Have you set the default gateway on the Linux boxes to point to your pfSense? They need to route back out through the same direction as the inbound traffic.

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

                  dude give me access to your pfsense and will take a look..  PM the info..  Should only take a few minutes to figure out what your doing wrong.

                  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
                  • B
                    Bugs78
                    last edited by

                    @muswelhillbilly: Yes I hadnt at the time of my first post but, I have since and it still doesn't work when i`m trying to connect the connection just times out.

                    @johnpoz: Unfortunately I can't get you access this is my employers network, besides its turned into a mission now and I need to find out what's wrong with it.

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

                      What is wrong is PEBKAC plain and simple sorry dude…  This is not rocket science, and that you tried using your public IP as the redirect.. ???  How/Why are you working on such a thing for your company?

                      Lets break it down so we are all on the same page.  See attached.. Is this your setup in a nutshell?  Pfsense wan has public IP, your servers behind pfsense are on rfc1918 pointing to pfsense as gateway.  Can these servers behind pfsense get to the internet through pfsense.

                      Where exactly are you having issues when you go through the troubleshooting doc?  Did you validate that your ssh traffic is being seen on pfsense wan, did you validate that pfsense sends it to your server?  Troubleshooting this is really like 2 minutes.  Simple sniff on couple interfaces gives you the whole story..

                      yoursetupportforward.png
                      yoursetupportforward.png_thumb

                      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
                      • B
                        Bugs78
                        last edited by

                        Hi All,

                        Just like to apologise for my dumbassery! As you said @johnpoz it was very straight forward I noticed I could add logging on the firewall rules which I did then found I needed to add a 'Floating rule' to allow traffic, discovering how to enable the logs on the rules though is what really sorted it for me.

                        @johnpoz: I have just started a new role in a cloud hosting company and they have set us tasks to do to learn the systems they use and how they are implemented and this was one of the tasks.

                        I also have to do a project to complete my probation and im looking into deploying a PFsense cluster using CARP depending on complexity (I dont want to bite off more than I can chew)

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