Vlan isolation



  • I've got a bunch of VLANS set up that are trunked into pfSense from an SG300 Switch.

    I want to keep VLAN 10, VLAN 30, VLAN 50, VLAN 60 isolated so they can only access the internet.

    Is there a better solution than creating Aliases for Each VLAN that include the networks of all the other VLANS
    (which is error prone and something could get forgotten if VLANs are added/removed) and then adding a BLOCK
    OUTGOING firewall rule to each interface that uses the block list to block all other VLANs?

    Is this the right/best approach? (See METHOD 1 Below)

    Since all VLANs are in the 192.168.0.0/16 space is there a better way to do this? (Something like METHOD 2 below)

    How would restrictive firewall rules be integrated into this method?

    If I just had a LAN, I would likely have something like:
    ALLOW SSH (With allowed hosts alias), HTTP, HTTPS, IMAP (with allowed hosts alias)
    and rely on the default block to catch anything else that shouldn't be going out.
    If I understand things correctly ALLOW VLANxx/Address would match and bypass
    the rest of the rules.  Am I correct?

    I've done a lot of Google searches, but the complexity of the extra VLANs isn't discussed or not very detailed.

    Any assistance would be much appreciated.

    METHOD 1-USING ALIASES```
    ISOLATE10
    192.168.20.1/24
    192.168.30.1/24
    192.168.40.1/24
    192.168.50.1/24
    192.168.60.1/24

    ISOLATE30
    192.168.10.1/24
    192.168.20.1/24
    192.168.40.1/24
    192.168.50.1/24
    192.168.60.1/24

    ISOLATE50
    192.168.10.1/24
    192.168.20.1/24
    192.168.30.1/24
    192.168.40.1/24
    192.168.60.1/24

    ISOLATE60
    192.168.10.1/24
    192.168.20.1/24
    192.168.30.1/24
    192.168.40.1/24
    192.168.50.1/24

    
    **BLOCK OUTGOING firewall rules:** (Not using/Don't really want IPv6, that's why block rules include it, but pass rules don't)```
    Firewall / Rules / VLAN10
    	Protocol	Source	Port	Destination	Port	Description
    BLOCK	IPv4+6 *	*	*	ISOLATE10	*	Block Access to other VLANS
    (Balance of Allow/Block Firewall rules for this interface)
    
    Firewall / Rules / VLAN30
    	Protocol	Source	Port	Destination	Port	Description
    BLOCK	IPv4+6 *	*	*	ISOLATE30	*	Block Access to other VLANS
    (Balance of Allow/Block Firewall rules for this interface)
    
    Firewall / Rules / VLAN50
    	Protocol	Source	Port	Destination	Port	Description
    BLOCK	IPv4+6 *	*	*	ISOLATE50	*	Block Access to other VLANS
    (Balance of Allow/Block Firewall rules for this interface)
    
    Firewall / Rules / VLAN60
    	Protocol	Source	Port	Destination	Port	Description
    BLOCK	IPv4+6 *	*	*	ISOLATE60	*	Block Access to other VLANS
    (Balance of Allow/Block Firewall rules for this interface)
    

    METHOD 2-Block 192.168.0.0/16 and Allow VLANxx/Address```
    Firewall / Rules / VLAN10
    Protocol Source Port Destination Port Description
    ALLOW IPv4  * * * VLAN10/Address * Allow Access to Internet
    BLOCK IPv4+6 * * * 192.168.0.0/16 * Block Access to other VLANS
    (Balance of Allow/Block Firewall rules for this interface)

    Firewall / Rules / VLAN30
    Protocol Source Port Destination Port Description
    ALLOW IPv4  * * * VLAN30/Address * Allow Access to Internet
    BLOCK IPv4+6 * * * 192.168.0.0/16 * Block Access to other VLANS
    (Balance of Allow/Block Firewall rules for this interface)

    Firewall / Rules / VLAN50
    Protocol Source Port Destination Port Description
    ALLOW IPv4  * * * VLAN50/Address * Allow Access to Internet
    BLOCK IPv4+6 * * * 192.168.0.0/16 * Block Access to other VLANS
    (Balance of Allow/Block Firewall rules for this interface)

    Firewall / Rules / VLAN60
    Protocol Source Port Destination Port Description
    ALLOW IPv4  * * * VLAN60/Address * Allow Access to Internet
    BLOCK IPv4+6 * * * 192.168.0.0/16 * Block Access to other VLANS
    (Balance of Allow/Block Firewall rules for this interface)



  • Just make an alias for 192.168.0.0/16 and block that.

    I usually make an alias for "AllInternalNetworks" as:

    • 192.168.0.0/16
    • 172.16.0.0/12
    • 10.0.0.0/8
      then block all access to those, and explicitly allow access to the specific IPs/addresses/networks above that line.

    Example:
    (top line) allow "LAN net" access to "LAN address" (LAN can access gateway)
    (next line) block "LAN net" to "AllInternalNetworks" (LAN can't go to any internal network)
    (next line) allow "LAN net" access to * (LAN can access internet)


  • Rebel Alliance Global Moderator

    yup I call that alias rfc1918.. I then use !rfc1918 rule to allow only access to internet and non of my other networks.