Tuning an OSPF Network for Efficient Operation
To make your OSPF network operate more efficiently, you can change some default settings on the Services Router by performing the following tasks:
- Controlling Route Selection in the Forwarding Table
- Controlling the Cost of Individual Network Segments
- Enabling Authentication for OSPF Exchanges
- Controlling Designated Router Election
Controlling Route Selection in the Forwarding Table
OSPF uses route preferences to select the route that is installed in the forwarding table when several routes have the same shortest path first (SFP) calculation. To evaluate a route, OSPF calculates the sum of the individual preferences of every router along the path and selects the route with the lowest total preference.
By default, internal OSPF routes have a preference value of 10, and external OSPF routes have a preference value of 150. Suppose all routers in your OSPF network use the default preference values. By setting the internal preference to 7 and the external preference to 130, you can ensure that the path through a particular Services Router is selected for the forwarding table any time multiple equal-cost paths to a destination exist.
To modify the default preferences on a Services Router:
- Navigate to the top of the configuration hierarchy in either the J-Web or the CLI configuration editor.
- Perform the configuration tasks described in Table 166.
Table 166: Controlling Route Selection in the Forwarding Table by Setting Preferences
Task | J-Web Configuration Editor | CLI Configuration Editor |
---|---|---|
Navigate to the Ospf level in the configuration hierarchy. |
| From the [edit] hierarchy level, enter edit protocols ospf |
Set the external and internal route preferences. |
|
|
Controlling the Cost of Individual Network Segments
When evaluating the cost of individual network segments, OSPF evaluates the reference bandwidth. For any link faster than 100 Mbps, the default cost metric is 1. When OSPF calculates the SPF algorithm, it sums the metrics of all interfaces along a path to determine the overall cost of the path. The path with the lowest metric is selected for the forwarding table.
To control the cost of the network segment, you can modify the metric value on an individual interface. Suppose all routers in the OSPF network use default metric values. If you increase the metric on an interface to 5, all paths through this interface have a calculated metric higher than the default and are not preferred.
To manually set the cost of a network segment on the stub area's Fast Ethernet interface by modifying the interface metric:
- Navigate to the top of the configuration hierarchy in either the J-Web or the CLI configuration editor.
- Perform the configuration tasks described in Table 167.
Table 167: Controlling the Cost of Individual Network Segments by Modifying the Metric
Task | J-Web Configuration Editor | CLI Configuration Editor |
---|---|---|
Navigate to the ge-0/0/0.0 level in the configuration hierarchy. |
| From the [edit] hierarchy level, enter edit protocols ospf area 0.0.0.0 interface ge-0/0/0.0 |
Set the interface metric. |
| Set the interface metric: set metric 5 |
Enabling Authentication for OSPF Exchanges
All OSPFv2 protocol exchanges can be authenticated to guarantee that only trusted routers participate in the AS's routing. By default, OSPF authentication is disabled.
![]() | Note: OSPFv3 does not support authentication. |
You can enable either of two authentication types:
- Simple authentication—Authenticates by means of a plain-text password (key) included in the transmitted packet.
- MD5 authentication—Authenticates by means of an MD5 checksum included in the transmitted packet.
Because OSPF performs authentication at the area level, all routers within the area must have the same authentication and corresponding password (key) configured. For MD5 authentication to work, both the receiving and transmitting routers must have the same MD5 key.
To enable OSPF authentication on the stub area:
- Navigate to the top of the configuration hierarchy in either the J-Web or the CLI configuration editor.
- Perform the configuration tasks described in Table 168.
Table 168: Enabling OSPF Authentication
Task | J-Web Configuration Editor | CLI Configuration Editor |
---|---|---|
Navigate to the 0.0.0.0 level in the configuration hierarchy. |
| From the [edit] hierarchy level, enter edit protocols ospf area 0.0.0.0 |
Set the authentication type for the stub area to either simple or MD5—for example, MD5. |
| Set the authentication type: set authentication-type md5 |
Navigate to the interface-name level in the configuration hierarchy. |
| From the [edit] hierarchy level, enter edit protocols ospf area 0.0.0.0 interface interface-name |
Set the authentication password (key) and, for MD5 authentication only, the key identifier to associate with the MD5 password:
|
|
|
Controlling Designated Router Election
At designated router election, the router priorities are evaluated first, and the router with the highest priority is elected designated router.
By default, routers have a priority of 128. A priority of 0 marks the router as ineligible to become the designated router. To configure a router so it is always the designated router, set its priority to 255.
To change the priority of a Services Router to control designated router election:
- Navigate to the top of the configuration hierarchy in either the J-Web or the CLI configuration editor.
- Perform the configuration tasks described in Table 169.
Table 169: Controlling Designated Router Election
Task | J-Web Configuration Editor | CLI Configuration Editor |
---|---|---|
Navigate to the OSPF interface address for the Services Router. For example, navigate to the ge-/0/0/1 level in the configuration hierarchy. |
| From the [edit] hierarchy level, enter edit protocols ospf area 0.0.0.3 interface ge-0/0/1 |
Set the Services Router priority to a value between 0 and 255—for example, 200. The default value is 128. |
| Set the priority value: set priority 200 |