Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

interface-routes

Syntax

Hierarchy Level

Description

Associate a routing table group with a device’s interfaces, specify routing table groups into which interface routes are imported or exported, or change the preference of primary direct routes.

By default, IPv4 interface routes (also called direct routes) are imported into routing table inet.0, and IPv6 interface routes are imported into routing table inet6.0. If you configure alternate routing tables for use by some routing protocols, the device might need to import the interface routes into the alternate routing tables. To define the routing tables into which interface routes are imported, you create a routing table group and associate it with the routing device’s interfaces.

To create the routing table groups, include the passive statement at the [edit routing-options] hierarchy level.

If you configured a routing table, configure the OSPF primary instance at the [edit protocols ospf] hierarchy level with the statements needed for your network so that routes are installed in inet.0 and in the forwarding table. Make sure to include the routing table group.

Note:

On EX Series switches, only dynamically learned routes can be imported from one routing table group to another.

Options

export

Export local routes. Specify the route types to export:

  • lan—Export LAN routes.

  • point-to-point—Export point-to-point routes.

Only local routes on point-to-point interfaces configured with a destination address can be exported.

family (inet | inet6)

Specify the IPv4 or IPv6 address family for the routes to export or import.

import-primary policy-name

Apply a policy to change the route preference value for primary direct routes that match the policy. The policy should include a term with the preference attribute that sets the desired preference value.

By default, primary direct routes are otherwise always the preferred route for the route destination.

See EVPN Host Route Management for Large-Scale Stretched Campus Networks for a use case that includes this option to prefer EVPN Type 5 subnet routes over direct routes as the primary routes for a prefix. That use case describes how to optimize remote host route management in large campus network stretched across multiple locations that use DCI stitching with EVPN Type 2 and EVPN Type 5 routes.

The remaining statements are explained separately. See CLI Explorer.

Required Privilege Level

routing—To view this statement in the configuration.

routing-control—To add this statement to the configuration.

Release Information

Statement introduced before Junos OS Release 7.4.

Option import-primary added in Junos OS and Junos OS Evolved Release 25.4R1.