Static Routing Configuration

Configuration Hierarchy

The diagram illustrates the static routes configuration hierarchy.

Static Route Configuration Hierarchy
Figure 1. 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

route-options no-install

This option keeps the routes in the routing information base, but prevents them from being used for forwarding traffic.

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"
        }
      ]
    }
  }

Example: Static Route Configuration with route-options no install

supervisor@rtbrick.net: cfg> show config instance default static route ipv4 192.1.0.6/32
{
  "rtbrick-config:ipv4": [
    {
      "prefix4": "192.1.0.6/32",
      "safi": "labeled-unicast",
      "nexthop-profile": "nh1",
      "route-options": "no-install"
    },
    {
      "prefix4": "192.1.0.6/32",
      "safi": "unicast",
      "nexthop-profile": "nh1"
    }
  ]
}

api  To access the RESTCONF API that corresponds to this CLI, click here.

Nexthop Profile Configuration

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

A static route conditional profile check includes the route and its associated condition.

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

resolve-direct true

The option restricts all routes from resolving the nexthop of a static route instead, it allows only the direct routes to resolve the nexthop of a static route.

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.

api  To access the RESTCONF API that corresponds to this CLI (IPv4 Nexthop Profile), click here.

api  To access the RESTCONF API that corresponds to this CLI (IPv6 Nexthop Profile), click here.

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"
          }
        ]
      }
    }
}

api  To access the RESTCONF API that corresponds to this CLI, click here.

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 compare-operation, compare-type, compare-value, match-afi, match-instance, match-interface, match-isis-level, match-peer, and match-safi, and associate this conditional profile with multiple routes.

A static route conditional profile check includes the compare type and its associated attributes.

This feature is supported on the following Q2A and Q2C platforms:

  • Edgecore CSR440 (AS7535-28XB)

  • Edgecore AGR400 (AS7946-30XB)

  • Edgecore AGR420 (AS7946-74XKSB)

  • UfiSpace S9510-28DC

  • UfiSpace S9600-32X

  • UfiSpace S9600-72XC

  • UfiSpace S9600-102XC

Configuring Conditional Profiles

Syntax:

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

Attribute Description

conditional-profile <name>

Name of the conditional profile

compare-operation greater-than

Conditional routing compare operation

compare-type route-count

Conditional routing compare type

The following compare types are supported:

  • any-isis-neighbor-up

  • bgp-peer-established

  • interface-up

  • isis-neighbor-up

  • route-count

compare-value <compare-value>

Conditional routing condition value

match-afi (ipv4 |ipv6 |mpls)

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

match-instance <instance-name>

Routing instance where the condition will be checked.

match-interface <interface-name>

Interface name for which the condition will be checked.

match-isis-level <level-1 | level-2>

IS-IS level for which the condition will be checked.

match-peer <ipv4 | ipv6>

BGP peer for which the condition will be checked.

match-peer <ipv4 | ipv6> peer-address

BGP peer address for which the condition will be checked.

match-peer <ipv4 | ipv6> source-address

BGP source address 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.

nexthop-count

This option enables the static conditional policy logic to consider the number of next hops installed in the forwarding plane for static route install decisions.

Example 1: The following example configuration defines a conditional profile named backbone_v4 for the vrf1-blue instance, matching IPv4 unicast routes, and triggers when the route count exceeds 5. It specifies the matching criteria and comparison operation for static route conditions.

set instance vrf1-blue static conditional-profile backbone_v4
set instance vrf1-blue static conditional-profile backbone_v4 match-instance vrf1-blue
set instance vrf1-blue static conditional-profile backbone_v4 match-afi ipv4
set instance vrf1-blue static conditional-profile backbone_v4 match-safi unicast
set instance vrf1-blue static conditional-profile backbone_v4 compare-type route-count
set instance vrf1-blue static conditional-profile backbone_v4 compare-operation greater-than
set instance vrf1-blue static conditional-profile backbone_v4 compare-value 5
{
  "rtbrick-config:conditional-profile": [
    {
      "name": "backbone_v4",
      "match-instance": "vrf1-blue",
      "match-afi": "ipv4",
      "match-safi": "unicast",
      "compare-type": "route-count",
      "compare-operation": "greater-than",
      "compare-value": 5
    }
  ]
}

Example 2: The following example configuration defines a conditional static routing profile named vrf1-blue_fabric_isis_link1 for the vrf1-blue instance, specifying that the static route is applied when the IS-IS neighbor on interface ifl-0/0/0/0 in the vrf1-blue instance is up. It uses the isis-neighbor-up condition to control route activation based on IS-IS neighbor status.

set instance vrf1-blue static conditional-profile vrf1-blue_fabric_isis_link1
set instance vrf1-blue static conditional-profile vrf1-blue_fabric_isis_link1 match-instance vrf1-blue
set instance vrf1-blue static conditional-profile vrf1-blue_fabric_isis_link1 compare-type isis-neighbor-up
set instance vrf1-blue static conditional-profile vrf1-blue_fabric_isis_link1 match-interface ifl-0/0/0/0
{
  "rtbrick-config:conditional-profile": [
    {
      "name": "vrf1-blue_fabric_isis_link1",
      "match-instance": "vrf1-blue",
      "compare-type": "isis-neighbor-up",
      "match-interface": "ifl-0/0/0/0"
    }
  ]
}

Example 3: The following example configuration defines a conditional static route profile named vrf1-blue_fabric_isis_l1 for the vrf1-blue routing instance, which activates when any IS-IS level-1 neighbor is up and matches the vrf1-blue instance.

set instance vrf1-blue static conditional-profile vrf1-blue_fabric_isis_l1
set instance vrf1-blue static conditional-profile vrf1-blue_fabric_isis_l1 match-instance vrf1-blue
set instance vrf1-blue static conditional-profile vrf1-blue_fabric_isis_l1 compare-type any-isis-neighbor-up
set instance vrf1-blue static conditional-profile vrf1-blue_fabric_isis_l1 match-isis-level level-1
{
  "rtbrick-config:conditional-profile": [
    {
      "name": "vrf1-blue_fabric_isis_l1",
      "match-instance": "vrf1-blue",
      "compare-type": "any-isis-neighbor-up",
      "match-isis-level": "level-1"
    }
  ]
}

Example 4: The following example configuration defines a static conditional profile named vrf1-blue_fabric_intf_link1 for the vrf1-blue instance, specifying that the profile applies when the vrf1-blue instance is matched and the interface ifl-0/0/0/0 is in the "up" state. It uses compare-type interface-up to trigger the condition based on the interface status.

set instance vrf1-blue static conditional-profile vrf1-blue_fabric_intf_link1
set instance vrf1-blue static conditional-profile vrf1-blue_fabric_intf_link1 match-instance vrf1-blue
set instance vrf1-blue static conditional-profile vrf1-blue_fabric_intf_link1 compare-type interface-up
set instance vrf1-blue static conditional-profile vrf1-blue_fabric_intf_link1 match-interface ifl-0/0/0/0
{
  "rtbrick-config:conditional-profile": [
    {
      "name": "vrf1-blue_fabric_intf_link1",
      "match-instance": "vrf1-blue",
      "compare-type": "interface-up",
      "match-interface": "ifl-0/0/0/0"
    }
  ]
}

Example 5: The following example configuration defines a static conditional profile named default_fabric_bgp_v4_198.51.100.1_peer within the default instance, specifying that it matches when a BGP peer session is established with the IPv4 peer at address 198.51.100.1 and source address 198.51.100.2. It sets the matching instance and compare type to ensure the profile applies only under these BGP session conditions.

set instance default static conditional-profile default_fabric_bgp_v4_198.51.100.1_peer
set instance default static conditional-profile default_fabric_bgp_v4_198.51.100.1_peer match-instance default
set instance default static conditional-profile default_fabric_bgp_v4_198.51.100.1_peer compare-type bgp-peer-established
set instance default static conditional-profile default_fabric_bgp_v4_198.51.100.1_peer match-peer ipv4 peer-address 198.51.100.1
set instance default static conditional-profile default_fabric_bgp_v4_198.51.100.1_peer match-peer ipv4 source-address 198.51.100.2
{
  "rtbrick-config:conditional-profile": [
    {
      "name": "default_fabric_bgp_v4_198.51.100.1_peer",
      "match-instance": "default",
      "compare-type": "bgp-peer-established",
      "match-peer": {
        "ipv4": {
          "peer-address": "198.51.100.1",
          "source-address": "198.51.100.2"
        }
      }
    }
  ]
}

Example 6: The following example configuration defines a static conditional profile named default_fabric_bgp_v6_2001:db8::1_peer for the default instance, specifying that it matches when a BGP peer with IPv6 address 2001:db8::1 and source address 2001:db8::2 is established. It uses the bgp-peer-established compare type to trigger actions based on the BGP session state.

set instance default static conditional-profile default_fabric_bgp_v6_2001:db8::1_peer
set instance default static conditional-profile default_fabric_bgp_v6_2001:db8::1_peer match-instance default
set instance default static conditional-profile default_fabric_bgp_v6_2001:db8::1_peer compare-type bgp-peer-established
set instance default static conditional-profile default_fabric_bgp_v6_2001:db8::1_peer match-peer ipv6 peer-address 2001:db8::1
set instance default static conditional-profile default_fabric_bgp_v6_2001:db8::1_peer match-peer ipv6 source-address 2001:db8::2
{
  "rtbrick-config:conditional-profile": [
    {
      "name": "default_fabric_bgp_v6_2001:db8::1_peer",
      "match-instance": "default",
      "compare-type": "bgp-peer-established",
      "match-peer": {
        "ipv6": {
          "peer-address": "2001:db8::1",
          "source-address": "2001:db8::2"
        }
      }
    }
  ]
}

Example 7: The following example configuration defines a static conditional profile named default_fabric_bgp_v6_ll_link1_peer for the default instance, specifying that it matches the default instance, uses the bgp-peer-established compare type, and applies to the interface ifl-0/0/1/0. It is likely used to control routing or BGP behavior based on the state of a specific BGP peer on a particular interface.

set instance default static conditional-profile default_fabric_bgp_v6_ll_link1_peer
set instance default static conditional-profile default_fabric_bgp_v6_ll_link1_peer match-instance default
set instance default static conditional-profile default_fabric_bgp_v6_ll_link1_peer compare-type bgp-peer-established
set instance default static conditional-profile default_fabric_bgp_v6_ll_link1_peer match-interface ifl-0/0/1/0
{
  "rtbrick-config:conditional-profile": [
    {
      "name": "default_fabric_bgp_v6_ll_link1_peer",
      "match-instance": "default",
      "compare-type": "bgp-peer-established",
      "match-interface": "ifl-0/0/1/0"
    }
  ]
}

Example 8: The following example configuration defines a conditional profile named 'nexthop_count_ipv6'. It sets matching criteria based on address family (IPv6) and subsequent address family (unicast), and specifies that the profile triggers when the next-hop adjacency count is greater than 53.

set instance default static conditional-profile nexthop_count_ipv6
set instance default static conditional-profile nexthop_count_ipv6 match-afi ipv6
set instance default static conditional-profile nexthop_count_ipv6 match-safi unicast
set instance default static conditional-profile nexthop_count_ipv6 compare-type nexthop-count
set instance default static conditional-profile nexthop_count_ipv6 compare-operation greater-than
set instance default static conditional-profile nexthop_count_ipv6 compare-value 53
{
  "rtbrick-config:conditional-profile": [
    {
      "name": "nexthop_count_ipv6",
      "match-afi": "ipv6",
      "match-safi": "unicast",
      "compare-type": "nexthop-count",
      "compare-operation": "greater-than",
      "compare-value": 53
    }
  ]
}

api  To access the RESTCONF API that corresponds to this CLI, click here.