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

    isolated VLAN Internet access

    Scheduled Pinned Locked Moved Firewalling
    17 Posts 6 Posters 675 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.
    • S
      Stingo
      last edited by

      Hi all. I am new to PFSense and while I have been learning a lot, despite reading a lot of posts on the forum, I still am not solving what should be an easy problem.

      I have set up and have the following working: blockerng, snort, and avahi.

      I have LAN, VLAN1 and VLAN2.

      The vlans have internet access with only vlan to everywhere rule. IPV4/VLAN1 address///*

      If I replace the allow vlan1 to anywhere rule with the following in order to block vlan to vlan and lan communications I lose internet access.
      allow IPV4/VLAN1 address//VLAN1 address/
      allow IPV4/VLAN1 address//!private_networks/

      The DHC server shows that each lan/vlan has a dns server at .1 address of its subnet so I am not sure what is wrong.

      I tried IPV4/TCP-UDP/vlan1/*/127.0.0.1[DNS server address according to dashboard]/DNS which I read on a post but that did not work.

      Any help is appreciated.

      1 Reply Last reply Reply Quote 0
      • AndyRHA
        AndyRH
        last edited by

        If you post pictures of the rules, it is easier to read.
        What is in the alias private_networks? Is this a listing of the RFC1918 addresses?

        o||||o
        7100-1u

        S 1 Reply Last reply Reply Quote 0
        • S
          Stingo @AndyRH
          last edited by

          @AndyRH thanks for your response. Here are images. I changed the local network definition name but otherwise the same.

          Screenshot 2024-09-08 at 7.02.21 PM.png

          Screenshot 2024-09-08 at 7.05.14 PM.png

          That last rule should not be necessary if the next to the last rule is doing it job. If I get rid of the next to the last rule I get internet access.

          1 Reply Last reply Reply Quote 0
          • AndyRHA
            AndyRH
            last edited by

            Your allow any rule should be subnet not address.
            The 3rd rule says no to the alias, it does not say yes to the internet, as it should be. Also, I think it should be subnet, not address.
            The 4th rule is needed.
            Others will have better help and possibly correct me.

            o||||o
            7100-1u

            J 1 Reply Last reply Reply Quote 1
            • J
              Jarhead @AndyRH
              last edited by Jarhead

              Actually all of them should be subnet, not address as source.
              The XXX address is just the interface address itself, meaning in your case, 192.168.1.254. Nothing else. The XXX subnet would be all addresses in that subnet.
              Allowing IOTVLAN Address to 192.168.1.254 is allowing it to itself. Useless.
              Change the source to IOTVLAN subnet on all rules.

              Your second rule does the same as the first rule, plus allows anything else to the interface. So delete the second rule. The first rule is also not needed to block access to other subnets, the allow all at the bottom will allow DNS if it's not blocked before it.
              The 3rd rule would be better to block the IOTVLAN subnet to "ALIAS" and make the ALIAS all rfc1918 addresses. That way if you add another subnet with a 10.0.1.0/24 network, it would also already be blocked by the alias. No need to do any editing for the new network.
              The 4th rule will then allow anything else not already blocked, including internet access.

              So if all you want to do is block access to other local subnets, but still allow all the the internet, you only need 2 rules. Block rfc1918, and allow all.

              S 1 Reply Last reply Reply Quote 1
              • S
                Stingo @Jarhead
                last edited by

                @Jarhead and @AndyRH you guys are great. That solved the problem. Thank you to taking the time on a weekend. All the best.

                S 1 Reply Last reply Reply Quote 0
                • S
                  Stingo @Stingo
                  last edited by

                  @AndyRH and @Jarhead unfortunately I spoke too soon.

                  This is still not letting me get internet access. Rule 1 is to keep local access once the RFC block is in place.

                  I cannot connect to the internet with rule 2 in place.

                  Screenshot 2024-09-08 at 9.23.59 PM.png

                  Screenshot 2024-09-08 at 9.21.28 PM.png

                  J 1 Reply Last reply Reply Quote 0
                  • J
                    Jarhead @Stingo
                    last edited by

                    @Stingo Sorry, I mis-spoke in the previous post. You'll need to add the allow DNS Before the block rule. The RFC Alias includes the interface address on each subnet, so that gets blocked also.
                    What's the point of the first rule?

                    Bob.DigB S 2 Replies Last reply Reply Quote 0
                    • Bob.DigB
                      Bob.Dig LAYER 8 @Jarhead
                      last edited by Bob.Dig

                      @Jarhead said in isolated VLAN Internet access:

                      What's the point of the first rule?

                      While it is not good, it should allow for local DNS, don't you think? It is clearly doing something. 🤓

                      1 Reply Last reply Reply Quote 0
                      • the otherT
                        the other
                        last edited by

                        How's your setup?
                        Pfsense and modem?
                        Pfsense behind another router?
                        Double NAT?

                        the other

                        pure amateur home user, no business or professional background
                        please excuse poor english skills and typpoz :)

                        1 Reply Last reply Reply Quote 0
                        • S
                          Stingo @Jarhead
                          last edited by

                          @Jarhead what should the DNS rule look like? I want to be sure I get it right.

                          The purpose of the first rule is to allow intra vlan communication since the second rule is blocking all the subnets including subnet that the VLAN is on. The first tule allows instructions within the subnet.

                          My old rule created an alias for the lan and vlan subnets and then gave access to everything but not the vlan subnets. (with the inverted button I understood that !private_nets = let all through except private nets.). That was supposed to replace the all open rule but whenever it was active I lost internet on the vlan.

                          @the-other nothing fancy. Just PFsense router and TPLink switch. Most of the vlan clients are wireless over a TPlink AP. The vlan works fine until I block the other subnets and the lan in particular. It is almost as if the subnet is getting DNS from the lan. I thought DNS was supposed to be connected through 192.168.20.1 but I obviously am still too uninformed on the mysteries of networking. :-)

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

                            @Stingo said in isolated VLAN Internet access:

                            The purpose of the first rule is to allow intra vlan communication

                            pfsense is not involved in communication between devices on the same network.

                            That rule should really allow clients to access dns on pfsense IP on that vlan though - but if your clients are pointing to a IP for dns that is on another network of pfsense your block rfc1918 rule would prevent that.

                            Here is example locked down rules for an interface that might be helpful

                            lockdown.jpg

                            The rules description say what the rule does.

                            The block rule there to pfsense IPs "this firewall" prevents say access to the pfsense web gui on the public wan IP, which would be allowed by the last rule that is any any to allow internet access.

                            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

                            S 1 Reply Last reply Reply Quote 0
                            • S
                              Stingo @johnpoz
                              last edited by

                              @johnpoz This is extremely helpful. Thank you very much.

                              I understood that if I tell the firewall on VLAN20 "dont allow any calls to these private subnets" and the private subnets include the VLAN20 subnet then I need a rule allowing the VLAN20 subnet to the the VLAN20 subnet first. Then again I am just trying to dig through a ton of of stuff online to get to the gold. :-)

                              Netgate has good notes but they could be better.

                              Thanks again.

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

                                @Stingo yeah if you block all rfc1918 it would block access to pfsense IP address that is rfc1918.. So yeah you need rule(s) above the block rfc1918 rule that allows access to pfsense address for say dns.

                                Rules are evaluated top down, first rule to trigger wins, no other rules are evaluated.. So while yes your rule there on top should allow access to pfsense IP on that vlan.. It a bit overboard for allowing access to 1 IP, the rule should just be to pfsense address.

                                But your saying that rule isn't even working? Which would make no sense unless your clients were talking to some other IP on pfsense or another network for dns?

                                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

                                S 1 Reply Last reply Reply Quote 1
                                • S
                                  Stingo @johnpoz
                                  last edited by

                                  @johnpoz the rules that you shared above worked fantastically. I think the problem was in the rules that I did not have for NTP or DNS. I hope you know you probably helped prevent a divorce or a murder since I put my wife on a separate vlan so she had lost internet connection. She was getting damn scary.

                                  One question since I am trying to learn. Why the ping rule? Why does the vlan need to ping echoreq the vlan address?

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

                                    @Stingo its there for ability to test.. if wanted to actually make sure you could talk to pfsense.. Not something you need, but I like to be able to validate I can actually talk to my router/dns etc..

                                    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

                                    S 1 Reply Last reply Reply Quote 1
                                    • S
                                      Stingo @johnpoz
                                      last edited by

                                      @johnpoz good idea. I think I'll keep the rule. Thanks again. Most of the fun so far has been learning with PFSense. I just wish there were clearer guides out there.

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