Skip to content

Routing

The routing setting contains a dictionary to configure routes and PBR1 rules:

Schema description

routing:
  # route settings (ip route)
  routes:
    - to: 0.0.0.0/0
      via: 192.0.2.1

# rule settings (ip rule)
  rules:
    - priority: 42
      iif: eno1
      to: 1.1.1.1/32
      action: prohibit

Examples:

Multipath Routing

It is possible to configure multipath routes using the multipath attribute:

routing:
  routes:
    - to: 0.0.0.0/0
      multipath:
        # gateway with default weight (hops: 0)
        - via: 192.0.2.1
        # gateway with increased weight
        - via: 192.0.2.2
          hops: 1

Address Family of the Nexthop Router

It is possible to specify an IP address for the nexthop from another address family. The Linux kernel will use the NLRI1 to route packets appropriate.

routing:
  routes:
    - to: 0.0.0.0/0
      via: fe80::defa
      dev: eth0

  1. Policy Based Routing ↩↩↩

  2. Network Layer Reachability Information ↩