Configuring Static Routes

Configuration Hierarchy

The diagram illustrates the static routes configuration hierarchy.

Static Route Configuration Hierarchy

Configuration Syntax and Commands

The following sections describe the static route configuration syntax and commands. In RBFS, next hops of static routes are configured separately, and referenced by the actual routes.

Static Route Configuration

This section describes how to configure the static route itself.

Syntax

set instance <instance-name> static route <attribute> <value>

Attribute Description

<instance-name>

Name of the routing instance

<afi> <prefix | label> (true | false)

Supported AFIs are ipv4, ipv6, and mpls. In case of IPv4 or IPv6, configure the prefix. In case of MPLS, configure the incoming label and BOS flag.

<safi>

Supported SAFIs are unicast, labeled-unicast, and multicast.

<nexthop-profile>

Name of the nexthop profile

Example: Static Route Configuration

{
    "rtbrick-config:route": {
      "ipv4": [
        {
          "prefix4": "198.51.100.15/24",
          "safi": "unicast",
          "nexthop-profile": "nexthop1",
          "preference": 20

        }
      ],
      "ipv6": [
        {
          "prefix6": "2001:db8:0:117::/32",
          "safi": "unicast",
          "nexthop-profile": "nexthop2"
        }
      ],
      "mpls": [
        {
          "in-label": 8888,
          "in-bos": "true",
          "safi": "unicast",
          "nexthop-profile": "nexthop1"
        }
      ]
    }
  }

Nexthop Profile Configuration

You can group various nexthop parameters with a nexthop profile name, and associate this nexthop profile with multiple routes.

Syntax

set instance <instance-name> static nexthop-profile <name> <attribute> <value>

Attribute Description

<instance-name>

Name of the routing instance

nexthop-profile <name>

Nexthop profile name

exit-interface <exit-interface>

Exit interface name

lookup-afi (ipv4 | ipv6 | mpls)

Lookup routing table address family where the nexthop will be resolved.

lookup-instance <lookup-instance>

Lookup routing table instance where the nexthop will be resolved.

lookup-safi (labeled-unicast | multicast | unicast)

Lookup routing table subsequent address family where the nexthop will be resolved.

nexthop <address>

IPv4/IPv6 nexthop address

out-bos (true | false)

Label BOS

out-label <out-label>

Label to be pushed

Example: Nexthop Profile Configuration

{
    "rtbrick-config:static": {
      "nexthop-profile": [
        {
          "name": "nexthop1",
          "nexthop": "198.51.100.145",
          "out-label": 4444
        },
        {
          "name": "nexthop3",
          "exit-interface": "ifp-0/0/4/4"
        }
      ]
    }
  }
  • If you do not provide lookup-instance, lookup-afi and lookup-safi values, default values will be used to install the route.

  • The exit interface attribute is mandatory for link-local nexthop.

Conditional Profile Configuration

By using the conditional static route feature, you can make specific routes conditional. These conditional routes are installed only if the specified condition is satisfied.

You can group various conditional parameters such as match-instance, match-afi, match-safi, compare-operation, compare-type, and compare-value with a conditional profile name, and associate this conditional profile with multiple routes.

Syntax:

set instance <instance-name> static conditional-profile <name> <attribute> <value>

Attribute Description

conditional <name>

Conditional profile name

compare-operation greater-then

Conditional routing compare operation

compare-type route-count

Conditional routing compare type

compare-value <compare-value>

Conditional routing condition value

match-instance <instance-name>

Routing instance where the condition will be checked.

match-afi (ipv4 |ipv6 |mpls)

Routing tables address family (AFI) for which the condition will be checked.

match-safi (labeled-unicast |multicast |unicast)

Routing table subsequent address family (SAFI) for which the condition will be checked.

Example: Conditional Profile Configuration

{
    "rtbrick-config:conditional-profile": [
      {
        "name": "c2",
        "match-instance": "default",
        "match-afi": "ipv4",
        "match-safi": "unicast",
        "compare-type": "route-count",
        "compare-operation": "greater-than",
        "compare-value": 20
      }
    ]
  }

Static Multicast Route Configuration

Syntax:

set instance <instance-name> static route multicast4 <attribute> <value

Attribute Description

<instance-name>

Name of the routing instance

<source>

IPv4 multicast source address

<group>

IPv4 multicast group address

Example: Static Multicast Route Configuration

{
    "rtbrick-config:static": {
      "route": {
        "multicast4": [
          {
            "source": "198.51.100.15/24",
            "group": "198.51.100.35/24",
            "nexthop-profile": "nexthop3"
          }
        ]
      }
    }
}