Blocking inter vlan traffic blocks access to website



  • Hi,

    I have 4 vlans, only 2 of which are in question in this situation. I have a guest vlan (vlan 200) and a server vlan (vlan 306).

    By nature I want to block guest vlan access to the server vlan. However, there are websites hosted on the server vlan that users of the guest vlan may need access to. The websites are port forwarded and accessible via the wan. However, when I reject access from the guest vlan to server vlan, users on guest vlan cannot access the websites. This doesnt make sense to me because the website is accessible via the wan and dns records are on a public dns server. The traffic to access the websites shouldnt be going through the vlans, but through the wan. This is making me pull my hair out.



  • Netgate

    You have to pass traffic to the private addresses and ports you want passed before blocking access to the server VLAN on the firewall rules on the GUEST interface.

    NAT happens before firewall rules are checked.

    So if your web server is 192.168.1.100 ports 80 and 443 you would do something like this on the GUEST interface:

    pass tcp source GUEST net dest 192.168.1.100 port 80
    pass tcp source GUEST net dest 192.168.1.100 port 443
    reject any source GUEST net dest SERVER net

    As a trailer I would also say it would be better to pass traffic to "this firewall" that they need access to (like DNS) then block everything else to "this firewall" instead of just blocking the management ports.

    That way things can change (like changing the webgui port) and you are still secure without having to remember to change that alias.



  • As a pretty advanced admin, I must say, that is a pretty simple fix and almost seemed too obvious so I didn’t bother trying it before. Oops.

    In regards to blocking traffic to the firewall, clients only need it for captive portal- not even dns. So I’ll reject all traffic to if except for the portal

    Thanks and Merry Christmas



  • I found that this only works when you then allow traffic:

    GUEST net -> SERVER net    80
    GUEST net -> SERVER net    443
    GUEST net -> SERVER net    8443

    It doesnt work for me using a single ip of the host. Especially because unifi uses 8443, I would like to allow 8443 just to unifi instead of the entire vlan but it still rejects it using aliases?


  • Netgate

    If it works with SERVER Net and not specific addresses I would posit you are using the wrong addresses.

    You might want to post the actual port forwards and firewall rules. Should only be necessary to post the GUEST rules.

    Configure it to something you think should work but doesn't and post that.



  • I added an alias for "exchange". It is only resolvable by internal dns. Pfsense is pointed to the internal dns servers.







  • Netgate

    Does Diagnostics > Tables look sane when you examine the exchange table?

    Is the DNS answer the public WAN address or the inside address?

    What does the port forward on WAN look like?



  • exchg1.ds.smith114.com is resolvable to the 10.3.20.x local address by ALL machines on the network when no restricting firewall rules are present.

    Pfsense cannot resolve that address for some reason. It is pointed to the dns servers holding the record for exchg1

    I assume the firewall is using itself as dns before the other servers. This is probably the issue but I am not sure how to fix it.

    I also assume I can enter the ip of the server instead of the local fqdn, but I prefer to do it with dns (if it will work)



  • Netgate

    Well, yeah. There's your problem.

    What DNS servers do you want pfSense itself to use to resolve names?

    Do any clients rely on pfSense for DNS server functionality?



  • No clients use pfsense for dns

    The servers I use are listed in one of the above screenshots but 127.0.0.1 is listed before them


  • Netgate

    If you do not need any DNS services on pfSense:

    Set the DNS servers you want pfSense itself to use in System > General

    Make sure DNS server override is unchecked

    Check Disable DNS Forwarder (removes 127.0.0.1 from the list of nameservers)

    Disable both DNS Forwarder and DNS Resolver in Services.



  • Perfect