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

    Setting up a VLAN with pfSense, Ubiquiti, and ESXi

    Scheduled Pinned Locked Moved L2/Switching/VLANs
    66 Posts 5 Posters 10.4k 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.
    • P
      pfSenseUser78 @marvosa
      last edited by pfSenseUser78

      @marvosa SSH is enabled. I created the port alias but I can't figure out how to apply that to the second firewall rule. It doesn't appear in the list of ports to block.

      Edit: Found it here: https://docs.netgate.com/pfsense/en/latest/book/firewall/aliases.html

      Testing now!

      M 1 Reply Last reply Reply Quote 0
      • M
        marvosa @pfSenseUser78
        last edited by

        @pfSenseUser78 The last rule should be

        Protocol = any
        Source = VL90_IOT net
        Destination = Invert match rfc1918 alias

        P DerelictD 2 Replies Last reply Reply Quote 0
        • P
          pfSenseUser78 @marvosa
          last edited by

          @marvosa Fixed.

          When I join that network with my laptop I connect and get an IP. I cannot ping 8.8.8.8 or 1.0.0.1 nor can I ping the internal DNS servers (172.16.x.x). If I try to load a website nothing happens.

          Not sure where I'm going wrong - is there anything else I can post that might help? I'll continue to google and see if I can find anything myself.

          M 1 Reply Last reply Reply Quote 0
          • M
            marvosa @pfSenseUser78
            last edited by

            @pfSenseUser78 Port your new rules.

            P 1 Reply Last reply Reply Quote 0
            • P
              pfSenseUser78 @marvosa
              last edited by pfSenseUser78

              @marvosa

              Firewall 55.png

              "InternalDNS" is the IP addresses of the two internal IP addresses (172.16.x.x) - devices on VLAN90 are assigned a 192.168.90.x IP address
              "pfSenseAccess" is ports 20 and 80
              "rfc1918" is 10.0.0.0/8, 172.16.0.0., 192.168.0.0/16

              M 1 Reply Last reply Reply Quote 0
              • M
                marvosa @pfSenseUser78
                last edited by marvosa

                • @pfSenseUser78 You left off the mask on the 2nd range in your alias, but I'm guessing it was just a typo... as your rfc1918 alias should have 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0.16. Can you post a screenshot of your alias?

                • You are unable to ping your DNS server's because the DNS rule is only allowing TCP/UDP traffic destined to your DNS servers on port 53.

                • After re-examining your DNS rule, the source port should be any. Remove that 53.

                Things should start working after that.

                P 2 Replies Last reply Reply Quote 0
                • DerelictD
                  Derelict LAYER 8 Netgate @marvosa
                  last edited by

                  @marvosa said in Setting up a VLAN with pfSense, Ubiquiti, and ESXi:

                  Destination = Invert match rfc1918 alias

                  Awesome.

                  Try blocking to RFC1918 and then passing to any.

                  P 1 Reply Last reply Reply Quote 0
                  • P
                    pfSenseUser78 @marvosa
                    last edited by

                    @marvosa

                    BEFORE:
                    Alias Before.png

                    AFTER:
                    Alias After.png

                    RULES:
                    Rules.png

                    Testing now.

                    1 Reply Last reply Reply Quote 0
                    • P
                      pfSenseUser78 @marvosa
                      last edited by

                      @marvosa

                      Didn't work; I can't get any website to load. NSLookup returns an error.

                      I have several LAN firewall rules that prevent DNS from anything other than my two internal DNS servers (that, now that I know about aliases can be condensed but that's a project for another time) - could this be causing issues?

                      Thanks

                      M 1 Reply Last reply Reply Quote 0
                      • P
                        pfSenseUser78 @Derelict
                        last edited by

                        @Derelict Isn't that what I'm doing in the third rule (in one rule)?

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

                          Do not block traffic with pass rules. Block the traffic you want to block then pass anything else. For reasons. Either take my advice or don't. Plenty of smart people disagree with me. I despise the practice.

                          In your configuration, however, if all of these conditions are true:

                          1. The VL90_IOT clients have their DNS servers set to only 172.16.249.138 and 172.16.249.139
                          2. 172.16.249.0/24 is another interface on the firewall
                          3. The DNS servers have the pfSense address on that interface as their default gateway
                          4. The DNS servers at 172.16.249.138 and 172.16.249.139 can resolve names from the internet

                          Then the DNS servers are broken. Perhaps they themselves have a firewall or DNS server policy or configuration prohibiting them from resolving names from VL90_IOT.

                          From a host on VL90_IOT what is the output of this command:

                          dig @172.16.249.138 www.google.com

                          If you don't have dig, get it.

                          johnpozJ P 2 Replies Last reply Reply Quote 0
                          • M
                            marvosa @pfSenseUser78
                            last edited by

                            @pfSenseUser78 Ok, so the rfc1918 alias got fixed. Although, it raises the question of how the mask was left off in the first place as the system automatically adds the mask if the type is set to Network(s).

                            The next issue to address is DNS. If you notice, there are no hits on your DNS rule, so we need to figure out where your queries are going.

                            • Assuming there are no typos in your InternalDNS alias, re-verify your clients are using 172.16.249.138 and 172.16.249.139 for DNS.

                            • On your InternalDNS alias, I would change the type to Host(s) instead of Network(s). It should work out the same, but at this point, you never know.

                            • Do you have Squid or anything else configured that may be intercepting DNS queries?

                            • Do your browsers have DNS-over-HTTPS enabled?

                            • What firewall events are you seeing during your testing?

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

                              @pfSenseUser78 said in Setting up a VLAN with pfSense, Ubiquiti, and ESXi:

                              Didn't work; I can't get any website to load. NSLookup returns an error.

                              WHAT error?

                              Do the hosts at least get a DHCP lease?

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

                                @Derelict said in Setting up a VLAN with pfSense, Ubiquiti, and ESXi:

                                Block the traffic you want to block then pass anything else.

                                While I think I am one of the ones that he is talking about disagreeing - we have had many discussions over the years about this practice ;)

                                While I believe you can do the ! network as an allow rule... It is more complex setup for sure, and if your unsure of everything that is going on, and understand how a vip might cause you grief here, etc. etc. It can end up being an issue.. And it is easier to make a mistake with..

                                So I do agree with @Derelict that explicit block(s), then allow any is the cleaner, easier to understand and less prone to issues method.. If you are having any sort of issues at all with your rules - this is the method you should utilize to get the rules working how you want..

                                I have removed my use of the ! rfc1918 rules and have adopted the explicit reject rfc1918 above my any as cleaner method.

                                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
                                • DerelictD
                                  Derelict LAYER 8 Netgate
                                  last edited by

                                  @johnpoz said in Setting up a VLAN with pfSense, Ubiquiti, and ESXi:

                                  I have removed my use of the ! rfc1918 rules and have adopted the explicit reject rfc1918 above my any as cleaner method.

                                  If it saves a single rule set it's worth it. 🎊

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

                                    This post is deleted!
                                    1 Reply Last reply Reply Quote 0
                                    • P
                                      pfSenseUser78 @Derelict
                                      last edited by pfSenseUser78

                                      @Derelict

                                      I'd like to take your advice as you absolutely sound like you know what you're doing. What do I need to change (nothing has changed yet from the above screenshots)?

                                      The DNS servers I'm attempting to use to do not have a firewall enabled that I know of. I do not know how they would have any configuration that prevents them from answering queries from the VLAN. They both work fine for any and all clients on the LAN.

                                      Here's the output of dig:

                                      dig @172.16.249.138 www.google.com
                                      
                                      ; <<>> DiG 9.11.3-1ubuntu1.11-Ubuntu <<>> @172.16.249.138 www.google.com
                                      ; (1 server found)
                                      ;; global options: +cmd
                                      ;; Got answer:
                                      ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 5224
                                      ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
                                      
                                      ;; OPT PSEUDOSECTION:
                                      ; EDNS: version: 0, flags:; udp: 4096
                                      ;; QUESTION SECTION:
                                      ;www.google.com.			IN	A
                                      
                                      ;; ANSWER SECTION:
                                      www.google.com.		220	IN	A	172.217.11.36
                                      
                                      ;; Query time: 11 msec
                                      ;; SERVER: 172.16.249.138#53(172.16.249.138)
                                      ;; WHEN: Sat Dec 14 16:33:46 EST 2019
                                      ;; MSG SIZE  rcvd: 59
                                      

                                      And NSLookup:

                                      nslookup www.google.com
                                      Server:		127.0.0.53
                                      Address:	127.0.0.53#53
                                      
                                      ** server can't find www.google.com: SERVFAIL
                                      

                                      Devices DO get an IP address successfully in the 192.168.90.x range (which was setup for the VLAN). From the VLAN I can ping 8.8.8.8.

                                      Please let me know any other information you need and thank you for your time and patience. Much appreciated.

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

                                        Why would would nslookup be using 127.0.0.53???

                                        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

                                        P 1 Reply Last reply Reply Quote 0
                                        • P
                                          pfSenseUser78 @johnpoz
                                          last edited by

                                          @johnpoz This is from a mint laptop joined to the VLAN90. Here's the output when joined to the LAN:

                                           nslookup www.google.com
                                          Server:		127.0.0.53
                                          Address:	127.0.0.53#53
                                          
                                          Non-authoritative answer:
                                          Name:	www.google.com
                                          Address: 172.217.6.196
                                          Name:	www.google.com
                                          Address: 2607:f8b0:4006:818::2004
                                          
                                          
                                          
                                          1 Reply Last reply Reply Quote 0
                                          • DerelictD
                                            Derelict LAYER 8 Netgate
                                            last edited by Derelict

                                            The way you have your rules set you need to set your clients to use 172.16.249.138 and 172.16.249.139 to resolve DNS. Based on the dig output that works fine. Figure out how to make that happen and stop trying to use what looks to me like unbound on the client (just a guess) and it will work fine.

                                            127.0.0.53 is not 172.16.249.138 and 172.16.249.139

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