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

    Disabling Port Forward

    Scheduled Pinned Locked Moved NAT
    29 Posts 4 Posters 4.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.
    • denningsrogueD
      denningsrogue
      last edited by

      When I set up my pfSense device 2 years ago, I forwarded port 22 to my ssh server.  All has been working flawlessly since then.  I now want to disable the port forward.  I disabled (I did not remove) the forward and the associated rule, but port 22 still shows as open and I can still SSH into the server.  What am I missing?

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

        did you clear the state?

        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

        1 Reply Last reply Reply Quote 0
        • denningsrogueD
          denningsrogue
          last edited by

          Yes. Twice.

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

            ssh into the server from where??  The internet?  Post up your wan firewall rules and your port forwards.  Did you actually hit APPLY after you edited the rule and set it to disabled?  Enable it and then disable it again and this time make sure you hit apply on the port forward page.

            What pfsense are you using btw?

            So I have a port forward to my dvr..

            See it shows open.

            I then disable the rule, and it now is closed - did not have to do anything with the firewall - just disabled the port forward rule.

            ruleenabled.png
            ruleenabled.png_thumb
            disabled.png
            disabled.png_thumb
            disabledfromoutside.png
            disabledfromoutside.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.8, 24.11

            1 Reply Last reply Reply Quote 0
            • denningsrogueD
              denningsrogue
              last edited by

              First, thanks for taking the time to consider my issue.

              I am  using pfSense 2.1.5 and ssh'ing through the internet from my downtown office.

              When I ssh, I get the password prompt and can log in.  The reason I want to close the port is that I am being barraged by brute force attacks on my gateway.  Those are continuing.

              Thanks again.

              I'll post the rules and port forwards in follow up posts.

              1 Reply Last reply Reply Quote 0
              • denningsrogueD
                denningsrogue
                last edited by

                Here is the port forward page showing the forward disabled.

                ![Screen Shot 2014-10-17 at 09.36.04.png](/public/imported_attachments/1/Screen Shot 2014-10-17 at 09.36.04.png)
                ![Screen Shot 2014-10-17 at 09.36.04.png_thumb](/public/imported_attachments/1/Screen Shot 2014-10-17 at 09.36.04.png_thumb)

                1 Reply Last reply Reply Quote 0
                • denningsrogueD
                  denningsrogue
                  last edited by

                  Here is the port forward entry.

                  ![Screen Shot 2014-10-17 at 09.36.59.png](/public/imported_attachments/1/Screen Shot 2014-10-17 at 09.36.59.png)
                  ![Screen Shot 2014-10-17 at 09.36.59.png_thumb](/public/imported_attachments/1/Screen Shot 2014-10-17 at 09.36.59.png_thumb)

                  1 Reply Last reply Reply Quote 0
                  • denningsrogueD
                    denningsrogue
                    last edited by

                    Here are the rules.

                    ![Screen Shot 2014-10-17 at 09.37.20.png](/public/imported_attachments/1/Screen Shot 2014-10-17 at 09.37.20.png)
                    ![Screen Shot 2014-10-17 at 09.37.20.png_thumb](/public/imported_attachments/1/Screen Shot 2014-10-17 at 09.37.20.png_thumb)

                    1 Reply Last reply Reply Quote 0
                    • denningsrogueD
                      denningsrogue
                      last edited by

                      Here is the specific rule.

                      Thanks again for your help.

                      ![Screen Shot 2014-10-17 at 09.37.36.png](/public/imported_attachments/1/Screen Shot 2014-10-17 at 09.37.36.png)
                      ![Screen Shot 2014-10-17 at 09.37.36.png_thumb](/public/imported_attachments/1/Screen Shot 2014-10-17 at 09.37.36.png_thumb)

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

                        did you enable/disable it again..  What your saying is just not possible to be honest..

                        Can you post up your debug rules ones you disable the rule..  So I have a ssh rule that I keep disabled… I have enabled it and this is what is in my /tmp/rules.debug for port 22, I xx out some of my wan IP and isp gateway

                        [2.1.5-RELEASE][root@pfsense.local.lan]/root(3): cat /tmp/rules.debug | grep 22
                        rdr on vmx3f0 proto tcp from ! $pfBlockerTopSpammers to 24.13.xx.x port 22 -> 192.168.1.7
                        block in log quick proto tcp from <sshlockout>to (self) port 22 label "sshlockout"
                        pass in quick on vmx3f1 proto tcp from any to (vmx3f1) port { 80 22 } keep state label "anti-lockout rule"
                        pass  in log  quick  on $WAN reply-to ( vmx3f0 24.13.xx.xx ) inet proto tcp  from ! $pfBlockerTopSpammers to 192.168.1.7 port 22 flags S/SA keep state  label "USER_RULE: NAT "

                        So I then disabled it, leaving the firewall rule enabled still and then notice my rules.debug grep for 22

                        [2.1.5-RELEASE][root@pfsense.local.lan]/root(4): cat /tmp/rules.debug | grep 22
                        block in log quick proto tcp from <sshlockout>to (self) port 22 label "sshlockout"
                        pass in quick on vmx3f1 proto tcp from any to (vmx3f1) port { 80 22 } keep state label "anti-lockout rule"
                        pass  in log  quick  on $WAN reply-to ( vmx3f0 24.13.xx.xx ) inet proto tcp  from ! $pfBlockerTopSpammers to 192.168.1.7 port 22 flags S/SA keep state  label "USER_RULE: NAT "

                        Notice the forward is gone..

                        And if I check it from outside - blocked.  So lets take a look at your cat /tmp/rules.debug | grep 22

                        ssh.png
                        ssh.png_thumb
                        disabledssh.png
                        disabledssh.png_thumb
                        sshblocked.png
                        sshblocked.png_thumb</sshlockout></sshlockout>

                        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

                        1 Reply Last reply Reply Quote 0
                        • denningsrogueD
                          denningsrogue
                          last edited by

                          So here is what I have done.

                          enabled the ssh forward and rule
                          hit save
                          disabled the rule
                          hit save
                          reset the states table

                          here is the output from cat /tmp/rules.debug | grep 22

                          rdr on em0 proto tcp from any to 216.xxx.xxx.xxx port 22 -> $miniserver
                          block in log quick proto tcp from <sshlockout>to (self) port 22 label "sshlockout"
                          pass in quick on em1 proto tcp from any to (em1) port { 443 80 22 } keep state label "anti-lockout rule"</sshlockout>

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

                            so you disabled the port forward or just the firewall rule?

                            Because from your rules.debug the port forward is still there, but there is no firewall rule.

                            You should not be able to access in that way.. Do you have any firewall rules in your floating?  Something that is maybe allowing all and since you have the forward still it would be allowed?

                            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

                            1 Reply Last reply Reply Quote 0
                            • denningsrogueD
                              denningsrogue
                              last edited by

                              I disabled the rule but not the forward.

                              1 Reply Last reply Reply Quote 0
                              • denningsrogueD
                                denningsrogue
                                last edited by

                                Here is a screen shot showing all my rules (other than those related to pfblocker)

                                ![Screen Shot 2014-10-17 at 15.02.38.png](/public/imported_attachments/1/Screen Shot 2014-10-17 at 15.02.38.png)
                                ![Screen Shot 2014-10-17 at 15.02.38.png_thumb](/public/imported_attachments/1/Screen Shot 2014-10-17 at 15.02.38.png_thumb)

                                1 Reply Last reply Reply Quote 0
                                • denningsrogueD
                                  denningsrogue
                                  last edited by

                                  johnpoz

                                  I don't know what you mean by "Do you have any firewall rules in your floating?".

                                  1 Reply Last reply Reply Quote 0
                                  • denningsrogueD
                                    denningsrogue
                                    last edited by

                                    Well I've tried just about everything I can think of.  I deleted both the forward and the rule.  When I conduct a port scan against the public IP, port 22 still shows as open.  Any suggestions would be welcomed.

                                    1 Reply Last reply Reply Quote 0
                                    • denningsrogueD
                                      denningsrogue
                                      last edited by

                                      Is there something i can do from the command line?

                                      1 Reply Last reply Reply Quote 0
                                      • DerelictD
                                        Derelict LAYER 8 Netgate
                                        last edited by

                                        There's another rule somewhere passing that traffic.

                                        Chattanooga, Tennessee, USA
                                        A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                                        DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                                        Do Not Chat For Help! NO_WAN_EGRESS(TM)

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

                                          looking in  your floating tab – are there rules there. These are looked at first before any other rules on specific tabs.

                                          Post up your rules.debug file.  Seems to me your not even using pfsense to access this IP your sshing too.

                                          Sniff on your wan and lan interfaces when you do this access - you actually see this traffic passthru pfsense?  You actually see a state for this connection?

                                          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

                                          1 Reply Last reply Reply Quote 0
                                          • denningsrogueD
                                            denningsrogue
                                            last edited by

                                            No floating rules. Here's a screen shot of the tab.

                                            [Screen Shot 2014-10-18 at 06.36.56.png](/public/imported_attachments/1/Screen Shot 2014-10-18 at 06.36.56.png)

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