Welcome ! This tutorial will give you an easy guide of configuring basic OSPF on a Cisco Router. But just before we get to configure, let’s have an overview of OSPF.
About OSPF
Open Shortest Path First(OSPF) is one of the dynamic routing protocols amongst others such as EIGRP, BGP and and RIP. It is perhaps one of the most popular link state routing protocols. It is an open standard, so it can be run on routers from different vendors.
OSPF supports key features such as:
- IPv4 and IPv6 routing
- Classless routing
- Equal cost load balancing,
- Manual route summarization, etc.
OSPF has a default administrative distance of 110. It uses cost as the parameter for determining route metric. It uses the multicast address of 224.0.0.5 and 224.0.0.6 for communication between OSPF-enabled neighbors
Routers running OSPF need to establish a neighbor relationship before exchanging routing updates. Each OSPF router runs the SFP algorithm to calculate the best routes and adds them to the routing table.
OSPF routers store routing and topology information in three tables.:
- Neighbor table-which stores information about OSPF neighbors.
- Topology table-stores topology structure of the network.
- Routing table-stores the best routes
OSPF neighborhood discovery
Routers running OSPF need to establish a neighbor relationship before exchanging routing updates. OSPF neighbors are dynamically discovered by sending Hello packets out each OSPF-enabled interface on a router. Hello packets are sent to the multicast address of 224.0.0.5.
OSPF areas
An area is simply a logical grouping of adjacent networks and routers. All routers in the same area have the same topology table and don’t know about routers in other areas. The main benefits of using areas in an OSPF network are:
- Routing tables on the routers are reduced.
- Routing updates are reduced.
Each area in an OSPF network must be connected to the backbone area ( also known as area 0 ). All routers inside an area must have the same area ID .
A router that has interfaces in more than one area (for example area 0 and area 1) is known as an Area Border Router (ABR). A router that connects an OSPF network to other routing networks (for example, to an EIGRP network) is called an Autonomous System Border Router (ASBR).
For now we’ll configure basic OSPF. On to it then!
Basic OSPF configuration.
1. Build the network topology.
2.Configure IP addresses on PCs and router interfaces.
Router 1
R1(config)#int fa 0/0 R1(config-if)#ip add 10.0.0.1 255.0.0.0 R1(config-if)#no shut R1(config-if)# R1(config-if)#int serial 0/0/0 R1(config-if)#ip add 20.0.0.1 255.0.0.0 R1(config-if)#no shut
Router 2
R2(config-if)#int fa0/0 R2(config-if)#ip add 30.0.0.1 255.0.0.0 R2(config-if)#no shut R2(config-if)# R2(config-if)#int serial0/0/0 R2(config-if)#ip address 20.0.0.2 255.0.0.0 R2(config-if)#no shut
Now do IP configurations for the PCs.
PC1 IP add 10.0.0.2 Subnet mask 255.0.0.0 Default gateway 10.0.0.1
PC2 IP add 30.0.0.2 Subnet mask 255.0.0.0 Default gateway 30.0.0.1
3. Configure OSPF on the routers.
The configuration is pretty simple and requires only two major steps:
1. Enable OSPF on a router using the router ospf PROCESS_ID in the global configuration mode.
2.Define on which interfaces OSPF will run and what networks will be advertised using network IP_ADDRESS WILCARD_MASK AREA command in the OSPF configuration mode.
Note that the OSPF process ID doesn’t have to be the same on all routers in order for the routers to establish a neighbor relationship, but the area parameter has to be the same on all neighboring routers in order for the routers to become neighbors.
Router 1
R1(config)# R1(config)#router ospf 1 R1(config-router)#network 10.0.0.0 0.255.255.255 area 0 R1(config-router)#network 20.0.0.0 0.255.255.255 area 0
Router 2
R2(config)# R2(config)#router ospf 2 R2(config-router)#network 20.0.0.0 0.255.255.255 area 0 R2(config-router)#network 30.0.0.0 0.255.255.255 area 0
As you can see from the above picture,we just need to enable OSPF on the routers which then advertise the networks directly connected to each of them.
Have in mind: The OSPF process IDs used for the two routers have been made optionally different but their area numbers must be the same.
4. Verify OSPF configuration
First, let’s verify that the routers have established a neighbor relationship by typing the show ip ospf neighbor command on R1:
Next, to verify that R1 has learnt the route to 30.0.0.0/8 network, we’ll use show ip route ospf command on R1:
Note that the letter O indicates OSPF routes.
Lastly, verify connectivity. Ping PC2 from PC1. Ping should be successful.
Other OSPF verification commands
-
show ip ospf neighbors detail
-
show ip ospf database
-
show ip ospf interface
All the best!
You may also like to read:
- How to configure Multi-Area OSPF in Packet Tracer
- EIGRP configuration in Packet Tracer
- OSPFv3 (OSPF for IPv6) configuration in Packet Tracer
- EIGRPv6 configuration in Packet Tracer
References:
I am glad to see a positive comment from you.
LikeLike
THANKS
LikeLike
Heya! I just wanted to ask if you ever have any problems with hackers?
My lat blog (wordpress) was hacked and I ended up loskng many mohths of hard work due to no backup.
Do you have any methods to stop hackers?
LikeLike
Hi, I’m sorry for you, but I’ve never been hacked. Have you ever tried Sucuri WordPress security plugin? I think it can help a lot. Try also these powerful tips provided here: https://www.wpbeginner.com/beginners-guide/reasons-why-wordpress-site-gets-hacked/
LikeLike
hello!,I love your writing so much! percentage we keep in touch extra about your post
on AOL? I require a specialist on this house to solve my problem.
Maybe that’s you! Taking a look ahead to see you.
LikeLike
constantly i used to read smaller articles that
as well clear their motive, and that is also happening
with this article which I am reading at this time.
LikeLike
Thumbs up for you positive feedback
LikeLike
I enjoy what you guys are up too. This kind of clever work and exposure!
Keep up the fantastic works guys I’ve incorporated you guys to blogroll.
LikeLike
Hiya, I’m really glad I’ve found this information. Today bloggers publish only about gossips and web and this is really irritating. A good website with interesting content, this is what I need. Thank you for keeping this site, I will be visiting it. Do you do newsletters? Can’t find it.
LikeLike
Hi this is kinda of off topic but I was wanting to know if blogs use WYSIWYG editors or if you have to manually code with HTML. I’m starting a blog soon but have no coding know-how so I wanted to get advice from someone with experience. Any help would be greatly appreciated!
LikeLike
Thanks for a great blog site. The comments are a scream. How’s this one….” I’m typically to niece running a blog and i really respect your content. The article has actually speaks my interest.” Sounds like my Electric Drill Instruction manual.. Made in Chineseezia. 🙂
LikeLike
These are genuinely great ideas in concerning blogging.
You have touched some nice factors here. Any way keep up wrinting.
LikeLike
May I just say what a comfort to discover someone that really understands what
they’re talking about on the web. You actually know how to bring a problem to light
and make it important. A lot more people have to look at this and understand this side of your story.
It’s surprising you are not more popular given that you most certainly possess the gift.
LikeLike
You actually make it seem so easy with your presentation but I find this matter to be really something that I think I would never understand. It seems too complex and extremely broad for me. I am looking forward for your next post, I’ll try to get the hang of it!
LikeLike
“Hi! I just want to give you a huge thumbs up for your excellent info you’ve got right here on this post. I will be returning to your site for more soon.”
LikeLike
Have you ever considered about including a little bit more than just your articles? I mean, what you say is valuable and everything. But just imagine if you added some great graphics or video clips to give your posts more, “pop”! Your content is excellent but with images and clips, this site could definitely be one of the greatest in its niche. Very good blog!
LikeLike
Thanks for ones marvelous posting! I quite enjoyed reading it, you could be a great author.I will make sure to bookmark your blog and will eventually come back from now on. I want to encourage you to continue your great posts, have a nice holiday weekend!
LikeLike
I was more than happy to search out this internet-site.I needed to thanks on your time for this wonderful read!! I undoubtedly enjoying every little little bit of it and I’ve you bookmarked to take a look at new stuff you weblog post.
LikeLike
This blog was… how do you say it? Relevant!! Finally I’ve found something that helped me. Kudos!
LikeLike
I do not even know how I ended up here, but I thought this post was great.
I don’t know who yoou are but certainly yyou are going to a famous blogger if you are not alreaady 🙂
Cheers!
LikeLike
you are in point of fact a just right webmaster.
The website loading pace is incredible. It seems that you are doing any distinctive trick.
Furthermore, The contents are masterwork. you have performed a magnificent process on this
topic!
LikeLike
Its such as you learn my mind! You appear to grasp a lot about this, such as you wrote the e book in it or something. I think that you could do with a few p.c. to power the message home a bit, but instead of that, that is fantastic blog. A great read. I will certainly be back.
LikeLike
Wonderful blog! I found it while surfing around on Yahoo News. Do you have any tips on how to get listed in Yahoo News? I’ve been trying for a while but I never seem to get there! Cheers
LikeLike
you are really a good webmaster. The web site loading speed is incredible. It seems that you’re doing any unique trick. Also, The contents are masterwork. you’ve done a wonderful job on this topic!
LikeLike
Hello there! Would you mind iff I share your blog with my twittger group?
There’s a lot of pewople that I think would
really appreciate your content.Please let me know.
Thanks!
LikeLike
How do you know which wildcard mask to use? I don’t find that to be very clear.
LikeLike
This article is very helpful, and I got to understand the concept through this. when I implemented it step by step following this. the pcs are not pinged, the request times out and the message from 1 pc could not be received at second.
LikeLike