Configure Import Policy for the PE Router's VRF Table
Each VPN can have a policy that defines how routes are imported into the PE router's VRF table. An import policy is applied to routes received from other PE routers in the VPN. A policy must evaluate all routes received over the IBGP session with the peer PE router. If the routes match the conditions, the route is installed in the PE router's
routing-instance-name.inet.0VRF table. An import policy must contain a second term that rejects all other routes.Unless an import policy contains only a
then rejectstatement, it must include a reference to a community. Otherwise, when you try to commit the configuration, the commit fails. You can configure multiple import policies.An import policy determines what to import to a specified VRF table based on the VPN routes learned from the remote PE routers through IBGP. The IBGP session is configured at the
[edit protocols bgp]hierarchy level. If you also configure an import policy at the [editprotocols bgp]hierarchy level, theimport policies at the [edit policy-options]hierarchy level and the[edit protocols bgp]hierarchy level are combined through a logical AND operation. This allows you to filter traffic as a group.To configure an import policy for the PE router's VRF table, follow these steps:
- To define an import policy, include the
policy-statementstatement. For all PE routers, an import policy must always include the following, at a minimum:[edit]policy-options {policy-statementimport-policy-name{termimport-term-name{from {protocol bgp;communitycommunity-id;}then accept;}termterm-name{then reject;}}}You can configure these statements at the following hierarchy levels:
The
import-policy-namepolicy evaluates all routes received over the IBGP session with the other PE router. If the routes match the conditions in thefromstatement, the route is installed in the PE router'srouting-instance-name.inet.0VRF table. The second term in the policy rejects all other routes.For more information about creating policies, see the JUNOS Internet Software Configuration Guide: Policy Framework.
vrf-importimport-policy-name;You can configure this statement at the following hierarchy levels: