Lab #7

OSPF in a multi-area network

The purpose of this lab is to show how routing in complex topologies can be managed by decomposing them in areas.
First of all, we solve the network addressing problem, by subnetting a block of 128 IPv4 addresses in a suitable number of subnets.
Then, we create the network topology in GNS3 and configure the routers.
Finally, we analyze the routes established by OSPF.

Subnetting

The network topology we want to create in GNS3 is depicted in the following picture.

lab7-topology-sketch
The network consists of 7 routers and 5 end systems. Routers are connected by means of 9 point-to-point links.
For the sake of OSPF routing, we partition the routers in three areas.
Area 0 consists of routers R4, R5 and R6.
Area 1 consists of routers R0 and R1.
Area 2 consists of routers R2 and R3.
As the picture above shows, network addressing requires 14 subnets.
We assume that a block of 128 contiguous IPv4 addresses is available: 192.168.24.0/25.
We perform subnetting with variable length mask with: The following table shows how the available address range can be split into the required 14 subnets.
lab7-subnets
Notice that, after subnetting, a few small address ranges remain unused.

Preparation steps

Before this experiment is executed, it is required that you have previously configured GNS3 to make it able to instantiate a Docker container of a Linux-based router based on the FRR (Free Range Routing) software suite, as described in Lab #2.

Experiment steps

  1. Recreate the following topology in GNS3. Choose the "GNS3 VM" server to instantiate all the devices of this lab.
  2. lab7-topology
     
  3. When the devices are still inactive, for each of the routers (R0, R1, R2, R3, R4, R5 and R6), right-click on the router icon and select the Configure option.
    Then, click the "Advanced" tab and add /etc/frr to the Additional directories to make persistent.
  4. Start all devices.
  5. Open PC1 terminal and execute the command:
    ip 192.168.24.66/28 192.168.24.65
    save
  6. Open PC2 terminal and execute the command:
    ip 192.168.24.82/28 192.168.24.681
    save
  7. Open PC3 terminal and execute the command:
    ip 192.168.24.98/28 192.168.24.97
    save
  8. Open PC4 terminal and execute the command:
    ip 192.168.24.114/28 192.168.24.113
    save
  9. Open PC5 terminal and execute the command:
    ip 192.168.24.50/28 192.168.24.49
    save
  10. Open R0 auxiliary console. At the root command prompt:
    sed -i '/^ospfd/s/no/yes/' /etc/frr/daemons
    echo "service integrated-vtysh-config" > /etc/frr/vtysh.conf
    chown frr:frr /etc/frr/vtysh.conf
    touch /etc/frr/frr.conf
    chown frr:frr /etc/frr/frr.conf
    vi /etc/frr/frr.conf
    
    Use the vi editor to edit the /etc/frr/frr.conf file as follows.
    frr version 8.1_git
    frr defaults traditional
    hostname R0
    no ipv6 forwarding
    service integrated-vtysh-config
    !
    interface lo
     ip address 1.1.1.1/32
     ip ospf passive
    !
    interface eth0
      ip address 192.168.24.65/28
      ip ospf passive
    !
    interface eth1
      ip address 192.168.24.25/30
    !
    interface eth2
      ip address 192.168.24.18/30
    !
    router ospf
      ospf router-id 1.1.1.1
      network 192.168.24.16/30 area 1
      network 192.168.24.24/30 area 1
      network 192.168.24.64/28 area 1
    !
    line vty
    !
    
    Finally, stop and restart the R0 container to start the ospfd daemon.

  11. Open R1 auxiliary console. At the root command prompt:
    sed -i '/^ospfd/s/no/yes/' /etc/frr/daemons
    echo "service integrated-vtysh-config" > /etc/frr/vtysh.conf
    chown frr:frr /etc/frr/vtysh.conf
    touch /etc/frr/frr.conf
    chown frr:frr /etc/frr/frr.conf
    vi /etc/frr/frr.conf
    
    Use the vi editor to edit the /etc/frr/frr.conf file as follows.
    frr version 8.1_git
    frr defaults traditional
    hostname R1
    no ipv6 forwarding
    service integrated-vtysh-config
    !
    interface lo
     ip address 1.1.1.2/32
     ip ospf passive
    !
    interface eth0
      ip address 192.168.24.81/28
      ip ospf passive
    !
    interface eth1
      ip address 192.168.24.26/30
    !
    interface eth2
      ip address 192.168.24.22/30
    !
    router ospf
      ospf router-id 1.1.1.2
      network 192.168.24.20/30 area 1
      network 192.168.24.24/30 area 1
      network 192.168.24.80/28 area 1
    !
    line vty
    !
    
    Finally, stop and restart the R1 container to start the ospfd daemon.

  12. Open R2 auxiliary console. At the root command prompt:
    sed -i '/^ospfd/s/no/yes/' /etc/frr/daemons
    echo "service integrated-vtysh-config" > /etc/frr/vtysh.conf
    chown frr:frr /etc/frr/vtysh.conf
    touch /etc/frr/frr.conf
    chown frr:frr /etc/frr/frr.conf
    vi /etc/frr/frr.conf
    
    Use the vi editor to edit the /etc/frr/frr.conf file as follows.
    frr version 8.1_git
    frr defaults traditional
    hostname R2
    no ipv6 forwarding
    service integrated-vtysh-config
    !
    interface lo
     ip address 1.1.1.3/32
     ip ospf passive
    !
    interface eth0
      ip address 192.168.24.97/28
      ip ospf passive
    !
    interface eth1
      ip address 192.168.24.41/30
    !
    interface eth2
      ip address 192.168.24.34/30
    !
    router ospf
      ospf router-id 1.1.1.3
      network 192.168.24.32/30 area 2
      network 192.168.24.40/30 area 2
      network 192.168.24.96/28 area 2
    !
    line vty
    !
    
    Finally, stop and restart the R2 container to start the ospfd daemon.

  13. Open R3 auxiliary console. At the root command prompt:
    sed -i '/^ospfd/s/no/yes/' /etc/frr/daemons
    echo "service integrated-vtysh-config" > /etc/frr/vtysh.conf
    chown frr:frr /etc/frr/vtysh.conf
    touch /etc/frr/frr.conf
    chown frr:frr /etc/frr/frr.conf
    vi /etc/frr/frr.conf
    
    Use the vi editor to edit the /etc/frr/frr.conf file as follows.
    frr version 8.1_git
    frr defaults traditional
    hostname R3
    no ipv6 forwarding
    service integrated-vtysh-config
    !
    interface lo
     ip address 1.1.1.4/32
     ip ospf passive
    !
    interface eth0
      ip address 192.168.24.113/28
      ip ospf passive
    !
    interface eth1
      ip address 192.168.24.42/30
    !
    interface eth2
      ip address 192.168.24.38/30
    !
    router ospf
      ospf router-id 1.1.1.4
      network 192.168.24.36/30 area 2
      network 192.168.24.40/30 area 2
      network 192.168.24.112/28 area 2
    !
    line vty
    !
    
    Finally, stop and restart the R3 container to start the ospfd daemon.

  14. Open R4 auxiliary console. At the root command prompt:
    sed -i '/^ospfd/s/no/yes/' /etc/frr/daemons
    echo "service integrated-vtysh-config" > /etc/frr/vtysh.conf
    chown frr:frr /etc/frr/vtysh.conf
    touch /etc/frr/frr.conf
    chown frr:frr /etc/frr/frr.conf
    vi /etc/frr/frr.conf
    
    Use the vi editor to edit the /etc/frr/frr.conf file as follows.
    frr version 8.1_git
    frr defaults traditional
    hostname R4
    no ipv6 forwarding
    service integrated-vtysh-config
    !
    interface lo
     ip address 1.1.1.5/32
     ip ospf passive
    !
    interface eth0
      ip address 192.168.24.17/30
    !
    interface eth1
      ip address 192.168.24.21/30
    !
    interface eth2
      ip address 192.168.24.9/30
    !
    interface eth3
      ip address 192.168.24.2/30
    !
    router ospf
      ospf router-id 1.1.1.5
      network 192.168.24.0/30 area 0
      network 192.168.24.8/30 area 0
      network 192.168.24.16/30 area 1
      network 192.168.24.20/30 area 1
    !
    line vty
    !
    
    Finally, stop and restart the R4 container to start the ospfd daemon.

  15. Open R5 auxiliary console. At the root command prompt:
    sed -i '/^ospfd/s/no/yes/' /etc/frr/daemons
    echo "service integrated-vtysh-config" > /etc/frr/vtysh.conf
    chown frr:frr /etc/frr/vtysh.conf
    touch /etc/frr/frr.conf
    chown frr:frr /etc/frr/frr.conf
    vi /etc/frr/frr.conf
    
    Use the vi editor to edit the /etc/frr/frr.conf file as follows.
    frr version 8.1_git
    frr defaults traditional
    hostname R5
    no ipv6 forwarding
    service integrated-vtysh-config
    !
    interface lo
     ip address 1.1.1.6/32
     ip ospf passive
    !
    interface eth0
      ip address 192.168.24.33/30
    !
    interface eth1
      ip address 192.168.24.37/30
    !
    interface eth2
      ip address 192.168.24.10/30
    !
    interface eth3
      ip address 192.168.24.6/30
    !
    router ospf
      ospf router-id 1.1.1.6
      network 192.168.24.4/30 area 0
      network 192.168.24.8/30 area 0
      network 192.168.24.32/30 area 2
      network 192.168.24.36/30 area 2
    !
    line vty
    !
    
    Finally, stop and restart the R5 container to start the ospfd daemon.

  16. Open R6 auxiliary console. At the root command prompt:
    sed -i '/^ospfd/s/no/yes/' /etc/frr/daemons
    echo "service integrated-vtysh-config" > /etc/frr/vtysh.conf
    chown frr:frr /etc/frr/vtysh.conf
    touch /etc/frr/frr.conf
    chown frr:frr /etc/frr/frr.conf
    vi /etc/frr/frr.conf
    
    Use the vi editor to edit the /etc/frr/frr.conf file as follows.
    frr version 8.1_git
    frr defaults traditional
    hostname R6
    no ipv6 forwarding
    service integrated-vtysh-config
    !
    interface lo
     ip address 1.1.1.7/32
     ip ospf passive
    !
    interface eth0
      ip address 192.168.24.1/30
    !
    interface eth1
      ip address 192.168.24.5/30
    !
    interface eth2
      ip address 192.168.24.49/28
      ip ospf passive
    !
    router ospf
      ospf router-id 1.1.1.7
      network 192.168.24.0/30 area 0
      network 192.168.24.4/30 area 0
      network 192.168.24.48/28 area 0
    !
    line vty
    !
    
    Finally, stop and restart the R5 container to start the ospfd daemon.

Traffic generation and results analysis


Lab notes in PDF

Return to list of labs

Copyright (c) 2024 - Roberto Canonico

Last updated: October 3, 2024 by Roberto Canonico