How to Configure OSPF on Cisco Router in GNS3

If you’re getting ready for Cisco exams, do you want help with setting up OSPF on Routers using GNS3? In this easy-to-understand article, we’ll talk about OSPF, which stands for Open Shortest Path First.

With GNS3, you can simulate and try out real network situations. People who work with networks and students use this software a lot to understand how networks work. Thus, they can become proficient at different protocols like OSPF.

How to Configure OSPF on Cisco Router in GNS3

Why Do We Configure OSPF on Cisco Router?

OSPF is like a helpful tool that sends the best directions for information in a network. This is a link-state redirect. That’s why they use it widely in large enterprise networks because it is an internal gateway protocol (IGP).

1. Efficient Routing

This protocol looks at calculations based on the connection status of Routers using a hierarchical network structure. Then, it figures out the quickest path to where things need to go and sends the info along that path.

If something goes wrong with the Routers or ports in the network, OSPF quickly steps in and fixes it. It adapts swiftly and efficiently to changes in topology. This helps businesses keep running smoothly by making sure the network works well.

Also, it tells others about the best ways to send information very fast. This way, it makes a complete map of the network.

2. Scalability

Using this on a Cisco Router has another good point – it can handle a lot of growth. Because of that, they designed it to work well with extensive networks that have thousands of devices. So, as your network gets bigger, it can change and organize itself to handle it. This way, you can be sure your network stays solid and trustworthy.

Being able to grow is super essential in spots where networks are getting bigger or need a lot of traffic. In simple terms, you can easily add new routers without messing up everything. Plus, you can reconfigure existing devices.

3. Error Tolerance

This protocol set of rules also makes it easier for Cisco devices to handle problems. So you can quickly find and repair any issues in the network.

So, it quickly changes the way information travels if something goes wrong. In simple terms, you can make sure the network keeps going without any stops, even if a connection is lost.

4. Load Balancing

Your OSPF setup also brings another good thing: load balancing. This means you stop one path from getting too crowded by spreading the network traffic out on different paths. So, with load balancing, you make sure the network works well and is manageable.

When you use this feature on devices that have lots of traffic, it works really well. So, you can use the network resources smartly by using all the different paths available.

5. Security

Turning on OSPF on a Cisco Router makes the network more secure, for sure. Thus, you can use authentication to check the integrity of routing information between devices. This way, with the code, only devices you trust can be part of the network.

In simple terms, you stop devices that shouldn’t be there from messing with how the network decides to send information. This way, you prevent bad stuff from getting into the system. So, for businesses and groups, this set of rules is essential and keeps the whole setup safe.

How to Enable OSPF Routing on GNS3

When you set up OSPF on a network, Routers talk to each other using the same AS (Autonomous System) number. But you can also make them talk to devices in different groups with different AS numbers. Basically, every Router in the AS knows about all the network layouts. So they can quickly figure out the best way to get to the destination.

Also, OSPF is like the EIGRP protocol. But, the big difference is that EIGRP only works with Cisco devices. So, using this is excellent because it works with devices from both Cisco and other brands.

Before You Start

Before you begin doing the OSPF stuff in GNS3 networking software, you should know about these things:

  • Router ID: This is a unique number given to each device on the network so we can tell them apart.
  • Area ID: This is like a group ID for devices in the network. It helps organize and group them logically.
  • Network ID: It refers to a unique group assigned to each network.
  • Interface: This is the physical or virtual link on the Router that connects to a network.

Creating a New OSPF Topology in GNS3

First, you must make a new setup for OSPF on GNS3. After you finish that, you can start using this excellent routing plan.

All you need are GNS3, two Routers, Switches, and VMware virtual machines. You can include your VMs running on VMware Workstation using Cloud PC. This helps you learn how the protocol works in a more advanced way.

Step 1

Now, start the GNS3 program for the link state protocol and create a new project.

Creating a New Project for OSPF in GNS3

Step 2

Make a network setup like the picture below, just as we did. Also, it’s a good idea to give names or descriptions to the different parts. This way, it will be easier to understand how you set up the network.

OSPF AREA 0 Network Topology

Step 3

Make two pretend computers in your VMware program. Then, make sure you set the virtual network settings correctly. In this guide, we’re using Windows 8.1 and 10. But you can use newer or older ones if you like.

Finally, select VMnet1 in the Windows 8.1 VM settings, as shown in the image below.

Setting Network Adapter of Windows 8 VM to VMnet1

Step 4

Likewise, you should take a look at the Windows 10 virtual machine network card settings. So, check that you have selected VMnet2 on the guest machine’s screen.

Setting Network Adapter of Windows 10 VM to VMnet2

Step 5

You should check the VMnet settings in VMware Virtual Network Editor. Thus, you set VMnet1 for Win8 and VMnet2 for Win10.

Configuring the IP Block of VMnet1 and VMnet2

Step 6

Next, start the virtual computers in the VMware tool. And set up the TCP/IP settings based on the subnet you decided on. For example, you can check out the IP details for Win8 in the picture below.

Configuring TCP/IP Settings of Win8 VM

Step 7

Set up the TCP/IP settings for the virtual Win10 computer in the Workstation like this:

Configuring TCP/IP Settings of Win10 VM

Configuring Ports of Cisco Routers

Until now, you’ve just arranged the network and adjusted TCP/IP settings. Now, the next thing is to make OSPF routing work on the Cisco Routers you put into the workspace.

Step 1

Now, set up the FastEthernet and Serial connections on the Cisco R1. To do this, follow these commands on the R1 CLI screen.

You also want to double-check the changes you made on Cisco R1. To do that, see the status by typing “show ip interface brief” in the CLI.

R1#conf t
R1(config)#interface fastethernet 0/0
R1(config-if)#ip address 192.168.5.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface serial 0/0
R1(config-if)#ip address 10.1.1.1 255.255.255.252
R1(config-if)#no shutdown
R1(config-if)#end

Assigning IP to FastEthernet and Serial Ports of Cisco Router R1

Step 2

Similarly, arrange the FastEthernet and Serial parts on Cisco R2 as per the plan. After that, see the status of the ports using the same command we used before.

R2#conf t
R2(config)#interface fastethernet 0/1
R2(config-if)#ip address 192.168.10.1 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface serial 0/1
R2(config-if)#ip address 10.1.1.2 255.255.255.252
R2(config-if)#no shutdown
R2(config-if)#end

Assigning IP to Ports of Cisco Router R2

Step 3

So far, you have set up the FastEthernet and Serial parts on the Routers. But you haven’t turned on any routing plans on the network devices yet. To see this more clearly, check the connection between VMs.

Now, try pinging R1 from the Win8.1 machine to see if they’re connected. Then, check if Win8.1 can reach R2 as well.

Ping Test from Win8 PC to Own Network and Opposite LAN

Step 4

Do the same operations on the Win10 machine. In both ping tests, you will see that the opposite network will fail. In summary, PCs can only start pinging on the ports of the routers to which they have a direct connection.

They can’t ping the other network because OSPF isn’t turned on in the setup yet!

Ping Test from Win10 PC to Own Network and Opposite LAN

Enabling OSPF Protocol on Cisco Routers

Now, you have to turn on the routing feature on the Routers at the topology. This way, Win8 and Win10 machines can talk to each other.

Step 1

To enable OSPF, open the command thingy on the Cisco Router R1. Then, type these commands one by one on the command screen.

R1#conf t
R1(config)#router ospf 10
R1(config-router)#network 192.168.5.0 0.0.0.255 area 0
R1(config-router)#network 10.1.1.0 0.0.0.3 area 0
R1(config-router)#end

Enabling OSPF on Router R1 in GNS3

Step 2

Of course, you also need to enable it in the other Router, R2. If you skip this, the devices won’t be able to tell each other about their topology info.

R2#conf t
R2(config)#router ospf 10
R2(config-router)#network 192.168.10.0 0.0.0.255 area 0
R2(config-router)#network 10.1.1.0 0.0.0.3 area 0
R2(config-router)#
R2(config-router)#end

Enabling OSPF on Router R2

NOTE: Once you enable it on R2, you’ll notice a message on the screen. It goes like this: “*Mar 1 00:18:09.227: %O-S-P-F-5-ADJCHG: Process 10, Nbr 192.168.5.1 on Serial0/1 from LOADING to FULL, Loading Done.” This tells you that R1’s serial part, with the address 192.168.5.1, is starting to work together with R2.

Step 3

You need to make sure OSPF is doing its job on the Routers in GNS3. So, look at the route information by typing “show ip route” on both R1 and R2.

Using the "show ip route" Command on Routers

Testing the Network Connection of PCs

Step 1

Now, routers share topology info in the workspace. If the route info looks good, try pinging from the VMware machines.

Now, ping the other Win8 VM and check the process.

Pinging Win10 from Win8 PC Successful

Step 2

Like the image below, ping from the Win10 PC to the opposite network is successful. So, you will be able to access the 5.0/24 network without any problems.

Pinging Win8 from Win10 PC Successful

Reviewing OSPF Show Commands in GNS3

We finished the OSPF setup without any issues. Now, let’s check out the show commands on the Routers.

Step 1

In the CLI screen of Cisco R1, use these show commands:

  • show ip ospf neighbor: This command tells you about the neighbors and their status.
  • show ip ospf database: This command tells you about the routers’ status, connections, and other setup details.

Using the "show ip ospf neighbor and database" Command on Router R1

Step 2

Run the above commands on R2 and examine them.

Reviewing Routing Routes in R2

Step 3

You can use “debug ip ospf hello” to check on the routing feature. So, this command lets you see extra details about the “hello” messages.

The Hello message keeps good relationships between neighboring devices. In short, it sends these messages using the Multicast address (224.0.0.5).

Now, execute the “debug ip ospf hello” command on the R1 device and see the results.

Using the "debug ip ospf hello" Command to Check for OSPF Errors

Step 4

You can check out the hello messages by typing the same command on R2.

Checking OSPF Hello Packets on Cisco Router R2

Step 5

You have made all the settings for OSPF on Cisco Routers R1 and R2. Now, you need to check the settings more briefly. The most basic way to do this is to use the “show running-config” command.

So the running configuration settings on R1 and R2 are:

Examining the "show running-config" Command on Cisco Devices

Checking OSPF with Wireshark

Another way to make sure this routing is working is to use Wireshark. With this program, you can check not only the routing plans but also all the data going through.

Step 1

Now, press the right button and choose “Start Capture” on the serial cable between the Routers.

Analyzing the Connection Between Cisco Routers with Wireshark

Step 2

You’ll open a window where you capture packets. Look at the part that says “File name.” Then click the OK to begin the analysis.

Choosing the Interface for Packet Capture

Step 3

Once you pick the interface, Wireshark opens up. Now, take a look at the Hello packets moving between the Routers in the topology.

You can make sure it is working by checking that it sends hello messages using Multicast (224.0.0.5).

Checking OSPF Hello Packets with Wireshark

Our YouTube Video for OSPF Training with GNS3

We made a tutorial video on YouTube to help you understand these setup steps more easily. We hope you check out the video below and help us find an easier way to set up Cisco OSPF.

Frequently Asked Questions (FAQ)

  1. How do I check if my Cisco Router supports OSPF?
Many Cisco Router models can use OSPF. But, to be sure, look at your network device’s instructions to check if it supports this protocol. Or, you can check the Cisco website for your specific model.
  1. What are the prerequisites for configuring OSPF?
Before you start setting things up, it’s good to know about IP addresses, splitting up networks, and how routing works. Also, having some know-how about using commands in the command line on Cisco Routers is helpful.
    1. How to troubleshoot OSPF problems?
If you are experiencing problems with this protocol, you should first verify the configuration. To do this, execute the “show ip ospf interface” and “show ip ospf neighbor” commands. Moreover, you can check the routing tables. For example, use the “show ip route” command to verify that your device contains the correct routes. Also, test the connection between the Routers with the ping command. Finally, you can check the event logs for OSPF. To do this, you can use the “show logging” command. In this case, you can check if your device gives an error or warning.

Conclusion

So, in the end, OSPF helps organizations handle their networks well. It’s a good tool for inside networks because it gives intelligent routing. Also, it grows as the network does, deals with problems, spreads out network traffic, and keeps things safe. Plus, it is excellent for taking care of extensive networks with lots of devices.

To sum up, you can set up OSPF on your Cisco Router using GNS3 by following the easy steps in this guide. This way, you can handle your network like a pro and get ready for Cisco exams.

Related Articles

1) RIP Review with GNS3
2) Static Routing with GNS3
3) RIP Version 2 Review with GNS3
4) EIGRP Operation on Router
5) Examining Static NAT on Cisco Device

Add a Comment

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