GNS3 OSPF Practice Lab For CCNA and CCNP ROUTE

The OSPF protocol is a widely used protocol. The major reason being “it is not cisco proprietary”. The OSPF also has a good amount of weightage on the certification exam. While working on my CCNP ROUTE I came across a very interesting lab which involved almost all the basic and advanced configuration of OSPF. The OSPF lab included stub areas, summarization, virtual-links , authentication etc. I have designed this lab in GNS3. You can download the topology file and the router configuration files for this OSPF practice lab.

This is the topology used for the lab OSPF GNS3 practice lab ccna ccnp challenge lab

These are the OSPF challenge tasks for this practice lab.

1.)Configure OSPF on all the routers with appropriate network commands.
2.)Configure R2 to summarize area 20 with the most specific mask.
3.)Configure R1 to always originate default route.
4.)Change hello and dead timers between R2 and R3 to your desired value. Make the network type between R1 and R2 as point-to-point with R1 as the DR.
5.)Make area 34 as totally stub area.
6.)Use MD5 between R2 and R3 with routemybrain.com as password :)
7.)Find why R1 is not able to ping the R4. ( FIX THIS PROBLEM)

This is the starting configuration of the routers
R1

interface Loopback0
ip address 172.16.2.1 255.255.255.0
ip ospf network point-to-point
interface Serial0/0
ip address 172.16.13.3 255.255.255.0

R2

interface Loopback0
ip address 172.16.3.1 255.255.255.224
ip ospf network point-to-point
interface Loopback1
ip address 172.16.3.33 255.255.255.224
ip ospf network point-to-point
interface Loopback2
ip address 172.16.3.65 255.255.255.224
ip ospf network point-to-point
interface Loopback3
ip address 172.16.3.97 255.255.255.224
ip ospf network point-to-point
interface Serial0/0
ip address 172.16.13.2 255.255.255.0
serial restart-delay 0
interface Serial0/1
ip address 172.16.24.2 255.255.255.0
serial restart-delay 0

R3

interface Loopback0
ip address 172.16.4.1 255.255.255.0
ip ospf network point-to-point
interface Serial0/0
ip address 172.16.24.3 255.255.255.0
serial restart-delay 0
interface Serial0/1
ip address 172.16.35.3 255.255.255.0
serial restart-delay 0

R4

interface Loopback0
ip address 172.16.5.1 255.255.255.0
ip ospf network point-to-point
interface Serial0/0
ip address 172.16.35.2 255.255.255.0
serial restart-delay 0

Solution1.) Configuring basic OSPF on all routers with appropriate network commands.

R1

router ospf 1
network 172.16.2.0 0.0.0.255 area 0
network 172.16.13.0 0.0.0.255 area 0

R2

router ospf 1
log-adjacency-changes
network 172.16.3.0 0.0.0.31 area 20
network 172.16.3.32 0.0.0.31 area 20
network 172.16.3.64 0.0.0.31 area 20
network 172.16.3.96 0.0.0.31 area 20
network 172.16.13.0 0.0.0.255 area 0
network 172.16.24.0 0.0.0.255 area 23

R3

router ospf 1
log-adjacency-changes
network 172.16.4.0 0.0.0.255 area 23
network 172.16.24.0 0.0.0.255 area 23
network 172.16.35.0 0.0.0.255 area 34

R4

router ospf 1
log-adjacency-changes
network 172.16.5.0 0.0.0.255 area 34
network 172.16.35.0 0.0.0.255 area 34

At this point objective 1 is complete, there is complete ospf connectivity. We can ping from loopback0 of R1 to loopback0 of R3.

You can use several troubleshooting commands
1.)Show ip ospf database
2.)Show ip ospf neighbors
3.)debug ip ospf adjacency

these are only few and there are several other dont forget to use the IOS help using ‘?’

Solution2.) Summarizing Area 20 routes .

The R2 is an Area border router and in OSPF summarization can only be done on ABR or ASBR’s. We have 4 networks
172.16.3.0 ( Ip range 172.16.3.1-172.16.3.31)
172.16.3.32( Ip range 172.16.3.33-172.16.3.63)
172.16.3.64( Ip range 172.16.3.65-172.16.3.95)
172.16.3.96( Ip range 172.16.3.97-172.16.3.127)

They are contiguos and each having a block size of 32. We can summarize the following network using a 128 subnet..
255.255.255.128. all i.p’s 172.16.3.1 – 172.16.3.127 will be covered in this

The command used is area range ip.address mask

The routing table of R1 before summarization.

Now type the following command on R2

router ospf 1
area 20 range 172.16.3.0 255.255.255.128

Now after OSPF summarization the output of show ip route command is like this.

All the routers now are being advertised into a single advertisement.

Objective3.) Configure R1 to always originate a default route.

The default route is used when there is only a single link to the route for e.g. connection to ISP.

in OSPF the default route can be achieved using the following command

default-information originate
we can also add always at the end of this command.

so on R1 under router ospf 1 type :-

default-information originate always

The propagation of the default route can be seen on R2.

Objective 4.) To change the hello and dead timer, the network type as point-to-point and R1 as the DR.

Now before making any changes to the configuration type the following command on router R2 and R3

debug ip ospf hello

Now to change the hello and dead intervals of R2 and R3 type the following on serial 0/1 of R1 and serial 0/0 of R3.

ip ospf hello-interval 60
ip ospf dead-interval 180

The moment you type this command on R1 you get log messages like this

Now to make the link as point to point type the following command on the above specified serial interfaces.

ip ospf network point-to-point

Now to make the R1 as the DR we can do two things make the R2’s priority 0 or increase the priority of R1. I increased the priority of the R1 with the following command.

R1(config-if)#ip ospf priority 2

you can verify this using the show ip ospf neighbor command

Objective5.) Making area 34 as totally stubby area.
type the following command on router 4.

router ospf 1
area 34 stub

Objective6.) Having MD5 authentication between R2 and R3

To enable the md5 authentication you must define a key first on the interface then apply it on the area.
Go under interface configuration on R2 for serial 0/1 and R3’s serial 0/1 interface.

ip ospf message-digest-key 1 md5 routemybrain.com

now we need to apply it on area 23 again type the following command on both router under router ospf 1.

area 23 authentication message-digest

This will enable md5 authentication on both the routers.

I was not able to complete objective 7 as i tried to solve it with virtual links, but area 34 being a stub area cannot support virtual links. One way of doing it was to use tunneling but I think is another way around. If someone finds an alternate way do post it in the comments.

Download GNS3 Topology file.

Akash Deep Singh

|| Eat Packets || Drink Management || Sleep Virtual || Work Linux || Think I.T. || Love MAC || Look After Windows || Dream APPS ||

35 Comments

  1. Arunava Modak   •  

    how i can configure ospf area so that it can show a O N1/N2 area ?

    • Akash Deep Singh   •     Author

      To get N1 and N2 routes you need NSSA area. for eg if you have an area 34 as NSSA and you are redistributing RIP into that area then those routes will be N1 and N2 now they will be summarized as LSA type 7 by ABR and will further appear as type E1 and E2

  2. Ben Story   •  

    I maybe wrong, but since this topology is all point-to-point serial links, there is no way for you to setup a DR/BR relationship. You would need a shared media like an ethernet segment.

    • Akash Deep Singh   •     Author

      Hi Ben

      Its nice to see people commenting on the blog. You are absolutely right about the election of the DR/BDR. The election takes place only on shared segment.

      It was the requirement of the lab to set the DR and the BDR. Maybe just to make sure people know how to modify parameters for the election of DR and BDR.

    • Logan Roberts   •  

      Regarding the DR/BDR requirement. While in the interface configuration mode, if you type: ip ospf network broadcast at both ends of the serial link, you will get an election. To determine which router will be the DR simply add the ip ospf priority 0 command on the interface of the router that will not be elected DR.

      Simple.

  3. rupul   •  

    Thank you for your efforts in sharing this with us. Your work is well appreciated.

  4. rupul   •  

    Well, I am back again. I tried your configuration in gns3. I have not configured Area 34 as a stub area and so, I should be able to use virtual links to connect to area 0. However, I am confused since I don’t know in which routers to use virtual links and how? If possible please let me know this. I think some others are also facing this problem. Thank you very much.

  5. Siddiqui   •  

    hi there,

    you are right rupul there has to be a virtual link among the routers of which at least one is connected to the BB area (0)..this is how I done it.

    consol to R2 and type area 23 virtual-link followed by the RID of the R3, (by deafault it chooses the loop backs as RID), and do the same config on R3 with the same are 23 but use the RID of the other ABR i.e RID of R2.

    then ping the R1 to R4’s wtever interface and u will be replied. it actually creates a virtual link with an assumption that R4 and R3 is directly connected to BB area 0.

    regards.

  6. zaherer   •  

    Great Job , Today I did this lab the way to connect the R4 with R1 is via virtual link.

  7. Suhas   •  

    Objective 5) In order to make Area 34 a Totally Stubby Area, following command needs to be entered..

    router(config-rtr)#area 34 stub no-summary

    • Akash Deep Singh   •     Author

      Thanks SUHAS

  8. Nikki   •  

    does that area 34 stub no summary command need to be on the R2, because it is the ABR?

  9. Amit   •  

    Hi All,

    OBJECTIVE7: The R1 or any other router except R3 cant ping the R4 as according to OSPF terminology all the ares should be connected to area0 i.e., the backbone area.the R3 alone can ping R4 and vice versa because they are directly connected.the solution for this is Area0 should be connected to Area34 and then everything will go right.

  10. Silas   •  

    Hi can anyone help, i can not console to my devices in GNS3 and the idle i select for one device(router) is automaticly applied to all other devices in the lab. Help please my email: nissy357@yahoo.com

  11. Silas   •  

    Hi can anyone help, i can not console to my devices in GNS3 and the idle value i select for one device(router) is automaticly applied to all other devices in the lab. Help please my email: nissy357@yahoo.com

  12. Nitish Gupta   •  

    R3 is not becaming ABR even after different areas are configured on it, since as per the rule for becaming an ABR need to connected to the area0, so its not becaming an ABR.

    For allowing R4 to communicate with rest of OSPF domain, we can eject a default route from R3

  13. Graveworm   •  

    Hi Amit,

    I believe it is possible to ping all routers by R4, simply by setting up the Virtual-link between R2 and R3.

    Use this command:

    R2:
    router ospf 1
    area 23 virtual-link

    R3
    router ospf 1
    area 23 vitual-link

    after this you will see the Inter Area Routes in R4

  14. Graveworm   •  

    R2:
    router ospf 1
    area 23 virtual-link -R3 router-id-

    R3
    router ospf 1
    area 23 vitual-link -R2 router-id-

  15. Andrea   •  

    Hi Akash,

    I tried the summarization on R2, but it does not work.

    Here you can see the command I used to summarise.

    R2#show running-config
    router ospf 1
    log-adjacency-changes
    area 20 range 172.16.3.0 255.255.255.128
    network 172.16.3.0 0.0.0.31 area 20
    network 172.16.3.32 0.0.0.31 area 20
    network 172.16.3.64 0.0.0.31 area 20
    network 172.16.3.96 0.0.0.31 area 20
    network 172.16.13.0 0.0.0.255 area 0
    network 172.16.24.0 0.0.0.255 area 23

    But yet all the networks 172.16.3.0 /27 appear instead of /25.

    R2#show ip route

    172.16.0.0/16 is variably subnetted, 9 subnets, 3 masks
    C 172.16.3.32/27 is directly connected, Loopback1
    C 172.16.24.0/24 is directly connected, Serial0/1
    C 172.16.13.0/24 is directly connected, Serial0/0
    O 172.16.4.0/24 [110/65] via 172.16.24.3, 00:08:37, Serial0/1
    O 172.16.2.0/24 [110/65] via 172.16.13.3, 00:08:37, Serial0/0
    C 172.16.3.0/27 is directly connected, Loopback0
    O 172.16.3.0/25 is a summary, 00:08:37, Null0
    C 172.16.3.96/27 is directly connected, Loopback3
    C 172.16.3.64/27 is directly connected, Loopback2

    Any help, please?

    • Spiderweb   •  

      go to every loopback interface and type:

      ip ospf network point-to-point

  16. dave   •  

    Hey! stupid question here :-) but I like this lab, and would like to spend some time on it, but all my gns router IOS has (im using a 3745 image) is ethernet links, no serial. Will this lab still work as expected, or do I need to find a more optimal image??

    Thanks!!

    Dave

  17. Muhammad Arshad   •  

    @Andrea Try to advertize the networks as below to get rid of your problem.

    router ospf 1
    network 172.16.3.0 0.0.0.127 ( it will advertize networks 172.16.3.0-172.16.3.96) in one statement and then try to summerize the networks as

    area 20 range 172.16.3.0 255.255.255.224

  18. Muhammad Arshad   •  

    Important Note::::

    in OSPF Loopback INterfaces ip address is shown as /32 mask so when ever configur loopbacks in OSPF issue ” ip ospf network point-to-piont” command under interface configuration. i.e

    R1#(config)int loopback 0
    R1#(CONFIG-IF)ip ospf network point-to-point

  19. Tariq   •  

    To get external routes in R4 or ping from R4 to R1:

    Create Virtual Links between R2,R3 and R4

    R2 > R3

    area 23 virtual-link 172.16.4.1 | area 23 virtual-link 172.16.3.97

    R3 > R4

    area 34 virtual-link 172.16.5.1 | area 34 virtual-link 172.16.4.1

    It will work fine.

    But the area cannot be a stub as it contains a virtual link !!

  20. Akash Deep Singh   •     Author

    Thanks everyone for helping other people out

  21. Alex   •  

    Fix problem №7:

    R1
    router ospf 1
    network 172.16.2.0 0.0.0.255 area 11
    network 172.16.13.0 0.0.0.255 area 11
    R2
    router ospf 1
    log-adjacency-changes
    network 172.16.13.0 0.0.0.255 area 11
    network 172.16.24.0 0.0.0.255 area 0
    R3
    router ospf 1
    log-adjacency-changes
    network 172.16.4.0 0.0.0.255 area 0
    network 172.16.24.0 0.0.0.255 area 0

    P.S. Area 0 should be in the center of your topology

  22. dave moss   •  

    good lab!… studying for the CCNA, looking for stuff to practice on.
    one question?….
    why not use /30 for the serial link networks? 172.16.13.0/30… etc…
    /24 wastes alotta address’….
    doesn’t really matter here, but….

    • Akash Deep Singh   •     Author

      Hey Dave,

      Nice to hear you liked it. Yes /30 is best option. Its just a lab. But serial links or point to point always prefer to use /30 or .252

      all the best for your ccna.

  23. Ahmed Mustafa   •  

    Hey Aakash,

    I am able to ping R4 loopback from R1.
    Procedure:
    Make area 23 as Virtual link for Area 34
    Then make Area 34 Stub on both R3 and R4 , and it is done!
    R1#ping 172.16.5.1

    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 172.16.5.1, timeout is 2 seconds:
    !!!!!
    Success rate is 100 percent (5/5), round-trip min/avg/max = 44/84/136 ms
    R1#tra
    R1#traceroute 172.16.5.1

    Type escape sequence to abort.
    Tracing the route to 172.16.5.1

    1 172.16.13.2 36 msec 40 msec 40 msec
    2 172.16.24.3 44 msec 60 msec 52 msec
    3 172.16.35.2 72 msec 116 msec *
    R1#

    • Akash Deep Singh   •     Author

      Great to hear that

    • raj   •  

      little confused.can u share the config of r3 and r4

  24. Salman Rahman   •  

    bravo thanks Akash for sharing such a nice lab

  25. vivek   •  

    For connectivity between R1 and R4 make virtual link between R2 and R3.
    Virtual link can not be form between R3 and R4 because area 34 is stub.

  26. Sunny   •  

    Is there any possibility we can make reachability between R1 & R4 without using virtual link. In this scenario .. I have searched lot stuff but not getting through..

Leave a Reply

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