.. _vyos.rest.vyos_ospfv2_module:
*********************
vyos.rest.vyos_ospfv2
*********************
**Manage OSPFv2 configuration on VyOS devices using REST API**
Version added: 1.0.0
.. contents::
:local:
:depth: 1
Synopsis
--------
- Manages OSPFv2 configuration on VyOS devices via the REST API.
- Uses REST API (``connection=httpapi``) instead of CLI.
- Scope matches the current vyos.vyos.vyos_ospfv2 (CLI collection) module: areas (including virtual_link), auto_cost, default_information, default_metric, distance, log_adjacency_changes, max_metric, mpls_te, neighbor, parameters, passive_interface, passive_interface_exclude, redistribute, timers. VyOS's OSPF schema is considerably larger than even this -- access-list, aggregation, capability, graceful-restart, ldp-sync, maximum-paths, per-interface tuning (bandwidth/hello-multiplier/network-type/authentication/intervals beyond passive), segment-routing, and summary-address are not modeled here, matching real gaps in the CLI module's own scope, not oversights.
- A standalone top-level ``route_map`` field exists in the CLI module's argspec but does not correspond to any real device path -- confirmed against a live VyOS 1.5.0 device's ``set protocols ospf`` completions, which list no ``route-map`` entry at that level (only nested under ``default-information originate`` and per-protocol under ``redistribute``, both of which are modeled here). Deliberately omitted rather than built against a confirmed non-functional field.
Parameters
----------
.. raw:: html
| Parameter |
Choices/Defaults |
Comments |
|
config
dictionary
|
|
OSPFv2 configuration.
|
|
areas
list
/ elements=dictionary
|
|
OSPFv2 areas.
|
|
|
area_id
string
/ required
|
|
Area ID.
|
|
|
area_type
dictionary
|
|
Area type.
|
|
|
|
normal
boolean
|
|
Normal area.
|
|
|
|
nssa
dictionary
|
|
NSSA area.
|
|
|
|
|
default_cost
integer
|
|
Default cost for NSSA.
|
|
|
|
|
no_summary
boolean
|
|
Do not inject inter-area routes.
|
|
|
|
|
set
boolean
|
|
Enable NSSA.
|
|
|
|
|
translate
string
|
Choices:
- always
- candidate
- never
|
NSSA-ABR translate setting.
|
|
|
|
stub
dictionary
|
|
Stub area.
|
|
|
|
|
default_cost
integer
|
|
Default cost for stub.
|
|
|
|
|
no_summary
boolean
|
|
Do not inject inter-area routes.
|
|
|
|
|
set
boolean
|
|
Enable stub.
|
|
|
authentication
string
|
Choices:
- plaintext-password
- md5
|
Area authentication type.
|
|
|
network
list
/ elements=dictionary
|
|
Networks in this area.
|
|
|
|
address
string
/ required
|
|
Network address.
|
|
|
range
list
/ elements=dictionary
|
|
Area ranges.
|
|
|
|
address
string
/ required
|
|
Range address.
|
|
|
|
cost
integer
|
|
Cost for this range.
|
|
|
|
not_advertise
boolean
|
|
Do not advertise this range.
|
|
|
|
substitute
string
|
|
Substitute prefix.
|
|
|
shortcut
string
|
Choices:
- default
- disable
- enable
|
Shortcut mode.
|
|
|
virtual_link
list
/ elements=dictionary
|
|
Virtual link.
|
|
|
|
address
string
/ required
|
|
Virtual link address (router ID of the remote ABR).
|
|
|
|
authentication
dictionary
|
|
Virtual link authentication.
|
|
|
|
|
md5
list
/ elements=dictionary
|
|
MD5 key id based authentication.
|
|
|
|
|
|
key_id
integer
|
|
MD5 key id (1-255).
|
|
|
|
|
|
md5_key
string
|
|
MD5 key (16 characters or less).
|
|
|
|
|
plaintext_password
string
|
|
Plain text password (8 characters or less).
|
|
|
|
dead_interval
integer
|
|
Interval after which a neighbor is declared dead.
|
|
|
|
hello_interval
integer
|
|
Interval between hello packets.
|
|
|
|
retransmit_interval
integer
|
|
Interval between retransmitting lost link state advertisements.
|
|
|
|
transmit_delay
integer
|
|
Link state transmit delay.
|
|
auto_cost
dictionary
|
|
Auto-cost reference bandwidth.
|
|
|
reference_bandwidth
integer
|
|
Reference bandwidth in Mbps.
|
|
default_information
dictionary
|
|
Default route distribution.
|
|
|
originate
dictionary
|
|
Originate default route.
|
|
|
|
always
boolean
|
|
Always advertise default route.
|
|
|
|
metric
integer
|
|
Metric for default route.
|
|
|
|
metric_type
integer
|
|
Metric type.
|
|
|
|
route_map
string
|
|
Route map.
|
|
default_metric
integer
|
|
Default metric for redistributed routes.
|
|
distance
dictionary
|
|
Administrative distances.
|
|
|
global
integer
|
|
Global OSPFv2 distance.
|
|
|
ospf
dictionary
|
|
Per-route-type distances.
|
|
|
|
external
integer
|
|
External route distance.
|
|
|
|
inter_area
integer
|
|
Inter-area route distance.
|
|
|
|
intra_area
integer
|
|
Intra-area route distance.
|
|
log_adjacency_changes
string
|
|
Log adjacency changes.
|
|
max_metric
dictionary
|
|
OSPFv2 maximum/infinite-distance metric.
|
|
|
router_lsa
dictionary
|
|
Advertise own Router-LSA with infinite distance (stub router).
|
|
|
|
administrative
boolean
|
|
Administratively apply, for an indefinite period.
|
|
|
|
on_shutdown
integer
|
|
Time (seconds) to advertise self as stub-router before shutdown.
|
|
|
|
on_startup
integer
|
|
Time (seconds) to advertise self as stub-router on startup.
|
|
mpls_te
dictionary
|
|
MPLS Traffic Engineering parameters.
|
|
|
enabled
boolean
|
|
Enable MPLS-TE functionality.
|
|
|
router_address
string
|
|
Stable IP address of the advertising router.
|
|
neighbor
list
/ elements=dictionary
|
|
OSPF neighbors.
|
|
|
neighbor_id
string
/ required
|
|
Neighbor IP.
|
|
|
poll_interval
integer
|
|
Poll interval.
|
|
|
priority
integer
|
|
Neighbor priority.
|
|
parameters
dictionary
|
|
OSPFv2 parameters.
|
|
|
abr_type
string
|
Choices:
- cisco
- ibm
- shortcut
- standard
|
ABR type.
|
|
|
opaque_lsa
boolean
|
|
Enable opaque LSA.
|
|
|
rfc1583_compatibility
boolean
|
|
Enable RFC1583 compatibility.
|
|
|
router_id
string
|
|
Router ID.
|
|
passive_interface
list
/ elements=string
|
|
Interfaces to suppress routing updates on, via per-interface configuration (protocols ospf interface <name> passive).
|
|
passive_interface_exclude
list
/ elements=string
|
|
Interfaces to explicitly exclude from passive mode (via protocols ospf interface <name> passive disable) -- e.g. when passive is otherwise applied broadly.
|
|
redistribute
list
/ elements=dictionary
|
|
Route redistribution.
|
|
|
metric
integer
|
|
Metric.
|
|
|
metric_type
integer
|
|
Metric type.
|
|
|
route_map
string
|
|
Route map.
|
|
|
route_type
string
|
Choices:
- bgp
- connected
- kernel
- rip
- static
|
Protocol to redistribute.
|
|
timers
dictionary
|
|
Routing timers.
|
|
|
refresh
dictionary
|
|
Refresh parameters.
|
|
|
|
timers
integer
|
|
Refresh timer (seconds).
|
|
|
throttle
dictionary
|
|
Throttling adaptive timers.
|
|
|
|
spf
dictionary
|
|
SPF timers.
|
|
|
|
|
delay
integer
|
|
Delay (ms) from first change received to SPF calculation.
|
|
|
|
|
initial_holdtime
integer
|
|
Initial hold time (ms) between consecutive SPF calculations.
|
|
|
|
|
max_holdtime
integer
|
|
Maximum hold time (ms).
|
|
state
string
|
Choices:
merged ←
- replaced
- deleted
- gathered
|
Desired state.
merged adds/updates without removing existing config.
replaced replaces the entire OSPFv2 configuration.
deleted removes OSPFv2 configuration.
gathered returns current configuration as structured data.
|