Configuring external route redistribution and control

Configuring route redistribution for OSPF establishes the routing switch as an ASBR for importing and translating different protocol routes into OSPF. When you configure redistribution for OSPF, you can specify that static, connected, or BGP routes external to the OSPF domain are imported as OSPF routes.

Prerequisites

You must be in the router configuration context, as indicated by theswitch(config-router)#prompt.

Procedure
  1. Enable route redistribution using the command重新分配.

    重新分配{bgp | connected | static | rip | ospf} [route-map]

    For example, the following command sets redistribution of connected routes as OSPF routes:
    switch(config-ospf-1)#重新分配connected
  2. Optionally, modify the default metric for redistribution using the following command. For command details, seedefault-metric.

    default-metric

    For example, the following command sets the default metric for redistribution to 37.
    switch(config-ospf-1)#default-metric 37
  3. Optionally, set the cost of default-summary LSAs using the following command. For command details, seearea default-metric.

    areadefault-metric

    For example, the following command sets the cost of default summary LSAs to 2.
    switch (config-ospf-1)# area 1 default-metric 2
  4. Optionally, set the protocol to advertise a maximum metric so that other routers do not prefer this router as an intermediate hop in their shortest path first (SPF) calculations. For command details, seemax-metric router-lsa.

    max-metric router-lsa(在启动时(]]

    For example, the following command sets advertise max-metric router-lsa on startup.
    switch(config-ospf-1)#max-metric router-lsa on-startup 3000
  5. Set the maximum number of ECMP routes that OSPF can support using the following command. For command details, seemaximum-paths.

    maximum-paths

    For example, the following command sets the maximum number of ECMP routes to 8.
    switch(config-ospf-1)#maximum-paths 8