{"id":120,"date":"2014-02-25T21:24:42","date_gmt":"2014-02-25T21:24:42","guid":{"rendered":"https:\/\/learncisco.net\/index.php\/configuring-ospf\/"},"modified":"2023-01-10T04:25:57","modified_gmt":"2023-01-09T21:25:57","slug":"configuring-ospf","status":"publish","type":"page","link":"https:\/\/www.learncisco.net\/courses\/cisco-ccna\/an-overview-of-ospf\/configuring-ospf.html","title":{"rendered":"Configuring OSPF"},"content":{"rendered":"

After identifying the OSPF process, you need to identify the interfaces that you want to activate OSPF communications on as well as the area in which each resides. This will also configure the networks you’re going to advertise to others. OSPF uses wildcards in the configuration. Also, when you configuring an OSPF routing, you need to define ID number of the process which is irrelevant. It can be the same on every router on the network, or it can be different-doesn’t matter. It’s locally significant and just enables the OSPF routing on the router. The value of the Process ID must be in the range of 1 – 65 535. The areas can be any number from 0 to 4 294 967 295.<\/p>\n

OSPF configuration use wildcards instead of network masks. The calculation of the wildcards is easy. The only thing that you need to remember is that they’re always one less than the block size. A \/25 is a block size of 128, so we’d add our network statement using the subnet number and then add a wildcard of 127; \/28 is a block size of 16, so the wildcard in the end will be 15. For the \/30, which is a block size of 4, we’d use a wildcard of 3, etc.<\/p>\n

Let’s use our known figure as an example and configure that network with OSPF using wildcards to make sure you have a solid grip on this. Thw following figure shows a four-router network with the IP addresses of each interface. I use this example in the EIGRP configuration and because of the AD (Administrative Distance) I need to stop the EIGRP process.<\/p>\n

\"OSPF<\/p>\n

The configuration for each router must be something like the following code:<\/p>\n

R1#conf t
\nEnter configuration commands, one per line. End with CNTL\/Z.
\nR1(config)#no router eigrp 10
\nR1(config)#
\nR1(config)#router ospf ?
\n<1-65535>\u00a0\u00a0Process ID<\/code><\/p>\n

R1(config)#router ospf 123
\nR1(config-router)#
\nR1(config-router)#net 10.10.1.0 0.0.0.255 ?
\narea\u00a0\u00a0Set the OSPF area ID<\/p>\n

R1(config-router)#net 10.10.1.0 0.0.0.255 area ?
\n<0-4294967295> OSPF area ID as a decimal value
\nA.B.C.D\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0OSPF area ID in IP address format<\/p>\n

R1(config-router)#net 10.10.1.0 0.0.0.255 area 0
\nR1(config-router)#net 10.10.4.0 0.0.0.255 area 0
\nR1(config-router)#
\nR1(config-router)#end
\nR1#<\/p><\/blockquote>\n

The routing table in router R3 is the following:<\/p>\n

R3#sh ip route
\nCodes: C - connected, S - static, R - RIP, M - mobile, B - BGP<\/code><\/p>\n

D – EIGRP, EX – EIGRP external, O – OSPF, IA – OSPF inter area
\nN1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2
\nE1 – OSPF external type 1, E2 – OSPF external type 2
\ni – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
\nia – IS-IS inter area, * – candidate default, U – per-user static route
\no – ODR, P – periodic downloaded static route<\/p>\n

Gateway of last resort is not set<\/p>\n

10.0.0.0\/24 is subnetted, 5 subnets
\nO\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a010.10.1.0 [110\/2] via 10.10.4.1, 00:01:26, FastEthernet0\/1
\nO\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a010.10.2.0 [110\/1564] via 10.10.4.1, 00:01:26, FastEthernet0\/1
\nC\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a010.10.3.0 is directly connected, Serial1\/0
\nC\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a010.10.4.0 is directly connected, FastEthernet0\/1
\nO\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a010.10.10.0 [110\/65] via 10.10.3.1, 00:01:26, Serial1\/0
\nR3#<\/p><\/blockquote>\n

Again, as in the EIGRP here we have the routing to the 10.10.1.0\/24 network directly through R1 router. Look at the metric of the route to 10.10.1.0\/24. Because it is connected through two Fast Ethernet links, each of them has metric of 1. If I shut down the interface FE0\/1 on router R3, which is the direct connection to rouer R1, then we will have the following routing table:<\/p>\n

R3(config-if)#do sh ip route
\nCodes: C - connected, S - static, R - RIP, M - mobile, B - BGP<\/code><\/p>\n

D – EIGRP, EX – EIGRP external, O – OSPF, IA – OSPF inter area
\nN1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2
\nE1 – OSPF external type 1, E2 – OSPF external type 2
\ni – IS-IS, su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
\nia – IS-IS inter area, * – candidate default, U – per-user static route
\no – ODR, P – periodic downloaded static route<\/p>\n

Gateway of last resort is not set<\/p>\n

10.0.0.0\/24 is subnetted, 5 subnets
\nO\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a010.10.1.0 [110\/1627] via 10.10.3.1, 00:00:08, Serial1\/0
\nO\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a010.10.2.0 [110\/1626] via 10.10.3.1, 00:00:08, Serial1\/0
\nC\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a010.10.3.0 is directly connected, Serial1\/0
\nC\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a010.10.4.0 is directly connected, FastEthernet0\/1
\nO\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a010.10.10.0 [110\/65] via 10.10.3.1, 00:00:08, Serial1\/0
\nR3(config-if)#<\/p><\/blockquote>\n

As you see, we have our rebuilded routing table with 10.10.3.1 as a next hop for all networks. The metric now is worse but it is a backup, so it is better then nothing, right?<\/p>\n

Hint<\/b>: When you are in global configuration mode you can execute commands which can be executed only in privileged mode, with adding\u00a0do<\/b>\u00a0command in front of them as it is shown in the example above.<\/p>\n","protected":false},"excerpt":{"rendered":"After identifying the OSPF process, you need to identify the interfaces that you want to activate OSPF communications on as well as the area in which each resides. This will also configure the networks you’re going to advertise to others. OSPF uses wildcards in the configuration. Also, when you configuring an OSPF routing, you need … Read more<\/a>","protected":false},"author":5,"featured_media":0,"parent":273,"menu_order":83,"comment_status":"closed","ping_status":"closed","template":"cisco-page.php","meta":{"_acf_changed":false,"footnotes":""},"acf":[],"yoast_head":"\nConfiguring OSPF - learncisco.net<\/title>\n<meta name=\"description\" content=\"This article explains the configuration of ospf. Which is after identifying the OSPF process, you need to identify the interfaces.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.learncisco.net\/courses\/cisco-ccna\/an-overview-of-ospf\/configuring-ospf.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Configuring OSPF - learncisco.net\" \/>\n<meta property=\"og:description\" content=\"This article explains the configuration of ospf. Which is after identifying the OSPF process, you need to identify the interfaces.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.learncisco.net\/courses\/cisco-ccna\/an-overview-of-ospf\/configuring-ospf.html\" \/>\n<meta property=\"og:site_name\" content=\"learncisco.net\" \/>\n<meta property=\"article:modified_time\" content=\"2023-01-09T21:25:57+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.learncisco.net\/courses\/cisco-ccna\/an-overview-of-ospf\/configuring-ospf.html\",\"url\":\"https:\/\/www.learncisco.net\/courses\/cisco-ccna\/an-overview-of-ospf\/configuring-ospf.html\",\"name\":\"Configuring OSPF - learncisco.net\",\"isPartOf\":{\"@id\":\"https:\/\/www.learncisco.net\/#website\"},\"datePublished\":\"2014-02-25T21:24:42+00:00\",\"dateModified\":\"2023-01-09T21:25:57+00:00\",\"description\":\"This article explains the configuration of ospf. Which is after identifying the OSPF process, you need to identify the interfaces.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.learncisco.net\/courses\/cisco-ccna\/an-overview-of-ospf\/configuring-ospf.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.learncisco.net\/courses\/cisco-ccna\/an-overview-of-ospf\/configuring-ospf.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.learncisco.net\/courses\/cisco-ccna\/an-overview-of-ospf\/configuring-ospf.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.learncisco.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Cisco Certification Courses\",\"item\":\"https:\/\/www.learncisco.net\/courses.html\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"CCNA 200-301\",\"item\":\"https:\/\/www.learncisco.net\/courses\/cisco-ccna.html\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"An Overview of OSPF\",\"item\":\"https:\/\/www.learncisco.net\/courses\/cisco-ccna\/an-overview-of-ospf.html\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Configuring OSPF\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.learncisco.net\/#website\",\"url\":\"https:\/\/www.learncisco.net\/\",\"name\":\"learncisco.net\",\"description\":\"Free online tests for the Cisco CCNA and CCNP exams. Test yourself with more than 4300 different questions.\",\"publisher\":{\"@id\":\"https:\/\/www.learncisco.net\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.learncisco.net\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.learncisco.net\/#organization\",\"name\":\"learncisco.net\",\"url\":\"https:\/\/www.learncisco.net\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.learncisco.net\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.learncisco.net\/wp-content\/uploads\/2021\/12\/logo-1.png\",\"contentUrl\":\"https:\/\/www.learncisco.net\/wp-content\/uploads\/2021\/12\/logo-1.png\",\"width\":154,\"height\":24,\"caption\":\"learncisco.net\"},\"image\":{\"@id\":\"https:\/\/www.learncisco.net\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Configuring OSPF - learncisco.net","description":"This article explains the configuration of ospf. Which is after identifying the OSPF process, you need to identify the interfaces.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.learncisco.net\/courses\/cisco-ccna\/an-overview-of-ospf\/configuring-ospf.html","og_locale":"en_US","og_type":"article","og_title":"Configuring OSPF - learncisco.net","og_description":"This article explains the configuration of ospf. Which is after identifying the OSPF process, you need to identify the interfaces.","og_url":"https:\/\/www.learncisco.net\/courses\/cisco-ccna\/an-overview-of-ospf\/configuring-ospf.html","og_site_name":"learncisco.net","article_modified_time":"2023-01-09T21:25:57+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.learncisco.net\/courses\/cisco-ccna\/an-overview-of-ospf\/configuring-ospf.html","url":"https:\/\/www.learncisco.net\/courses\/cisco-ccna\/an-overview-of-ospf\/configuring-ospf.html","name":"Configuring OSPF - learncisco.net","isPartOf":{"@id":"https:\/\/www.learncisco.net\/#website"},"datePublished":"2014-02-25T21:24:42+00:00","dateModified":"2023-01-09T21:25:57+00:00","description":"This article explains the configuration of ospf. Which is after identifying the OSPF process, you need to identify the interfaces.","breadcrumb":{"@id":"https:\/\/www.learncisco.net\/courses\/cisco-ccna\/an-overview-of-ospf\/configuring-ospf.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.learncisco.net\/courses\/cisco-ccna\/an-overview-of-ospf\/configuring-ospf.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.learncisco.net\/courses\/cisco-ccna\/an-overview-of-ospf\/configuring-ospf.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.learncisco.net\/"},{"@type":"ListItem","position":2,"name":"Cisco Certification Courses","item":"https:\/\/www.learncisco.net\/courses.html"},{"@type":"ListItem","position":3,"name":"CCNA 200-301","item":"https:\/\/www.learncisco.net\/courses\/cisco-ccna.html"},{"@type":"ListItem","position":4,"name":"An Overview of OSPF","item":"https:\/\/www.learncisco.net\/courses\/cisco-ccna\/an-overview-of-ospf.html"},{"@type":"ListItem","position":5,"name":"Configuring OSPF"}]},{"@type":"WebSite","@id":"https:\/\/www.learncisco.net\/#website","url":"https:\/\/www.learncisco.net\/","name":"learncisco.net","description":"Free online tests for the Cisco CCNA and CCNP exams. Test yourself with more than 4300 different questions.","publisher":{"@id":"https:\/\/www.learncisco.net\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.learncisco.net\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.learncisco.net\/#organization","name":"learncisco.net","url":"https:\/\/www.learncisco.net\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.learncisco.net\/#\/schema\/logo\/image\/","url":"https:\/\/www.learncisco.net\/wp-content\/uploads\/2021\/12\/logo-1.png","contentUrl":"https:\/\/www.learncisco.net\/wp-content\/uploads\/2021\/12\/logo-1.png","width":154,"height":24,"caption":"learncisco.net"},"image":{"@id":"https:\/\/www.learncisco.net\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.learncisco.net\/wp-json\/wp\/v2\/pages\/120"}],"collection":[{"href":"https:\/\/www.learncisco.net\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.learncisco.net\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.learncisco.net\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.learncisco.net\/wp-json\/wp\/v2\/comments?post=120"}],"version-history":[{"count":2,"href":"https:\/\/www.learncisco.net\/wp-json\/wp\/v2\/pages\/120\/revisions"}],"predecessor-version":[{"id":1019,"href":"https:\/\/www.learncisco.net\/wp-json\/wp\/v2\/pages\/120\/revisions\/1019"}],"up":[{"embeddable":true,"href":"https:\/\/www.learncisco.net\/wp-json\/wp\/v2\/pages\/273"}],"wp:attachment":[{"href":"https:\/\/www.learncisco.net\/wp-json\/wp\/v2\/media?parent=120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}