Pfsense Vlan Wan Firewall Rules

7 min read Oct 10, 2024
Pfsense Vlan Wan Firewall Rules

Mastering VLANs, WAN, and Firewall Rules in pfSense

pfSense is a powerful open-source firewall and router software that provides a comprehensive suite of networking tools. One of its key features is its ability to manage Virtual Local Area Networks (VLANs), Wide Area Networks (WANs), and intricate firewall rules. This combination allows you to create highly secure and segmented network environments, ensuring efficient traffic flow and robust security.

What are VLANs, WANs, and Firewall Rules?

VLANs (Virtual Local Area Networks) segment a physical network into multiple logical networks. Each VLAN acts as a separate broadcast domain, allowing you to group devices based on their purpose or location. For example, you could create a VLAN for your company's employees and another VLAN for guest users.

WANs (Wide Area Networks) connect networks over a long distance, typically across cities, countries, or continents. This allows organizations to connect offices, remote users, and cloud services.

Firewall Rules define the security policies that govern network traffic. They allow you to control which traffic is allowed or blocked based on source and destination IP addresses, ports, protocols, and other criteria.

Setting Up VLANs in pfSense

  1. Configure Interfaces: Navigate to Interfaces > Assignments. Create new interfaces for each VLAN you need. Choose the appropriate physical interface and assign a VLAN ID. For example, create VLAN10 and VLAN20, each using the same physical interface.
  2. Assign IPs: In the same section, assign IP addresses and subnet masks to the newly created VLAN interfaces.
  3. VLAN Tagging: Ensure your network devices, such as switches and routers, are configured to support VLAN tagging and that they are correctly configured to forward traffic between VLANs.

Configuring WAN in pfSense

  1. Add WAN Interface: In Interfaces > Assignments, create a new interface representing your WAN connection. Assign the correct IP address and subnet mask.
  2. Gateway Settings: Select the Gateway tab and define the default gateway, DNS servers, and other WAN-related settings.
  3. Firewall Rules: Set up firewall rules for your WAN interface to control incoming and outgoing traffic.

Creating Firewall Rules in pfSense

  1. Navigate to Firewall > Rules: Here you will manage your firewall rules.
  2. Create a New Rule: Click on the Add button to create a new rule.
  3. Define Rule Parameters:
    • Interface: Choose the interface where the rule applies (e.g., VLAN10, VLAN20, or WAN).
    • Action: Select Pass to allow traffic or Block to deny it.
    • Protocol: Choose the network protocol (e.g., TCP, UDP, ICMP).
    • Source/Destination: Define the source and destination IP addresses or ranges.
    • Ports: Specify the source and destination ports.
    • Schedule: Optionally define specific times when the rule is active.
  4. Save Your Rule: Once you've configured all the parameters, save your rule.

pfSense Firewall Rule Examples

Here are a few examples of firewall rules you can configure in pfSense:

  • Allow access to a web server: Create a rule that allows traffic to port 80 (HTTP) on a specific IP address within your network.
  • Block access to a specific website: Create a rule that blocks traffic to a particular website by specifying its IP address.
  • Enable remote access to your network: Create a rule that allows traffic to specific ports used by VPN or remote access tools.

VLAN, WAN, and Firewall Rule Use Cases

Example 1: Secure Guest Network

Imagine a hotel that wants to provide secure Wi-Fi for guests while isolating them from the internal network.

  1. VLAN: Create a separate VLAN for guest access.
  2. WAN: Connect the guest VLAN to the internet.
  3. Firewall Rules: Block access from the guest VLAN to internal networks and restrict the types of websites guests can access.

Example 2: Segmenting Network for Business

A small business might want to separate its network for employees, printers, and servers.

  1. VLAN: Create separate VLANs for each category.
  2. WAN: Connect the employee VLAN to the internet.
  3. Firewall Rules: Control traffic between VLANs, ensuring servers are only accessible by authorized personnel, and printers can only be accessed by employees.

Conclusion

pfSense provides powerful tools for configuring VLANs, WANs, and firewall rules. By leveraging these features, you can build secure and robust network environments tailored to your specific needs. Remember to carefully consider the security requirements of your network and choose the appropriate configuration to protect your data and systems.

Featured Posts