REFERENCE

v6.11.0

OSPF

OSPF instances, areas, ranges, interface-templates, neighbors and LSAs (`/routing ospf`).

Tools

list_ospf_instances

List OSPF Instances · Risk: read

List all OSPF instances (/routing ospf instance) — each instance is one OSPF process with a fixed protocol version (2=OSPFv2/IPv4, 3=OSPFv3/IPv6), router-id, redistribution list, and import/export filter chains. Use this to verify running processes before adding areas or interface templates. For area topology use list_ospf_areas; for per-link config use list_ospf_interface_templates; for adjacency state use list_ospf_neighbors. Returns full detail for every instance including disabled ones.

No tool-specific parameters.

add_ospf_instance

Add OSPF Instance · Risk: write

Create an OSPF instance (/routing ospf instance add) — the top-level OSPF process. version 2 = OSPFv2 (IPv4 routing), 3 = OSPFv3 (IPv6 routing); each address family needs its own instance. router_id may be an IPv4 address, 'main', or the name of a /routing id. redistribute is a comma-separated list (connected,static,rip,bgp,…). Requires RouterOS v7 with the routing package. After creating an instance, add areas with add_ospf_area and bind interfaces with add_ospf_interface_template. Returns the created instance's full detail.

ParameterRequiredDefinition
nameYesUnique instance name {"type":"string"}
versionYes2 = OSPFv2, 3 = OSPFv3 {"default":2,"type":"integer","minimum":2,"maximum":3}
router_idNoIPv4 address, 'main', or a /routing id name {"type":"string"}
vrfNo{"type":"string"}
redistributeNoComma list, e.g. "connected,static" {"type":"string"}
in_filter_chainNoRouting filter chain for received routes {"type":"string"}
out_filter_chainNoRouting filter chain for redistributed routes {"type":"string"}
originate_defaultNonever, if-installed, or always {"type":"string"}
domain_idNoOSPF domain ID (MPLS VPN PE-CE OSPF) {"type":"string"}
domain_tagNoOSPF domain tag (MPLS VPN PE-CE OSPF) {"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}
use_dnNoUse/ignore DN bit on OSPF routes (MPLS VPN) {"type":"boolean"}
mpls_te_areaNoArea used for MPLS traffic engineering {"type":"string"}
mpls_te_addressNoRouter address advertised for MPLS TE {"type":"string"}
commentNo{"type":"string"}
disabledYes{"default":false,"type":"boolean"}

update_ospf_instance

Update OSPF Instance · Risk: write-idempotent

Update an existing OSPF instance (/routing ospf instance set) by name — change router-id, redistribution list, import/export filter chains, originate-default policy, comment, or disabled state. Only supplied fields are modified; omitting a field leaves it unchanged. name identifies the target instance (use list_ospf_instances to find names). Returns the updated instance detail. To remove an instance entirely use remove_ospf_instance.

ParameterRequiredDefinition
nameYesExisting OSPF instance name {"type":"string"}
router_idNo{"type":"string"}
redistributeNo{"type":"string"}
in_filter_chainNo{"type":"string"}
out_filter_chainNo{"type":"string"}
originate_defaultNo{"type":"string"}
domain_idNoOSPF domain ID (MPLS VPN PE-CE OSPF) {"type":"string"}
domain_tagNoOSPF domain tag (MPLS VPN PE-CE OSPF) {"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}
use_dnNoUse/ignore DN bit on OSPF routes (MPLS VPN) {"type":"boolean"}
mpls_te_areaNoArea used for MPLS traffic engineering {"type":"string"}
mpls_te_addressNoRouter address advertised for MPLS TE {"type":"string"}
commentNo{"type":"string"}
disabledNo{"type":"boolean"}

remove_ospf_instance

Remove OSPF Instance · Risk: destructive

Remove an OSPF instance by name (/routing ospf instance remove) — permanently stops the named OSPF process. Use list_ospf_instances to find the instance name. Remove dependent areas (remove_ospf_area), area ranges (remove_ospf_area_range), and interface templates (remove_ospf_interface_template) first to avoid orphaned config or removal errors. Irreversible — all OSPF adjacencies for that process will drop immediately. For a non-destructive pause use update_ospf_instance with disabled=true.

ParameterRequiredDefinition
nameYesOSPF instance name to remove {"type":"string"}

list_ospf_areas

List OSPF Areas · Risk: read

List all OSPF areas (/routing ospf area) — areas group links within an OSPF instance and control LSA flooding scope; type is default (normal), stub, or nssa; area-id 0.0.0.0 is the backbone. Use this to verify area membership before adding area ranges or interface templates. For prefix summarisation use list_ospf_area_ranges; for adjacency health use list_ospf_neighbors. Returns full detail for every area including its instance and type.

No tool-specific parameters.

add_ospf_area

Add OSPF Area · Risk: write

Create an OSPF area (/routing ospf area add) within a named instance — area-id must be in IPv4 dotted notation (backbone = '0.0.0.0'). type controls LSA flooding: default (normal), stub (no external LSAs), or nssa (allow external redistribution via NSSA LSAs). no_summaries=true makes a totally-stubby or totally-NSSA area by blocking summary LSAs. Requires the instance to already exist (add_ospf_instance). After adding an area, bind interfaces to it with add_ospf_interface_template. Returns a success confirmation.

ParameterRequiredDefinition
nameYesUnique area name {"type":"string"}
area_idYesArea id in IPv4 notation, e.g. "0.0.0.0" for backbone {"type":"string"}
instanceYesOSPF instance name this area belongs to {"type":"string"}
typeNo{"type":"string","enum":["default","stub","nssa"]}
no_summariesNoMake a totally-stubby/NSSA area (block summary LSAs) {"type":"boolean"}
default_costNoCost of the default route an ABR injects into a stub/NSSA area {"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}
commentNo{"type":"string"}
disabledYes{"default":false,"type":"boolean"}

remove_ospf_area

Remove OSPF Area · Risk: destructive

Remove an OSPF area by name (/routing ospf area remove) — permanently deletes the area and its association with the instance. Use list_ospf_areas to find the area name. Remove any area ranges (remove_ospf_area_range) and interface templates (remove_ospf_interface_template) that reference this area first to avoid orphaned config or removal errors.

ParameterRequiredDefinition
nameYesOSPF area name to remove {"type":"string"}

list_ospf_area_ranges

List OSPF Area Ranges · Risk: read

List OSPF area summarisation ranges (/routing ospf area range) — aggregate prefixes that an ABR (area border router) advertises to condense intra-area routes into fewer inter-area Type-3 LSAs. Use this to verify summarisation config before adding or removing ranges. For the areas themselves use list_ospf_areas. Returns full detail including prefix, area, cost, and advertise flag.

No tool-specific parameters.

add_ospf_area_range

Add OSPF Area Range · Risk: write

Add an OSPF area summarisation range (/routing ospf area range add) to a named area — the ABR will aggregate matching intra-area prefixes into a single Type-3 LSA advertised to other areas. advertise=false suppresses the summary entirely (null-routes the aggregate). cost overrides the auto-computed metric. Area must already exist (add_ospf_area). prefix is the aggregate prefix, e.g. '10.10.0.0/16'. Use list_ospf_area_ranges to verify after creation. Returns a success confirmation.

ParameterRequiredDefinition
areaYesOSPF area name {"type":"string"}
prefixYesAggregate prefix, e.g. "10.10.0.0/16" {"type":"string"}
advertiseYesAdvertise the summary (false suppresses it) {"default":true,"type":"boolean"}
costNo{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}
commentNo{"type":"string"}
disabledNo{"type":"boolean"}

remove_ospf_area_range

Remove OSPF Area Range · Risk: destructive

Remove an OSPF area summarisation range (/routing ospf area range remove) by its .id — use list_ospf_area_ranges to obtain the id (e.g. '*1'). The ABR will revert to advertising individual intra-area prefixes instead of the aggregate.

ParameterRequiredDefinition
range_idYesRange id, e.g. "*1" {"type":"string"}

list_ospf_interface_templates

List OSPF Interface Templates · Risk: read

List OSPF interface templates (/routing ospf interface-template) — templates bind interfaces or network prefixes to an area and set per-link OSPF parameters (cost, type, timers, authentication, passive). This is the RouterOS v7 mechanism that activates OSPF on interfaces; there is no per-interface sub-menu. Use this before adding or removing templates. For area membership use list_ospf_areas; for active adjacencies use list_ospf_neighbors. Returns full detail for every template including its area, interfaces/networks, and auth settings.

No tool-specific parameters.

add_ospf_interface_template

Add OSPF Interface Template · Risk: write

Bind interfaces or network prefixes to an OSPF area (/routing ospf interface-template add). Match links via interfaces (interface or interface-list name) and/or networks (prefix, e.g. '10.0.0.0/24'). type sets the link model: broadcast (LAN), ptp (point-to-point), ptp-unnumbered (point-to-point over an unnumbered link), ptmp, ptmp-broadcast, nbma, or virtual-link. passive=true advertises the subnet without forming OSPF adjacencies (for stub networks). auth/auth_id/auth_key enable per-interface authentication; hello_interval e.g. '10s', dead_interval e.g. '40s'. Requires the area to already exist (add_ospf_area). Returns the new template id (e.g. '*2') if RouterOS echoes one; use list_ospf_interface_templates to verify.

ParameterRequiredDefinition
areaYesOSPF area name to attach matched interfaces to {"type":"string"}
interfacesNoInterface or interface-list name {"type":"string"}
networksNoNetwork prefix(es) to enable OSPF on, e.g. "10.0.0.0/24" {"type":"string"}
costNoOutput cost / metric {"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}
priorityNoDR election priority (0 = never DR) {"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}
typeNo{"type":"string","enum":["broadcast","ptp","ptp-unnumbered","ptmp","ptmp-broadcast","nbma","virtual-link"]}
passiveNo{"type":"boolean"}
hello_intervalNoe.g. "10s" {"type":"string"}
dead_intervalNoe.g. "40s" {"type":"string"}
retransmit_intervalNoInterval between LSA retransmissions, e.g. "5s" {"type":"string"}
transmit_delayNoEstimated LSA transmit delay, e.g. "1s" {"type":"string"}
instance_idNoOSPF instance-id carried in hello packets {"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}
prefix_listNoPrefix-list name filtering which connected networks are advertised {"type":"string"}
vlink_neighbor_idNoVirtual-link remote router-id (type=virtual-link) {"type":"string"}
vlink_transit_areaNoTransit area the virtual-link traverses (type=virtual-link) {"type":"string"}
authNo{"type":"string","enum":["simple","md5","sha1","sha256","sha384","sha512"]}
auth_idNoKey id for keyed authentication {"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}
auth_keyNoAuthentication key/password {"type":"string"}
commentNo{"type":"string"}
disabledYes{"default":false,"type":"boolean"}

remove_ospf_interface_template

Remove OSPF Interface Template · Risk: destructive

Remove an OSPF interface template (/routing ospf interface-template remove) by its .id — use list_ospf_interface_templates to obtain the id (e.g. '*2'). Removing a template stops OSPF on all matched interfaces; existing adjacencies will drop immediately.

ParameterRequiredDefinition
template_idYesTemplate id, e.g. "*2" {"type":"string"}

list_ospf_neighbors

List OSPF Neighbors · Risk: read

List active OSPF adjacencies (/routing ospf neighbor) — shows each neighbor's router-id, address, interface, instance, area, and adjacency state (Full/2-Way/ExStart/Exchange/Loading/…). Read-only — the primary health check for confirming OSPF is forming Full adjacencies. For the link-state database use list_ospf_lsa; for per-interface config use list_ospf_interface_templates. Returns full detail for every discovered neighbor.

No tool-specific parameters.

list_ospf_lsa

List OSPF LSAs · Risk: read

List the OSPF link-state database (/routing ospf lsa) — every LSA the router holds, by type (Router/Network/Summary/ASBR-Summary/External/NSSA/…), area, and originating router-id. Read-only — used to inspect topology, verify summarisation (Type-3 LSAs), confirm external redistribution (Type-5/Type-7), and diagnose flooding or database synchronisation problems. Filter to a single area with area_filter. For adjacency state use list_ospf_neighbors; for instance/area config use list_ospf_instances.

ParameterRequiredDefinition
area_filterNoShow only LSAs for this area {"type":"string"}

On this page