CÔNG TY TNHH CÔNG NGHỆ VIỆT THÁI DƯƠNG
Logo CNTTShop.vn

NTT03, Line 1, Thống Nhất Complex, Thanh Xuân, Hà Nội.
Danh mục sản phẩm

Configure OSPF Route Generation

OSPF uses the network command to cover routes of the directly connected network segment. It can also redistribute external routes or use the host command to add host routes.

Configuration Condition

Before configuring OSPF route generation, ensure that:

  • Interface IP addresses have been configured so that neighbor nodes are reachable at the network layer.
  • Enable OSPF.

Configure OSPF to Redistribute Routes

If multiple routing protocols run on one device, routes of other protocols can be introduced to OSPF through redistribution. By default, class 2 external routes of OSPF are generated, with the routing metric 20. When you introduce external routes through redistribution, you can modify the external route type, metric, and tag field, and configure the required routing policy to perform route control and management.

Table 7-12 Configuring OSPF to Redistribute Routes

Step

Command

Description

Enter the global configuration mode.

configure terminal

-

Enter the OSPF configuration mode.

router ospf process-id [ vrf vrf-name ]

-

Configure OSPF to redistribute routes.

redistribute protocol [ protocol-id ] [ metric metric-value / metric-type metric-type / tag tag-value / route-map route-map-name / match route-type ]

Mandatory.

By default, route redistribution is not configured for OSPF.

Configure the metric of the OSPF external routes.

default-metric metric-value

Optional.

Configure the maximum number of the external routes re-distributed by OSPF

redistribute maximum-prefix maximum-prefix-value [threshold-value [warning-only] / warning-only]

Optional

By default, OSPF does not limit the number of the re-distributed external routes.

note


  • If the metric value of external routes are configured by using both the redistribute protocol [ protocol-id ] metric command and the default-metric command, the value that is configured by using the former command has a higher priority.

Configure the Default OSPF Route

After an OSPF Stub area or a totally NSSA areas is configured, a Type-3 default route is generated. For an NSSA area, no default route is automatically generated. You can use the area area-id nssa default-information-originate command to introduce a Type-7 default route to the NSSA area.

OSPF cannot use the redistribute command to introduce a Type-5 default route. To do this, use the default-information originate [ always ] command.

Table 7-13 Configuring the Default OSPF Route

Step

Command

Description

Enter the global configuration mode.

configure terminal

-

Enter the OSPF configuration mode.

router ospf process-id [ vrf vrf-name ]

-

Configure OSPF to introduce a default route.

default-information originate [ always / metric metric-value / metric-type metric-type / route-map route-map-name ]

Mandatory.

By default, no external default route is introduced to an OSPF AS.

The default metric of the introduced default route is 1, and the type is external type 2.

The field always means to force the OSPF AS to generate a default route; otherwise, the default route is generated only when there is a default route in the local routing table.

Configure the OSPF Host Route

Table 7-14 Configuring the OSPF Host Route

Step

Command

Description

Enter the global configuration mode.

configure terminal

-

Enter the OSPF configuration mode.

router ospf process-id [ vrf vrf-name ]

-

Configure the OSPF host route.

host ip-address area area-id [ cost cost ]

Mandatory.

By default, no host route is generated.