Navigation

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

    SG-3100 - NAT rule for single Public IP

    Official Netgate® Hardware
    4
    8
    103
    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.
    • S
      Spearhead1 last edited by

      Hello, I am attempting to create a NAT/Forward rule to send SFTP traffic on port 22 to an internal IP address. I have successfully tested from a handful of different devices that the NAT rule works and now I want to limit it to 5 specific public IPs that should be able to access this server. Since the public IPs are not part of a single subnet I assume I have to create 5 NAT entries but I am not having a lot of success.

      For our use case the public IP is 144.161.111.111 and the translation rule would be to 192.168.2.10

      What seems to be the proper rule setup firewall>NAT >Add

      Source > Advanced > Single Host 144.161.111.111
      Destination > Wan Net
      All port details are listed as port 22
      Redirect Target IP > 192.168.2.10

      Everything else is default value

      When I follow this process the server is not accessible. Any guidance would be greatly appreciated since I'm experiencing a flood of bots trying to brute force my server.

      Thanks all!

      Peter

      T stephenw10 2 Replies Last reply Reply Quote 0
      • S
        serbus last edited by serbus

        Hello!

        You can browse to Firewall -> Aliases -> IP and Add an alias that contains your public addresses. Use the new alias as the Source -> Advanced -> Single host or Alias entry.
        Check your Destination and maybe use WAN Address instead of WAN Net (?).

        John

        S 1 Reply Last reply Reply Quote 1
        • S
          Spearhead1 @serbus last edited by

          @serbus thank you for the advice on the alias, that is helpful. Unfortunately the rule continues to block traffic. I can see the IP being blocked in my firewall logs. The only way I continue to get this to work is with an Any to Any rule. Really strange.

          1 Reply Last reply Reply Quote 0
          • S
            serbus last edited by

            Hello!

            Verify that your alias was created correctly by browsing to Diagnostics -> Tables and selecting the alias name from the dropdown.

            John

            1 Reply Last reply Reply Quote 1
            • T
              teamits @Spearhead1 last edited by

              Are you having the NAT rule create a linked firewall rule that allows traffic to 192.168.2.10:22? That should be the default.

              I think the destination for the NAT should be WAN Address not WAN Net.

              S 1 Reply Last reply Reply Quote 0
              • stephenw10
                stephenw10 Netgate Administrator @Spearhead1 last edited by

                @spearhead1 said in SG-3100 - NAT rule for single Public IP:

                All port details are listed as port 22

                If you set the source port to 22 also that's incorrect. It should be left as 'any' as it will be a random port.

                Steve

                S 1 Reply Last reply Reply Quote 1
                • S
                  Spearhead1 @stephenw10 last edited by

                  @stephenw10 this is it! I totally forgot the source ports are randomized and as soon as I moved that back to any it worked. I really appreciate it!

                  1 Reply Last reply Reply Quote 1
                  • S
                    Spearhead1 @teamits last edited by

                    @teamits said in SG-3100 - NAT rule for single Public IP:

                    Are you having the NAT rule create a linked firewall rule that allows traffic to 192.168.2.10:22? That should be the default.

                    confirmed, this was working automatically. Figured out it was the source port needing to be "any". Thanks!

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post

                    Products

                    • Platform Overview
                    • TNSR
                    • pfSense Plus
                    • Appliances

                    Services

                    • Training
                    • Professional Services

                    Support

                    • Subscription Plans
                    • Contact Support
                    • Product Lifecycle
                    • Documentation

                    News

                    • Media Coverage
                    • Press
                    • Events

                    Resources

                    • Blog
                    • FAQ
                    • Find a Partner
                    • Resource Library
                    • Security Information

                    Company

                    • About Us
                    • Careers
                    • Partners
                    • Contact Us
                    • Legal
                    Our Mission

                    We provide leading-edge network security at a fair price - regardless of organizational size or network sophistication. We believe that an open-source security model offers disruptive pricing along with the agility required to quickly address emerging threats.

                    Subscribe to our Newsletter

                    Product information, software announcements, and special offers. See our newsletter archive to sign up for future newsletters and to read past announcements.

                    © 2021 Rubicon Communications, LLC | Privacy Policy