How to configure OSPF for CCNA students

HI all
I want information please i want know because there is the command ospf under standby group

thanks a lot

this is an example

standby XYZ ip x.y.z
standby XYZ timers msec 500 1
standby XYZ preempt
standby XYZ authentication md5
ip ospf 123 area 0

hello Ugo

The ip ospf 123 area 0 command can be implemented in either global configuration mode or interface mode. By implementing it in interface mode, you don’t have to specify the network area command which indicates the subnets participating in OSPF. In this case, it is the subnet of the specific interface that is participating in OSPF.

The command itself doesn’t have anything to do with HSRP. HSRP is configured on the interface, and so is OSPF in this case.

You can find out more about the OSPF interface mode configuration at the following Cisco documentation:

I hope this has been helpful!

Laz

Hi,

I’m wondering can you use vlan on layer 2 communication and ospf on layer 3 and how will that go?

Hello Sven

Yes, it is possible to do so, as these are completely independent functions operating at different layers of the OSI model. The only prerequisite is that they be configured in a Layer 3 switch, that is, a switch that has the capability of routing.

Specifically, you can create multiple VLANs in a switch, create SVIs within each VLAN and enable inter-VLAN routing. When you connect the switch to another Layer 3 switch, or a router, it is possible to share the connected routes with those devices using OSPF. The interfaces that would create the OSPF neighbor adjacency are the SVI interfaces of the switch.

I hope this has been helpful!

Laz

1 Like

Thank you for your explanation!

1 Like

very very thanks for you help

1 Like

I have a problem with my Routers.They don’t have a adjacency? When I configured this routers the message is missed.

R3# %OSPF-5-ADJCHG: Process 1, Nbr 192.168.23.2 on FastEthernet0/0 from LOADING to FULL, Loading Done
R2# %OSPF-5-ADJCHG: Process 1, Nbr 192.168.23.3 on FastEthernet1/0 from LOADING to FULL, Loading Done

This is my configuration

R2# show ip protocols
Routing Protocol is "ospf 1"
  Outgoing update filter list for all interfaces is not set 
  Incoming update filter list for all interfaces is not set 
  Router ID 192.168.23.2
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:
    192.168.23.0 0.0.0.255 area 0
  Routing Information Sources:  
    Gateway         Distance      Last Update 
    192.168.23.2         110      00:08:26
  Distance: (default is 110)

R3#show ip protocols
Routing Protocol is "ospf 1"
  Outgoing update filter list for all interfaces is not set 
  Incoming update filter list for all interfaces is not set 
  Router ID 192.168.23.3
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:
    192.168.23.0 0.0.0.255 area 0
  Routing Information Sources:  
    Gateway         Distance      Last Update 
    192.168.23.3         110      00:09:54
  Distance: (default is 110)

Hello Nasko

It looks like something is going wrong with your IP addressing. From the lesson, R2 has an IP address of 192.168.23.2 and R3 has an IP address of 192.168.23.3. But in the show ip protocols output, I see that R2 has a router ID of 192.168.23.2 but it also has a routing information source of 192.168.23.2 which is at an administrative distance of 110. So it’s getting routing information from itself? The same seems to be happening with R3.

From this output it seems that these routers are indeed becoming OSPF neighbors with something, but in order to further troubleshoot, I suggest you look at the routing table, the OSPF neighbors as well as some exchange of routing information. Also, examine how information is also exchanged with R1. Take a look, and let us know your results so we can further help you in the troubleshooting process.

I hope this has been helpful!

Laz

Hello Lazaros,

I found out where my problem is. The problem was that before configuring the router ospf id,I had not configured the IP addresses on the R2 and R3 routers respectively on their interfaces.After that I configure these interface and imidiatly recieved the message for adjacency.

00:40:09: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.23.3 on GigabitEthernet0/0 from LOADING to FULL, Loading Done

Thank you very much for your spending time
Nasko

1 Like

I have a problem with command “default-information originate always”.In my routers missed this command.I have only command “default-information originate”.How can I to add the always keyword???If I haven’t these command I can see the default route has been advertised.Can you help me for this problem.This is my configuration:

R2#show running-config 
Building configuration...

Current configuration : 1163 bytes
!
version 15.1
license udi pid CISCO1941/K9 sn FTX15241ARD

interface Loopback0
 ip address 2.2.2.2 255.255.255.0
!
interface GigabitEthernet0/0
 ip address 192.168.23.2 255.255.255.0
 duplex auto
 speed auto
!
interface GigabitEthernet0/1
 ip address 192.168.12.2 255.255.255.0
 duplex auto
 speed auto

router ospf 1
 log-adjacency-changes
 network 192.168.23.0 0.0.0.255 area 0
 network 192.168.12.0 0.0.0.255 area 0
 default-information originate

end

R1#show ip route ospf 
     2.0.0.0/32 is subnetted, 1 subnets
O       2.2.2.2 [110/2] via 192.168.12.2, 00:18:15, GigabitEthernet0/0
O    192.168.23.0 [110/2] via 192.168.13.3, 00:18:05, GigabitEthernet0/1
                  [110/2] via 192.168.12.2, 00:18:05, GigabitEthernet0/0

Hello Nasko

This is a good question, and shows how various parameters change depending on the IOS version in use. Take a look at this question, and the following answers given by Rene and myself to find your answer.

I hope this has been helpful!

Laz

Hi Rene/Laz,

I was trying to implement the topology mentioned in the lesson but when I was advertising the loopback network the metric is showing as 2 which should be 3 as per the lesson. I am testing this on GNS 3.

Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
O        1.1.1.1 [110/2] via 192.168.13.1, 00:08:59, GigabitEthernet0/0
      2.0.0.0/32 is subnetted, 1 subnets
O        2.2.2.2 [110/2] via 192.168.23.2, 00:05:15, GigabitEthernet0/1
O     192.168.12.0/24 [110/2] via 192.168.23.2, 00:05:15, GigabitEthernet0/1
R3(config)#

Hello Tanya

In the lesson, the total cost of 3 is measured from R1 to the loopback interface of L0 behind R2 via R3. Take a look at the following diagram:

The path taken that results in a cost of 3 is from R1 to R2 to R3. The cost becomes:

1 (Fe on R1) + 1 (Fe on R3) + 1 (L0 on R2) = 3.

Your output above seems to be the routing table of R3 and not R1. (Notice next-hop IP addresses of 192.168.13.1 and 192.168.23.2). From R3, the 2.2.2.2 network does indeed have a cost of 2 and not 3.

I hope this has been helpful!

Laz

1 Like

I have seen some lessons online where there are multiple networks connected to a router for example the 192.168.2.0 network and also a 192.168.3.0 network why cant we just use the network statement

router ospf 1
network 192.168.0.0 0.0.255.255 area 0

instead of putting two different statements for each network?

Hello Daniel

You are absolutely correct. Indeed if you wanted to you could issue the single network 0.0.0.0 255.255.255.255 command to cause all interfaces on the router to participate in OSPF.

The advantage of separating the network commands in OSPF is so you can easily make modifications in the future. Let’s say you had two interfaces with IP addresses 192.168.1.1/24 and 192.168.10.1/24. Now you used the network 192.168.0.0 0.0.255.255 command to have them take part in OSPF.

But at some point in the future, you want to add two more interfaces with IP addresses 192.168.5.0/24 and 192.168.8.0/24 and have them participate only in EIGRP. These interfaces are included in OSPF, so you would have to go back and change the network command to exclude them.

Remember that routing on production routers can involve dozens or even hundreds of networks. Of course, it is easier to use fewer commands to encompass all interfaces involved, but this makes future changes much much harder. So it is best practice to have a network command that corresponds to the subnet of each interface, as this makes all future changes much easier.

I hope this has been helpful!

Laz

Thank you Rene that really helps my understanding. I read this whole lesson and took a quiz there was a question which I have attached below I wasnt sure how the moderator got his answer of R2 is a DR and a BDR just by looking at the table?

Hi Daneil

Take a look at this response.

I hope this has been helpful!

Laz

That was so easy to understand once you emphasized it’s per segment and not per area! Thanks again!

Hi Lazaros,

What is the command for setting up the password for a default md5 auth on all the available ports?

Hello Daniel

You cannot configure a single general message-digest-key for all interfaces on the OSPF router. You must still configure the message-digest-key on a per-interface basis. However, what Rene is saying here is that you can enable authentication on all interfaces in a particular area by implementing the following command once in router configuration mode:

R1(config)#router ospf 1
R1(config-router)#area 0 authentication message-digest

…instead of having to implement this command on every interface:

R2(config)#interface fastEthernet 0/0
R2(config-if)#ip ospf authentication message-digest

You still have to enter the ip ospf message-digest-key command on each interface.

I hope this has been helpful!

Laz