.. _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.
- In VyOS 1.5+, passive interfaces use per-interface config rather than passive-interface.
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.
|
|
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.
|
|
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
|
|
Passive interfaces (VyOS 1.5+: configured via protocols ospf interface <name> passive).
|
|
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.
|
|
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.
|