Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Example: Configuring Firewall Filters for Port, VLAN, and Router Traffic on EX Series Switches

This example shows how to configure and apply firewall filters to control traffic that is entering or exiting a port on the switch, a VLAN on the network, and a Layer 3 interface on the switch. Firewall filters define the rules that determine whether to forward or deny packets at specific processing points in the packet flow.

Requirements

This example uses the following software and hardware components:

  • Junos OS Release 9.0 or later for EX Series switches.

  • Two Juniper Networks EX3200-48T switches: one to be used as an access switch, the other to be used as a distribution switch

  • One Juniper Networks EX-UM-4SFP uplink module

  • One Juniper Networks J-series router

Before you configure and apply the firewall filters in this example, be sure you have:

Overview

This configuration example show how to configure and apply firewall filters to provide rules to evaluate the contents of packets and determine when to discard, forward, classify, count, and analyze packets that are destined for or originating from the EX Series switches that handle all voice-vlan, employee-vlan, and guest-vlan traffic. Table 1 shows the firewall filters that are configured for the EX Series switches in this example.

Table 1: Configuration Components: Firewall Filters
Component Purpose/Description

Port firewall filter, ingress-port-voip-class-limit-tcp-icmp

This firewall filter performs two functions:

  • Assigns priority queueing to packets with a source MAC address that matches the phone MAC addresses. The forwarding class expedited-forwarding provides low loss, low delay, low jitter, assured bandwidth, and end-to-end service for all voice-vlan traffic.

  • Performs rate limiting on packets that enter the ports for employee-vlan. The traffic rate for TCP and ICMP packets is limited to 1 Mbps with a burst size up to 30,000 bytes.

This firewall filter is applied to port interfaces on the access switch.

VLAN firewall filter, ingress-vlan-rogue-block

Prevents rogue devices from using HTTP sessions to mimic the gatekeeper device that manages call registration, admission, and call status for VoIP calls. Only TCP or UDP ports should be used; and only the gatekeeper uses HTTP. That is, all voice-vlan traffic on TCP ports should be destined for the gatekeeper device. This firewall filter applies to all phones on voice-vlan, including communication between any two phones on the VLAN and all communication between the gatekeeper device and VLAN phones.

This firewall filter is applied to VLAN interfaces on the access switch.

VLAN firewall filter, egress-vlan-watch-employee

Accepts employee-vlan traffic destined for the corporate subnet, but does not monitor this traffic. Employee traffic destined for the Web is counted and analyzed.

This firewall filter is applied to vlan interfaces on the access switch.

VLAN firewall filter, ingress-vlan-limit-guest

Prevents guests (non-employees) from talking with employees or employee hosts on employee-vlan. Also prevents guests from using peer-to-peer applications on guest-vlan, but allows guests to access the Web.

This firewall filter is applied to VLAN interfaces on the access switch.

Router firewall filter, egress-router-corp-class

Prioritizes employee-vlan traffic, giving highest forwarding-class priority to employee traffic destined for the corporate subnet.

This firewall filter is applied to a routed port (Layer 3 uplink module) on the distribution switch.

Figure 1 shows the application of port, VLAN, and Layer 3 routed firewall filters on the switch.

Figure 1: Application of Port, VLAN, and Layer 3 Routed Firewall FiltersApplication of Port, VLAN, and Layer 3 Routed Firewall Filters

Network Topology

The topology for this configuration example consists of one EX-3200-48T switch at the access layer, and one EX-3200-48T switch at the distribution layer. The distribution switch's uplink module is configured to support a Layer 3 connection to a J-series router.

The EX Series switches are configured to support VLAN membership. Table 2 shows the VLAN configuration components for the VLANs.

Table 2: Configuration Components: VLANs

VLAN Name

VLAN ID

VLAN Subnet and Available IP Addresses

VLAN Description

voice-vlan

10

192.0.2.0/28 192.0.2.1through 192.0.2.14

192.0.2.15 is the subnet’s broadcast address

Voice VLAN used for employee VoIP traffic

employee-vlan

20

192.0.2.16/28 192.0.2.17 through 192.0.2.30 192.0.2.31 is the subnet’s broadcast address

VLAN standalone PCs, PCs connected to the network through the hub in VoIP telephones, wireless access points, and printers. This VLAN completely includes the voice VLAN. Two VLANs (voice-vlan and employee-vlan) must be configured on the ports that connect to the telephones.

guest-vlan

30

192.0.2.32/28 192.0.2.33 through 192.0.2.46 192.0.2.47 is the subnet’s broadcast address

VLAN for guests’ data devices (PCs). The scenario assumes that the corporation has an area open to visitors, either in the lobby or in a conference room, that has a hub to which visitors can plug in their PCs to connect to the Web and to their company’s VPN.

camera-vlan

40

192.0.2.48/28 192.0.2.49 through 192.0.2.62 192.0.2.63 is the subnet’s broadcast address

VLAN for the corporate security cameras.

Ports on the EX Series switches support Power over Ethernet (PoE) to provide both network connectivity and power for VoIP telephones connecting to the ports. Table 3 shows the switch ports that are assigned to the VLANs and the IP and MAC addresses for devices connected to the switch ports:

Table 3: Configuration Components: Switch Ports on a 48-Port All-PoE Switch

Switch and Port Number

VLAN Membership

IP and MAC Addresses

Port Devices

ge-0/0/0, ge-0/0/1

voice-vlan, employee-vlan

IP addresses: 192.0.2.1 through 192.0.2.2

MAC addresses: 00.00.5E.00.53.01, 00.00.5E.00.53.02

Two VoIP telephones, each connected to one PC.

ge-0/0/2, ge-0/0/3

employee-vlan

192.0.2.17 through 192.0.2.18

Printer, wireless access points

ge-0/0/4, ge-0/0/5

guest-vlan

192.0.2.34 through 192.0.2.35

Two hubs into which visitors can plug in their PCs. Hubs are located in an area open to visitors, such as a lobby or conference room

ge-0/0/6, ge-0/0/7

camera-vlan

192.0.2.49 through 192.0.2.50

Two security cameras

ge-0/0/9

voice-vlan

IP address: 192.0.2.14

MAC address:00.05.5E.00.53.0E

Gatekeeper device. The gatekeeper manages call registration, admission, and call status for VoIP phones.

ge-0/1/0

IP address: 192.0.2.65

Layer 3 connection to a router; note that this is a port on the switch’s uplink module

Configuring an Ingress Port Firewall Filter to Prioritize Voice Traffic and Rate-Limit TCP and ICMP Traffic

To configure and apply firewall filters for port, VLAN, and router interfaces, perform these tasks:

Procedure

CLI Quick Configuration

To quickly configure and apply a port firewall filter to prioritize voice traffic and rate-limit packets that are destined for the employee-vlan subnet, copy the following commands and paste them into the switch terminal window:

Step-by-Step Procedure

To configure and apply a port firewall filter to prioritize voice traffic and rate-limit packets that are destined for the employee-vlan subnet:

  1. Define the policers tcp-connection-policer and icmp-connection-policer:

  2. Define the firewall filter ingress-port-voip-class-limit-tcp-icmp:

  3. Define the term voip-high:

  4. Define the term network-control:

  5. Define the term tcp-connection to configure rate limits for TCP traffic:

  6. Define the term icmp-connection to configure rate limits for ICMP traffic:

  7. Define the term best-effort with no match conditions for an implicit match on all packets that did not match any other term in the firewall filter:

  8. Apply the firewall filter ingress-port-voip-class-limit-tcp-icmp as an input filter to the port interfaces for employee-vlan:

  9. Configure the parameters that are desired for the different schedulers.

    Note:

    When you configure parameters for the schedulers, define the numbers to match your network traffic patterns.

  10. Assign the forwarding classes to schedulers with a scheduler map:

  11. Associate the scheduler map with the outgoing interface:

Results

Display the results of the configuration:

Configuring a VLAN Ingress Firewall Filter to Prevent Rogue Devices from Disrupting VoIP Traffic

To configure and apply firewall filters for port, VLAN, and router interfaces, perform these tasks:

Procedure

CLI Quick Configuration

To quickly configure a VLAN firewall filter on voice-vlan to prevent rogue devices from using HTTP sessions to mimic the gatekeeper device that manages VoIP traffic, copy the following commands and paste them into the switch terminal window:

Step-by-Step Procedure

To configure and apply a VLAN firewall filter on voice-vlan to prevent rogue devices from using HTTP to mimic the gatekeeper device that manages VoIP traffic:

  1. Define the firewall filter ingress-vlan-rogue-block to specify filter matching on the traffic you want to permit and restrict:

  2. Define the term to-gatekeeper to accept packets that match the destination IP address of the gatekeeper:

  3. Define the term from-gatekeeper to accept packets that match the source IP address of the gatekeeper:

  4. Define the term not-gatekeeper to ensure all voice-vlan traffic on TCP ports is destined for the gatekeeper device:

  5. Apply the firewall filter ingress-vlan-rogue-block as an input filter to the VLAN interface for the VoIP telephones:

Results

Display the results of the configuration:

Configuring a VLAN Firewall Filter to Count, Monitor, and Analyze Egress Traffic on the Employee VLAN

To configure and apply firewall filters for port, VLAN, and router interfaces, perform these tasks:

Procedure

CLI Quick Configuration

A firewall filter is configured and applied to VLAN interfaces to filter employee-vlan egress traffic. Employee traffic destined for the corporate subnet is accepted but not monitored. Employee traffic destined for the Web is counted and analyzed.

To quickly configure and apply a VLAN firewall filter, copy the following commands and paste them into the switch terminal window:

Step-by-Step Procedure

To configure and apply an egress port firewall filter to count and analyze employee-vlan traffic that is destined for the Web:

  1. Define the firewall filter egress-vlan-watch-employee:

  2. Define the term employee-to-corp to accept but not monitor all employee-vlan traffic destined for the corporate subnet:

  3. Define the term employee-to-web to count and monitor all employee-vlan traffic destined for the Web:

    Note:

    See Example: Configuring Port Mirroring for Local Monitoring of Employee Resource Use on EX Series Switches for information about configuring the employee-monitor analyzer.

  4. Apply the firewall filter egress-vlan-watch-employee as an output filter to the port interfaces for the VoIP telephones:

Results

Display the results of the configuration:

Configuring a VLAN Firewall Filter to Restrict Guest-to-Employee Traffic and Peer-to-Peer Applications on the Guest VLAN

To configure and apply firewall filters for port, VLAN, and router interfaces, perform these tasks:

Procedure

CLI Quick Configuration

In the following example, the first filter term permits guests to talk with other guests but not employees on employee-vlan. The second filter term allows guests Web access but prevents them from using peer-to-peer applications on guest-vlan.

To quickly configure a VLAN firewall filter to restrict guest-to-employee traffic, blocking guests from talking with employees or employee hosts on employee-vlan or attempting to use peer-to-peer applications on guest-vlan, copy the following commands and paste them into the switch terminal window:

Step-by-Step Procedure

To configure and apply a VLAN firewall filter to restrict guest-to-employee traffic and peer-to-peer applications on guest-vlan:

  1. Define the firewall filter ingress-vlan-limit-guest:

  2. Define the term guest-to-guest to permit guests on the guest-vlan to talk with other guests but not employees on the employee-vlan:

  3. Define the term no-guest-employee-no-peer-to-peer to allow guests on guest-vlan Web access but prevent them from using peer-to-peer applications on the guest-vlan.

    Note:

    The destination-mac-address is the default gateway, which for any host in a VLAN is the next-hop router.

  4. Apply the firewall filter ingress-vlan-limit-guest as an input filter to the interface for guest-vlan :

Results

Display the results of the configuration:

Configuring a Router Firewall Filter to Give Priority to Egress Traffic Destined for the Corporate Subnet

To configure and apply firewall filters for port, VLAN, and router interfaces, perform these tasks:

Procedure

CLI Quick Configuration

To quickly configure a firewall filter for a routed port (Layer 3 uplink module) to filter employee-vlan traffic, giving highest forwarding-class priority to traffic destined for the corporate subnet, copy the following commands and paste them into the switch terminal window:

Step-by-Step Procedure

To configure and apply a firewall filter to a routed port (Layer 3 uplink module) to give highest priority to employee-vlan traffic destined for the corporate subnet:

  1. Define the firewall filter egress-router-corp-class:

  2. Define the term corp-expedite:

  3. Define the term not-to-corp:

  4. Apply the firewall filter egress-router-corp-class as an output filter for the port on the switch's uplink module, which provides a Layer 3 connection to a router:

Results

Display the results of the configuration:

Verification

To confirm that the firewall filters are working properly, perform the following tasks:

Verifying that Firewall Filters and Policers are Operational

Purpose

Verify the operational state of the firewall filters and policers that are configured on the switch.

Action

Use the operational mode command:

Meaning

The show firewall command displays the names of the firewall filters, policers, and counters that are configured on the switch. The output fields show byte and packet counts for all configured counters and the packet count for all policers.

Verifying that Schedulers and Scheduler-Maps are Operational

Purpose

Verify that schedulers and scheduler-maps are operational on the switch.

Action

Use the operational mode command:

Meaning

Displays statistics about the configured schedulers and schedulers-maps.