Use the OSPFSession module to configure the OSPF feature.
The OSPFSession Module contains two classes:
- OSPFSession Class
- OSPFInterface Class
Note: The OSPFInterface class is an attribute of the OSPFSession class. To use the OSPFInterface class, you must have an instance of the OSPFSession class.
OSPFSession Class
cfg_distance
Configures an administrative distance for the OSPFv2 instance.
Arguments:
- dist: Distance for OSPF routes, an integer ranging from 1 to 255.
Optional Arguments:
- no: Set to True to set distances back to the default values.
Returns: True on success
cfg_maximum_paths
Configures the maximum number of parallel routes the OSPF can support.
Arguments:
- max: Maximum number of parallel routes that an IP routing protocol installs in a routing table. The range is from 1 to 64.
Optional Arguments:
- no: Set to True to restore the default number of parallel routes.
Returns: True on success
cfg_router_id
Specifies the IP address to use as the router ID.
Arguments:
- router_id: A string in dotted quad format ('A.B.C.D') representing the IP Address of the router.
Optional Arguments:
- no: A boolean, set to True to remove the router-id.
Returns: True on success
enable
Starts OSPF. Inherited from cisco.feature.Feature
Arguments:
- no: if True, stops the tacacs
Returns: True on success
disable
Disables OSPF. Inherited from cisco.feature.Feature
Arguments: none
Returns: True on success
is_enabled
Reports whether OSPF is enabled. Inherited from cisco.feature.Feature
Arguments: none
Returns: True if the feature is enabled.
is_shutdown
Checks if the OSPF routing process is shut down.
Arguments: None
Returns:
- True if the OSPF process is enabled and shutdown.
- False if the OSPF process is running or if OSPF is not enabled.
log_adjacency_changes
Logs a message for an up or down event on a neighbor.
Optional Arguments:
- no: A boolean, set to True to disable this feature.
Returns: True on success
name
Reports feature name, as used in "config terminal". Inherited from cisco.feature.Feature
Arguments: none
Returns: Feature name, as used in "config terminal".
set_vrf
Sets the VRF context for subsequent API calls on a specified VRF object. Any configuration done on this OSPFSession object will be applied to this VRF.
Arguments:
- vrf: VRF name (string) or the VRF ID (int).
Returns: True on success
show_name
Reports feature name, as seen in "show feature". Inherited from cisco.feature.Feature
Arguments: none
Returns: Feature name, as seen in "show feature".
shutdown
Shuts down the OSPF routing process. All existing OSPF configurations will be preserved.
Arguments: None
Returns: True on success
start
Arguments: None
Returns: True on success
state
Reports the state of one or all OSPF instances. Inherited from cisco.feature.Feature
Optional Arguments:
- instance: The instance of OSPF
Returns: state (or states if multiple instances) of feature
OSPFInterface Class
Note: The OSPFInterface class is an attribute of the OSPFSession class. To use the OSPFInterface class, you must have an instance of the OSPFSession class.
add
Adds this interface to OSPFv2 instance and area.
Arguments: None.
Returns: True on success
cfg_dead_interval
Configures OSPFv2 dead interval for this interface.
Arguments:
- dead_interval: The interval in seconds during which at least one hello packet must be received from a neighbor before the router declares that neighbor as down. Acceptable Range 1 to 65535.
Optional Arguments:
- no: A boolean, set to True to remove the OSPF dead interval configuration.
Returns: True on success
cfg_hello_interval
Configures OSPFv2 hello interval for this interface.
Arguments:
- hello_interval: The interval in seconds for sending hello packets to neighbors. The range is 1 to 65535 seconds.
Optional Arguments:
- no: A boolean, set to True to remove the OSPF hello interval configuration.
Returns: True on success
cfg_mtu_ignore
Configures OSPFv2 to ignore any IP MTU mismatch with a neighbor.
Arguments: None
Optional Arguments:
- no: A boolean, set to True to remove the OSPF mtu-ignore
configuration.
Returns: True on success
cfg_ospf_cost
Configures OSPFv2 cost for this interface.
Arguments:
- cost: The link-state metric. The range 1 to 65535.
Optional Arguments:
- no: A boolean, set to True to remove the OSPF cost configuration.
Returns: True on success
cfg_ospf_priority
Configures OSPFv2 priority for this interface. Priority is used to determine DR election in area.
Arguments:
- ospf_priority: The priority of the router. The range is from 0 to 255.
Optional Arguments:
- no: A boolean, set to True to remove the OSPF priority configuration.
Returns: True on success
cfg_passive_interface
Suppresses OSPF routing updates on this interface.
Arguments: None
Optional Arguments:
- no: A boolean, set to True to remove the OSPF passive-interface
configuration.
Returns: True on success
shutdown
Shuts down the OSPF on this interface. All existing OSPF
configurations will be preserved.
Arguments: None
Optional Arguments:
- no: A boolean, set to True to remove the OSPF shutdown configuration.
Returns: True on success