Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Security Policies with VRF-Aware Security Zones

VRF-Aware Zone-Based Policy Enforcement

Overview

The VRF-aware zone-based policy enforcement feature introduces a strategic approach to managing security policies at the VRF level.

You can now create zones for each VRF instance and apply policies between VRF instances to simplify Layer 3 VPN (L3VPN) policy management for MPLS and VXLAN. By defining VRF-aware security zones, you gain a more granular level of control of both intra-VRF and inter-VRF traffic and control across L3VPN deployments. The policy lookup process adapts to integrate VRF-based zones alongside interface-based zones, allowing comprehensive policy enforcement.

You define security zones by VRF instance (not by VRF group). The VRF-group restriction in the policy rule set remains unchanged. For incoming traffic, the firewall evaluates the L3VPN zone first, and then the physical interface zone; if no zone matches, the firewall drops packets.

Configure security zones per VRF using the vrf option under the [edit security zones security-zone zone-name] hierarchy level. Verify your configuration using the show security policies and show security zones operational commands. These commands display the VRF-based zone names in the existing syslog’s source-zone-name and destination-zone-name fields. Also, new syslog fields, src-vrf and dst-vrf, display the source and destination VRF instances. See System Log Explorer | Juniper Networks Pathfinder.

VRF-Aware Zone-Based Security Policies

Previously, zone changes were handled in a single-level zone model, and any change in the zone would tear down the session entirely.

Overview

You can now define zones using VRF instances (VRF-aware zones), similar to how you define zones with interfaces. The policy lookup process incorporates VRF zones, enabling cross-combinations with interface-based zones for comprehensive policy enforcement.

Define zones using VRF instances: VRF-aware zones behave the same way as interface-based zone contexts when it comes to policy evaluation. Similar to how interface-based from zone and to zone combinations are considered as contexts, VRF zones are considered the same way. The firewall flow sends the VRF zones to the policy in the same way as it sends interface zone details for policy lookup.

We now support two-level zones, where MPLS and VXLAN traffic are matched within VRF-specific zones. This approach ensures that sessions are governed by VRF-specific policies without affecting other overlay or underlay zones.

Traffic evaluation (based on type):

  • For MPLS or VXLAN traffic, the highest priority is given to VRF-based zones.
  • For IP traffic, the device checks only interface-based zones.

Policy evaluation (based on traffic type):

  • For MPLS and VXLAN traffic, policy evaluation uses VRF-based zones.

  • For IP traffic, policy evaluation uses only interface-based zones.

    The single VRF-group policy limitation remains to prevent ambiguous matches.

VRF-aware zones and interface-based zones remain segregated; VRF-aware zones cannot include interfaces; interface zones cannot reference VRF-aware zones.

Note:

VRF-aware zone-based policy enforcement is backward compatible, ensuring that existing VRF-level enforcement remains functional while incorporating new VRF-based zone configurations.

To maintain backward compatibility, configuring both VRF-based zone and VRF match criteria in the same policy is not supported, and doing so results in a commit error.

For MPLS and VXLAN traffic, sessions are created based on the VRF-specific zone policies. Packets are matched against the VRF zone, and if a match occurs, the device establishes a session accordingly.

Flow Session Behavior

This section describes the behavior of flow sessions across three scenarios: overlay-to-overlay, underlay-to-underlay, and overlay-to-underlay flows.

You can manage zone and VRF changes with predictable session behavior to maintain traffic continuity.

If the traffic is matched to an overlay zone, then the sessions do not terminate when you add an interface to an underlay zone or delete an unused interface. The device also preserves traffic when you add a VRF instance to the traffic-matched overlay zone or delete an unused VRF instance from that overlay zone.

If the traffic is matched to an overlay zone, then the sessions terminate when you rename the underlay zone or delete the interface carrying overlay-zone-matched traffic in the underlay zone.

Configuration Overview

VRF-based zones are exclusive to VRF instances and do not support direct interface configurations, similarly interface-based zones do not accommodate VRF instances. Virtual network identifier (VNI)-aware zones are not supported.

Configure VRF zones: Define VRF zones and associate them with specific policies using the CLI, Security Director, or Security Director Cloud.

Verify VRF zones configuration: Use the existing policy and zone show commands. The command outputs are now updated to include VRF zone details, granting visibility into the current configurations and any potential discrepancies.

VRF-Aware Zone-Based Policy Configuration Limitations

  • You can configure zones only based on a VRF instance and not based on a VRF group.
  • For each VRF instance, choose either VRF group or a VRF zone; configuring both causes a commit failure, generating a commit error.
  • Traffic between VRF group and a VRF zone is not permitted. Flow processing explicitly denies and drops any traffic between a VRF group and a VRF zone.
  • Configuring interfaces and VRF instances under the same zone results in a commit error as show below:
  • Configuring both VRF-based zone and VRF match criteria in the same policy results in a commit error as shown below:
  • Configuring more than 32 VRF instances in a zone results in a commit error as shown below:
  • Associating the same VRF instance to multiple zones results in a commit error as shown below:
  • Configuring the same VRF instance in the VRF zone and the VRF group results in a commit error as shown below:

Example: Configure Security Policies with VRF-Aware Security Zones to Manage VRF-Based Traffic

This example shows how to configure security policies with VRF-aware security zones to manage VRF-based traffic.

Requirements

Overview

In Junos OS, security policies enforce rules for transit traffic, in terms of what traffic can pass through the device and the actions that need to take place on the traffic as it passes through the device. An SRX Series Firewall is deployed in an SD-WAN to control traffic using the VRF-aware zone based security policies.

You can configure VRF-aware zone-based security policies with VRF instances, security zones, and inter-zone communication.

In this configuration example, you create two isolated virtual routing instances (VRF-a and VRF-b) that maintain separate routing and forwarding tables while enabling MPLS L3VPN functionality. Each VRF instance is associated with its own security zone, allowing granular security policy enforcement.

The configuration includes security policies that permit controlled communication between VRF instances and external networks through the trust zone. You can verify the configuration by checking VRF routing table isolation, security zone associations, and policy enforcement through traffic flow testing and monitoring commands.

Configuration

Configure VRF-aware zone-based security policies with VRF instances, security zones, and inter-zone communication to permit traffic.

Procedure

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, copy and paste the commands into the CLI at the [edit] hierarchy level, and then enter commit from configuration mode.

CLI Quick Configuration
Step-by-Step Procedure

The following example requires you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the Junos OS CLI User Guide.

  1. Configure the VRF-a and VRF-b instances.

  2. Assign a route distinguisher to each VRF routing instance.

  3. Set a VRF target for each VRF routing instance.

    Setting different VRF targets ensures controlled route sharing between the VRF instances.

  4. Assign a single VPN label for all the routes in the VRF instances.

  5. Associate security zones to their respective defined VRF instances.

  6. Configure the trust zone interface.

    Assign the management or shared services interface to the trust zone. This interface operates in the global routing table context. It provides access to shared services or management networks outside the VRF instance.

  7. Configure an inter-VRF communication policy.

    The policy pol1 allows traffic from vrf-zone1 to vrf-zone2. If pol1 matches any source address, destination address, or applications, the then permit action allows the matched traffic to flow between VRF instances. This configuration creates a controlled bridge between otherwise isolated VRF instances.

  8. Configure a policy to enable communication between VRF-a and the trust zone.

    Policy pol2 enables communication from vrf-zone1 to the trust zone. The policy also allows the VRF-a traffic to reach shared services in the global routing table and maintains broad matching criteria for maximum connectivity flexibility.

Results

From configuration mode, confirm your configuration by entering the show security policies and show routing-instances commands. If the output does not display the intended configuration, repeat the instructions in this configuration to correct it.

If you are done configuring the device, enter commit from configuration mode.

Verification

Verify Policy Configuration

Purpose

Verify information about the configured security policies.

Action

From operational mode, enter the show security policies command to display a summary of all the security policies configured on the device.

Verify Zone Configuration

Purpose

Verify information about the configured security zones.

Action

From operational mode, enter the show security zones command to display a summary of all the security zones configured on the device.