.. _vyos.rest.vyos_static_routes_module:
****************************
vyos.rest.vyos_static_routes
****************************
**Manage static routes on VyOS devices via REST API.**
Version added: 1.0.0
.. contents::
:local:
:depth: 1
Synopsis
--------
- Manages IPv4 and IPv6 static routes on VyOS devices using the HTTPS REST API.
- Covers blackhole routes (distance) and next-hop routes (distance, disable, outgoing interface). VyOS's static-route schema is considerably larger than this -- reject routes (an ICMP-unreachable counterpart to blackhole), a top-level per-route interface (a route resolved via an outgoing interface with no next-hop address at all), route tags, route descriptions, ECMP segment weighting, VRF leaking, and BFD monitoring on next-hops are not modeled here. That is a real, documented limitation, not an oversight.
Parameters
----------
.. raw:: html
| Parameter |
Choices/Defaults |
Comments |
|
config
list
/ elements=dictionary
|
|
List of static route configurations grouped by address family.
|
|
afi
string
/ required
|
|
Address family indicator.
|
|
routes
list
/ elements=dictionary
|
|
List of static route entries.
|
|
|
blackhole_config
dictionary
|
|
Blackhole route configuration (silently discard matching packets).
|
|
|
|
distance
integer
|
|
Administrative distance (1-255).
|
|
|
dest
string
/ required
|
|
Destination prefix in CIDR notation.
|
|
|
next_hops
list
/ elements=dictionary
|
|
List of next-hop addresses.
|
|
|
|
admin_distance
integer
|
|
Administrative distance for this next-hop (1-255).
|
|
|
|
enabled
boolean
|
|
Whether this next-hop is enabled.
|
|
|
|
forward_router_address
string
/ required
|
|
Next-hop IP address.
|
|
|
|
interface
string
|
|
Outgoing interface name.
|
|
state
string
|
Choices:
merged ←
- replaced
- overridden
- deleted
- gathered
|
merged - Add routes without removing existing ones.
replaced - Replace each named route (by afi + dest) exactly as specified.
overridden - Replace the entire static route table.
deleted - Remove listed or all static routes.
gathered - Read static routes from device without changes.
|