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

Isolated network with Internet access only, but NAT from outside

Scheduled Pinned Locked Moved Firewalling
10 Posts 3 Posters 1.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.
  • M
    Mister.Deeds
    last edited by May 29, 2023, 6:49 PM

    Dear all

    I would like to isolate two networks so that they only have Internet access. Currently I have solved it with a simple REJECT rule, which denies access to all internal networks.

    7056e517-31ad-4df1-81f4-820588ac7fdc-image.png

    afcce7dc-ff2b-4f62-a26e-bf58ca06ede8-image.png

    Now, from these two networks also the services of the DMZ should be reached. The networks use public DNS servers, thus receive the public IP of the domain. This is also resolved correctly.

    I have chosen the NAT settings as follows:

    3bae63c6-b347-4f3d-ace1-3ab7a417e077-image.png

    However, the clients in these networks cannot establish a connection. It is not clear to me why, since they go out via the Internet and should come back in like the Internet and NAT.

    Does anyone have any idea how I need to set this up correctly?

    Thank you and best regards

    V 1 Reply Last reply May 29, 2023, 7:10 PM Reply Quote 0
    • V
      viragomann @Mister.Deeds
      last edited by May 29, 2023, 7:10 PM

      @MisterDeeds-0
      I'd not expect to see the rules for both source networks on one rule tab.
      It makes no sense having a rule with another source subnet on an interface.
      Hint: select 'any' as source in block / reject rules. There is no need to limit it, as long as you don't have multiple subnets on this interface.

      Consider that with NAT reflection the real destination might be the internal address of the server.

      M 1 Reply Last reply May 29, 2023, 8:07 PM Reply Quote 0
      • M
        Mister.Deeds @viragomann
        last edited by May 29, 2023, 8:07 PM

        Dear @viragomann

        Thank you for the answer. The reason why both source networks are on one rule is that I created a Interface Group for all of my interfaces. So I can map all the rules on one page and I have a good overview.

        c46a34c4-9dda-467c-9b9d-030e7430aa08-image.png

        fd151c7b-f8e1-444f-a6d3-95b52fcee174-image.png

        The domain is resolved correctly by the client with the public IP.

        da2fedfd-fd93-4ec8-bf40-c6f1209b5d64-image.png

        I have the NAT reflection because I have both an internal DNS zone and an external zone with the same domainname.

        Is there a better solution so that I can isolate the networks and they can still access the services?

        thank you and best regards

        J 1 Reply Last reply May 29, 2023, 8:23 PM Reply Quote 0
        • J
          johnpoz LAYER 8 Global Moderator @Mister.Deeds
          last edited by May 29, 2023, 8:23 PM

          @MisterDeeds-0 yeah let your internal resolve the internal IP..

          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

          M 1 Reply Last reply May 30, 2023, 4:54 AM Reply Quote 0
          • M
            Mister.Deeds @johnpoz
            last edited by May 30, 2023, 4:54 AM

            Dear @johnpoz

            Thanks for the answer. I have now changed the DNS to the internal one, as well as left the NAT reflection on. However, it is not clear to me what difference this makes. I still don't want to have to open more ports from these networks. I want the clients to go to the Internet and connect back via the WAN interface.

            Thanks and BR

            V J 2 Replies Last reply May 30, 2023, 6:44 AM Reply Quote 0
            • V
              viragomann @Mister.Deeds
              last edited by May 30, 2023, 6:44 AM

              @Mister-Deeds
              Did you add a rule to permit the access to the internal IP?
              You have to add this to the top of the interface group tab above of the reject rules, since if group rules have priority over member if rules.

              1 Reply Last reply Reply Quote 0
              • J
                johnpoz LAYER 8 Global Moderator @Mister.Deeds
                last edited by May 30, 2023, 10:26 AM

                @Mister-Deeds said in Isolated network with Internet access only, but NAT from outside:

                it is not clear to me what difference this makes

                Your not hairpining your connections for one.. No offense but those rules are horrible - you can not not look at that those rules and have any clue to what exactly is allowed or not..

                You should write explicit rules that say exactly what they do.. Non secure nets can not go to secure nets - well no shit.. What the default deny does anyway..

                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

                M 1 Reply Last reply May 30, 2023, 2:51 PM Reply Quote 0
                • M
                  Mister.Deeds @johnpoz
                  last edited by May 30, 2023, 2:51 PM

                  Dear @viragomann
                  Dear @johnpoz

                  Thanks for the answers!

                  No worries, I dont perceive that as an offense :) For me it is clear and so far everything works.

                  The only thing that doesn't work for me is that I can access the services I have published via NAT via these two networks.

                  If I resolve the DNS with the external IP, the client would have to re-enter the network via the WAN interface of the firewall using NAT? Then this should be treated like an external client or not?

                  Internally there should be no connection from these networks to other networks on the firewall. Therefore I want the domain to be resolved by an external DNS and the clients from this network can only access the domain via WAN.

                  3c6af313-1e41-4ed1-8142-8d8013746ad8-image.png

                  that should be possible, right?

                  V 1 Reply Last reply May 30, 2023, 6:28 PM Reply Quote 0
                  • V
                    viragomann @Mister.Deeds
                    last edited by May 30, 2023, 6:28 PM

                    @Mister-Deeds said in Isolated network with Internet access only, but NAT from outside:

                    The only thing that doesn't work for me is that I can access the services I have published via NAT via these two networks.
                    If I resolve the DNS with the external IP, the client would have to re-enter the network via the WAN interface of the firewall using NAT? Then this should be treated like an external client or not?

                    No, it doesn't behave this way in fact.

                    If the packets would go out on WAN and re-enter, what should be the source and destination IPs? The WAN for both? No go.

                    NAT reflection means, that the NAT rule on WAN is also applied to the other internal interfaces, but not shown up in the rule set though.

                    This means, after the packet enters pfSense the destination address is translated to the redirect target IP. According to Ordering of NAT and Firewall Processing after this firewall rules are probed on the packet.
                    Hence the pf sees the origin client IP and the internal redirect target IP.

                    So the pass rule on the incoming interface has to match these internal IPs.

                    So this statement is not solid:

                    Internally there should be no connection from these networks to other networks on the firewall.

                    because the traffic initialized by your NAT reflection rules is an internal one.

                    So again, without allowing it, the NAT reflection will fail.

                    BTW: the "Enable automatic outbound NAT for Reflection" option, which you've checked, effects that the packets are masqueraded with the pfSense interface IP. So the destination device sees the packets coming from pfSense rather than the origin client.
                    This is basically only needed if client and server are within the same network segment to avoid asymmetric routing.

                    M 1 Reply Last reply May 31, 2023, 2:20 PM Reply Quote 0
                    • M
                      Mister.Deeds @viragomann
                      last edited by May 31, 2023, 2:20 PM

                      Dear @viragomann

                      Thank you so much for taking the time to explore this in detail!

                      I have now done it in the simplest and for me most logical way. I allow only DNS, HTTP and HTTPS, but this in all networks

                      a831a9ec-f2da-4de5-9b3d-fbbe2d4eca28-image.png

                      So it's secure enough for me and yet, the networks can access my webservices.

                      Thanks for the help and explanations!

                      Best regards

                      1 Reply Last reply Reply Quote 0
                      1 out of 10
                      • First post
                        1/10
                        Last post
                      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                        This community forum collects and processes your personal information.
                        consent.not_received