DES-7200 Configuration Guide Chapter 4 OSPF
Configuration
4-20
4.2.13 Configuring OSPF Interface Cost Value
OSPF calculates the destination route based on the cost, where the route with the
least cost is the shortest route. The default route cost is based on network
bandwidth. When you configure the OSPF-enabled router, you can set the link
cost according to the factors such as link bandwidth, delay or economic cost. The
lower its cost, the higher the possibility of that link to be selected as the route. If
route aggregation takes place, the maximum cost of all the links are used as the
cost of the aggregated route.
Routing configuration includes two parts. In the first place, you set the reference
value for the bandwidth generated cost. This value and the interface bandwidth
value are used to create the default cost. In the second place, you can set the
respective metric of each interface by using the ip ospf cost command, so that
the default metric is not effective for the interface. For example, the default
reference value is 100 Mbps, and an Ethernet interface has the bandwidth of
10Mbps. Other example, the bandwidth is 100Mbps, the bandwidth of an Ethernet
interface is 10Mbps, this interface will have the default metric of 100/10 + 0.5 ≈
10.
The interface cost is selected in the following way in the OSPF protocol. The set
interface has the highest priority. If you have set an interface cost, the set value is
taken as the interface cost. If you do not set one while the automatic cost
generation function is enabled, the interface cost is calculated automatically. If the
function is disabled, the default of 10 is taken as the interface cost.
The configuration process is shown as below:
Command Meaning
DES-7200 # configure terminal
Enter the global configuration mode.
DES-7200(config)# router ospf 1
Enter the routing protocol configuration
mode.
DES-7200(config-router)#auto-cost
[reference-bandwidth ref-bw]
(Optional) Set the default cost based on the
bandwidth on an interface.
DES-7200 (config-router)# end
Return to the privileged EXEC mode.
DES-7200 # show ip protocol
Display the routing protocol that is running
currently.
DES-7200 # write
(Optional) Save the configuration.
To remove the setting, use the no ip ospf cost or auto-cost command.
4.2.14 Configuring OSPF Stub Router
Stub Router is a router that only forwards packets to its directly-connected links.
To prevent low-class routers from handling excessive LSAs or to allow routers to