Networks Training

  • About
  • My Books
  • IP Tools
  • HOME
  • Cisco Networking
    • Cisco General
    • Cisco IOS
    • Cisco VPN
    • Cisco Wireless
  • Cisco ASA
    • Cisco ASA General
    • Cisco ASA Firewall Configuration
  • Certifications Training
    • CCNA Training
    • Cisco Certifications
    • I.T Training
  • General
    • Tech News
    • General Networking
    • IP Telephony
    • Network Security
    • Product Reviews
    • Software
  • Cisco Routers
  • Cisco Switches
You are here: Home / Cisco Routers / Redistribution and OSFP – Discussion With Cisco Commands Examples

Redistribution and OSFP – Discussion With Cisco Commands Examples

Edited By Lazaros Agapidis

Redistribution in networks and in particular, in the context of IP routing, refers to the process of transferring or injecting routing information from one routing protocol or domain, into another.

cisco ospf eigrp redistribution

OSPF, as a routing protocol, can either be the protocol from which routes are redistributed, into which routes are redistributed, or both!

In this article, we’ll examine the ways in which redistribution takes place in OSPF, and the various aspects and implications that should be considered when designing such networks.

We’ll also take a look at a few Cisco IOS command line configuration examples to gain a clearer understanding of these mechanisms and how they are applied.

Table of Contents

Toggle
  • Routing Redistribution
  • Redistribution and OSPF
    • Connected routes
    • Static routes
    • EIGRP learned routes
    • BGP learned routes
  • Additional Parameters
    • Adjusting the metric
    • Adjusting the metric-type
    • Using Route-Maps
    • Some Other Parameters
  • Redistribution best practices
  • Conclusion
    • Related Posts

Routing Redistribution

Redistribution is a process that can take place between two different routing protocols, between static routing and a dynamic routing protocol, or even between two domains running autonomous instances of the same routing protocol.

Because different routing protocols use different ways of measuring the metric of a particular route, it is important to ensure that the metric or cost of the redistributed route is appropriately gauged to ensure predictable results.

Within a Cisco IOS device, redistribution is performed under the router configuration mode of the routing protocol being configured using the redistribute command. This command deals with how routes are redistributed into the routing protocol in question.

Redistribution and OSPF

In our examination of redistribution in OSPF, we’ll be looking at how redistribution takes place into OSPF from various other routing information sources.

As such, our discussion will focus primarily on the redistribute command found under the OSPF router configuration mode.

Looking at this command, we can see the various options that are available within a Cisco IOS router using the context sensitive help of the CLI:

R1(config)#router ospf 1
R1(config-router)#redistribute ?
application Application
bgp Border Gateway Protocol (BGP)
connected Connected
eigrp Enhanced Interior Gateway Routing Protocol (EIGRP)
isis ISO IS-IS
iso-igrp IGRP for OSI networks
lisp Locator ID Separation Protocol (LISP)
maximum-prefix Maximum number of prefixes redistributed to protocol
mobile Mobile routes
odr On Demand stub Routes
ospf Open Shortest Path First (OSPF)
ospfv3 OSPFv3
rip Routing Information Protocol (RIP)
static Static routes
vrf Specify a source VRF

The actual options you may see on your router from this context sensitive help may be slightly different depending on the platform and version.

You can see however that there are several options from which redistribution can take place, including directly connected networks, static routes, and routes learned via BGP, EIGRP, IS-IS, RIP, and even from other OSPF domains!

Let’s take a closer look at some of these:

Connected routes

Routers typically have one or more interfaces connected to a particular subnet. There are a couple of ways to advertise those connected networks. If you want to enable OSPF on a particular interface, you would typically use the network command.

However, it is possible to advertise a directly connected network without enabling OSPF on that interface! This can be done using the redistribute connected command like so:

MORE READING:  The Purpose of Routing Protocols in TCP/IP Networking

R1(config-router)#redistribute connected

This command alone will redistribute all of the networks configured on all of the interfaces of the router without enabling OSPF on those interfaces.

What this means is that the interfaces themselves won’t send and receive OSPF messages attempting to form OSPF adjacencies, but their networks will be advertised by OSPF.

Static routes

Any statically configured routes on a router can be redistributed into OSPF using the following command:

R1(config-router)#redistribute static

Any configured static routes on the router will be redistributed into the OSPF routing domain and will be advertised to OSPF neighbors.

EIGRP learned routes

To redistribute routes learned via EIGRP into OSPF, you can use the following command:

R1(config-router)#redistribute eigrp 100

This command requires that you also specify the EIGRP Autonomous System number from which to redistribute routes.

In the above command, the AS number of 100 is used. This way you are able to redistribute from multiple EIGRP processes that may be running on the router.

BGP learned routes

You can also redistribute BGP routes into OSPF using the following command:

R1(config-router)#redistribute bgp 20

Just like the EIGRP command, when redistributing from BGP you must specify the BGP AS number from which to redistribute routes. In the above example, redistribution is taking place from the BGP AS of 20 into OSPF.

Additional Parameters

The logic of redistribution follows much the same process as the above examples for all redistribution options.

However, for each of these redistribution sources, you can adjust additional parameters to control how OSPF perceives these redistributed routes.

Let’s take a look at some more context sensitive help. For our example, let’s use the static option, but keep in mind that you will see the same options for any routing source you choose:

R1(config-router)#redistribute static ?
metric Metric for redistributed routes
metric-type OSPF/IS-IS exterior metric type for redistributed routes
nssa-only Limit redistributed routes to NSSA areas
route-map Route map reference
subnets Consider subnets for redistribution into OSPF
tag Set tag for routes redistributed into OSPF
<cr> <cr>

As you can see, there are several options. Let’s examine some of those options further.

Adjusting the metric

When you redistribute into OSPF, if you don’t specify a metric, a default value of 20 is used for all types of redistributed routes. You can change this value like so:

R1(config-router)#redistribute static metric 50

The above command will assign a default metric of 50 to all static routes redistributed into OSPF.

Adjusting the metric-type

OSPF has a hierarchical nature employing OSPF areas to maintain a more efficient routing process. As such, it contains various types of routes including two external type routes. These are denoted as E1 and E2.

E2 routes maintain the original metric they were assigned upon redistribution throughout the OSPF domain. That means that as an E2 route is advertised to neighboring OSPF routers within the same area and in different areas, its metric remains the same.

MORE READING:  EIGRP Variance and Unequal Cost Load Balancing in Networking

Conversely, E1 routes, as they are advertised throughout the OSPF domain, accumulate the metric that corresponds to the internal OSPF in addition to the original cost assigned at redistribution.

The metric-type keyword can be used to modify the type of external route that will be redistributed into the OSPF domain. By default, the metric-type assigned is an E2 route, but this can be changed like so:

R1(config-router)#redistribute static metric-type 1

The above command causes all static routes redistributed into OSPF to be E1 type external routes.

Using Route-Maps

The redistribute command applies to all routes learned from the specified source. However, it is possible to more granularly choose which of those routes will be redistributed and which will not. This can be done using route maps.

All redistribution commands allow for the specification of a route map to filter out the desired routes to be redistributed. This can be done like so:

R1(config-router)#redistribute static route-map My_Route_Map

This requires that you configure a route map that will appropriately filter out the routes that you do not wish to redistribute.

Some Other Parameters

The other parameters that are available for these commands are briefly described below:

nssa-only – This keyword can be used on a router that is in a Not So Stubby Area (NSSA). This keyword ensures that redistributed routes are injected only into the NSSA as Type 7 LSAs and are not advertised outside the NSSA into the broader OSPF domain as Type 5 LSAs.

subnets – By default OSPF redistributes only classful routes. The subnets keyword includes subnetted routes (i.e. routes with subnet masks more specific than the classful default values). This keyword should typically be used on all modern networks.

tag – This keyword is used to assign an optional 32-bit identifier (or “tag”) to redistributed routes. This tag is stored in the OSPF database and is primarily used for policy control, route filtering, and preventing routing loops when redistributing between multiple routing domains.

Redistribution best practices

Here are some best practices to keep in mind when applying redistribution in OSPF networks:

  • Control redistribution with route maps: Use route maps to filter and modify routes during redistribution to limit the routes being redistributed, thus avoiding overloading the OSPF domain.
  • Use the subnets keyword: Always include the subnets keyword to ensure both classful and subnetted routes are redistributed. Since most modern networks typically use classless IP addressing, this will result in more efficient route redistribution.
  • Tag routes for identification and loop prevention: Use route tagging whenever you have multiple redistribution points between two routing domains to avoid routing loops in multi-protocol environments.
  • Set appropriate metrics: In some cases, the default metric may result in inappropriate or undesirable routing behavior. Whenever necessary, specify an explicit metric to control route preference.
  • Minimize points of redistribution: Redistribute routes at as few points as possible to reduce complexity and avoid routing loops.

Conclusion

Effective OSPF redistribution requires careful planning and the use of tools like route maps, tags, and explicit metrics to control and optimize routing behavior.

By adhering to best practices, such as minimizing redistribution points and ensuring the inclusion of subnetted routes, you can maintain a stable, scalable, and efficient network.

Spread the love

Related Posts

  • EIGRP Variance and Unequal Cost Load Balancing in Networking
  • Comparison of Reported Distance vs Feasible Distance in EIGRP
  • Explanation and Comparison of OSPF E1 vs E2 Routes
  • Discussion and Explanation of OSPF Graceful Restart and Shutdown
  • Explanation and Configuration of OSPF MD5 Authentication on Cisco Networks

Filed Under: Cisco Routers, General Networking

Download Free Cisco Commands Cheat Sheets

Enter your Email below to Download our Free Cisco Commands Cheat Sheets for Routers, Switches and ASA Firewalls.

By subscribing to our email list you will be receiving technical tutorials and industry news from time-to-time. You can unsubscribe at any time.

About Lazaros Agapidis

Lazaros Agapidis is a Telecommunications and Networking Specialist with over twenty years of experience.
He works primarily with IP networks, VoIP, Wi-Fi, and 5G, has extensive experience in training professionals for Cisco certifications, and his expertise extends into telecommunications services and infrastructure from both an enterprise and a service provider perspective.
In addition to his numerous vendor certifications, Lazaros has a solid online presence as an expert in his field, having worked in both public and private sectors within North America and in Europe.
He has enjoyed sharing his practical experiences in writing as well as through engaging online training.
LinkedIn: Lazaros Agapides

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search this site

About Networks Training

We Provide Technical Tutorials and Configuration Examples about TCP/IP Networks with focus on Cisco Products and Technologies. This blog entails my own thoughts and ideas, which may not represent the thoughts of Cisco Systems Inc. This blog is NOT affiliated or endorsed by Cisco Systems Inc. All product names, logos and artwork are copyrights/trademarks of their respective owners.

Amazon Disclosure

As an Amazon Associate I earn from qualifying purchases.
Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.

Search

BLOGROLL

Tech21Century
Firewall.cx

Copyright © 2026 | Privacy Policy | Terms and Conditions | Contact | Amazon Disclaimer | Delivery Policy