Related Documentation
- J, M, MX, T Series
- Encryption Overview
- M, T Series
- Configuring Encryption Interfaces
- Configuring ES PIC Redundancy
- Configuring IPsec Tunnel Redundancy
Configuring Filters for Traffic Transiting the ES PIC
This section contains the following topics:
Traffic Overview
Traffic configuration defines the traffic that must flow through the tunnel. You configure outbound and inbound firewall filters, which identify and direct traffic to be encrypted and confirm that decrypted traffic parameters match those defined for the given tunnel. The outbound filter is applied to the LAN or WAN interface for the incoming traffic you want to encrypt. The inbound filter is applied to the ES PIC to check the policy for traffic coming in from the remote host. Because of the complexity of configuring a router to forward packets, no automatic checking is done to ensure that the configuration is correct.
![]() | Note: The valid firewall filters statements for IPsec are destination-port, source-port, protocol, destination-address, and source-address. |
In Figure 1, Gateway A protects the network 10.1.1.0/24, and Gateway B protects the network 10.2.2.0/24. The gateways are connected by an IPsec tunnel. For more information about firewalls, see the Routing Policy Feature Guide for Routing Devices.
Figure 1: Example: IPsec Tunnel Connecting Security Gateways

The SA and ES interface for security Gateway A are configured as follows:
Configuring the Security Association
To configure the SA, include the security-association statement at the [edit security] hierarchy level:
For more information about configuring an SA, see the Junos OS Administration Library for Routing Devices. For information about applying the SA to an interface, see Specifying the Security Association Name for Encryption Interfaces.
Configuring an Outbound Traffic Filter
To configure the outbound traffic filter, include the filter statement at the [edit firewall] hierarchy level:
For more information, see the Routing Policy Feature Guide for Routing Devices.
Example: Configuring an Outbound Traffic Filter
Firewall filters for outbound traffic direct the traffic through the desired IPsec tunnel and ensure that the tunneled traffic goes out the appropriate interface (see Figure 1). Here, an outbound firewall filter is created on security Gateway A; it identifies the traffic to be encrypted and adds it to the input side of the interface that carries the internal virtual private network (VPN) traffic:
![]() | Note: The source address, port, and protocol on the outbound traffic filter must match the destination address, port, and protocol on the inbound traffic filter. The destination address, port, and protocol on the outbound traffic filter must match the source address, port, and protocol on the inbound traffic filter. |
Applying the Outbound Traffic Filter
After you have configured the outbound firewall filter, you apply it by including the filter statement at the [edit interfaces interface-name unit logical-unit-number family inet] hierarchy level:
Example: Applying the Outbound Traffic Filter
Apply the outbound traffic filter. The outbound filter is applied on the Fast Ethernet interface at the [edit interfaces fe-0/0/1 unit 0 family inet] hierarchy level. Any packet matching the IPsec action term (term 1) on the input filter (ipsec-encrypt-policy-filter), configured on the Fast Ethernet interface, is directed to the ES PIC interface at the [edit interfaces es-0/1/0 unit 0 family inet] hierarchy level. So, if a packet arrives from the source address 10.1.1.0/24 and goes to the destination address 10.2.2.0/24, the Packet Forwarding Engine directs the packet to the ES PIC interface, which is configured with the manual-sa1 SA. The ES PIC receives the packet, applies the manual-sa1 SA, and sends the packet through the tunnel.
The router must have a route to the tunnel end point; add a static route if necessary.
Configuring an Inbound Traffic Filter
To configure an inbound traffic filter, include the filter statement at the [edit firewall] hierarchy level:
For more information, see the Routing Policy Feature Guide for Routing Devices.
Example: Configuring an Inbound Traffic Filter
Configure an inbound firewall filter. This filter performs the final IPsec policy check and is created on security gateway A. The policy check ensures that only packets that match the traffic configured for this tunnel are accepted.
Applying the Inbound Traffic Filter to the Encryption Interface
After you create the inbound firewall filter, you can apply it to the ES PIC. To apply the filter to the ES PIC, include the filter statement at the [edit interfaces es-fpc/pic/port unit logical-unit-number family inet filter] hierarchy level:
The input filter is the name of the filter applied to received traffic. For a configuration example, see Example: Configuring an Inbound Traffic Filter. For more information about firewall filters, see the Routing Policy Feature Guide for Routing Devices.
Example: Applying the Inbound Traffic Filter to the Encryption Interface
Apply the inbound firewall filter (ipsec-decrypt-policy-filter) to the decrypted packet to perform the final policy check. The IPsec manual-sa1 SA is referenced at the [edit interfaces es-1/2/0 unit 0 family inet] hierarchy level and decrypts the incoming packet.
The Packet Forwarding Engine directs IPsec packets to the ES PIC. It uses the packet’s security parameter index (SPI), protocol, and destination address to look up the SA configured on one of the ES interfaces. The IPsec manual-sa1 SA is referenced at the [edit interfaces es-1/2/0 unit 0 family inet] hierarchy level and is used to decrypt the incoming packet. When the packets are processed (decrypted, authenticated, or both), the input firewall filter (ipsec-decrypt-policy-filter) is applied on the decrypted packet to perform the final policy check. term1 defines the decrypted (and verified) traffic and performs the required policy check. For information about term1, see Example: Configuring an Inbound Traffic Filter.
![]() | Note: The inbound traffic filter is applied after the ES PIC has processed the packet, so the decrypted traffic is defined as any traffic that the remote gateway is encrypting and sending to this router. IKE uses this filter to determine the policy required for a tunnel. This policy is used during the negotiation with the remote gateway to find the matching SA configuration. |
Related Documentation
- J, M, MX, T Series
- Encryption Overview
- M, T Series
- Configuring Encryption Interfaces
- Configuring ES PIC Redundancy
- Configuring IPsec Tunnel Redundancy
Published: 2013-08-29
Related Documentation
- J, M, MX, T Series
- Encryption Overview
- M, T Series
- Configuring Encryption Interfaces
- Configuring ES PIC Redundancy
- Configuring IPsec Tunnel Redundancy