16 Introduction to Routers

Jacob Christensen

Simply stated, where switches and hubs connect end devices (desktops, laptops, smartphones, etc.), routers connect switches and hubs to each other. Routers are the devices that enable the internet to function. This is an elementary introduction to using routers for first-time learners. This lab will build two LANs and connect them using a MikroTik router.

Estimated time for completion: 20 minutes

Learning Objectives

  • Demonstrate successful router configuration using two or more local area networks
  • Increase experience in utilizing virtual environments in learning enterprise networks
  • Analyze Wireshark results to identify ethernet packets and frames

prerequisites

Deliverables

Four screenshots are required:

  • PC1 console successfully pinging PC4
  • Wireshark results (ICMP packets) of PC2 successfully pinging PC3
  • Neatly labeled and organized GNS3 Workspace
  • Configuration settings of the MikroTik router console (interface print, ip address print)

Resources

Contributors and testers

  • Quinton D. Heath Van Horn, 7th grade
  • David Reese, Mathematics Student, SUNY Bridgeport
  • Julian Romano, Cybersecurity Student, ERAU-Prescott
  • Dante Rocca, Cybersecurity Student, ERAU-Prescott
  • Sawyer Hansen, Cybersecurity Student, ERAU-Prescott

NOTE: Students should be familiar enough with GNS3 by now to understand the commands.  This lab starts reducing the number of screenshots since these things were documented in previous chapters.

Overview

You are going to use your LAN knowledge and build two networks. You will then use a router to connect these networks together. Your final product should look similar to this.

GNS3 network topology
Figure 1 – Final network topology

Phase I – Configure the Red and Blue Networks

Most networks have a specific purpose.  The network can be centered around a function (marketing) or geography (front building).  In our examples, we generally use colors to abstract the learners from the specific functions.  This way learners won’t be locked into a certain configuration for an “Accounting” department.

  1. Start GNS3
    1. Create a new project: LAB_03
  2. Build the Red LAN with the network address 100.10.10.0 and netmask 255.255.255.0

    NOTE: /24 is CIDR notation for the subnet mask of 255.255.255.0, which is itself a decimal representation of the binary octets 11111111.11111111.11111111.00000000 used to name network interfaces (the /24 represents the number of 1’s used). These PC’s happen to accept CIDR notation and subnet mask notation, but not all end devices do. So get familiar with using both ways to assign IP addresses.

    1. Use two VPCS devices for PC1 and PC2
    2. Add an Ethernet switch
    3. Connect the PCs to the switch
    4. Start the PCs and assign them appropriate host addresses
      1. Configure PC1 to have a host address of 100.10.10.1

        > ip 100.10.10.1/24

        > save

      2. Configure PC2 to have a host address of 100.10.10.2

        > ip 100.10.10.2/24

        > save

    5. Organize your network
      1. Label the machines with both their IP address and hostname for clarity
      2. Add a textbox with the subnet network address using either CIDR notation or traditional subnet masks
      3. To help visually differentiate the subnets, change the device symbols or use the Draw a rectangle button to encapsulate the LAN with its associated color

        NOTE: You may have to send the square to the background by right-clicking on it and then selecting the Lower one-layer option.

    6. Test network connectivity by opening the console for PC1 and pinging PC2

      > ping 100.10.10.2

  3. Repeat to build Blue LAN with the network space of 200.20.20.0/24
    1. Configure PC3 with the host address 200.20.20.10
    2. Configure PC4 with the host address 200.20.20.20
  4. Verify your network looks similar to the following
    GNS3 network topology
    Figure 2 – Basic GNS3 network

NOTE: In the figures, you can see different methods of labeling and visual organization:

  • The Red LAN posts the network ID and just the host part is next to the device
  • The Blue LAN uses the complete network ID next to each device

Phase II – Connect the LANs to a Router

As discussed earlier, hubs and switches connect end devices to create LANs (an over simplistic explanation, but it suffices in this instance).  Now we are going to use a router to connect the individual LANs to form an enterprise network.

  1. Import the MikroTik appliance from GNS3 marketplace
  2. Connect the Red and Blue LANs to a router
    1. Drag a MikroTik router to the workplace
    2. Connect a cable from the Red switch to the ether1 router interface
    3. Connect a cable from the Blue switch to the ether2 router interface

      NOTE: Unlike the switches, taking note of which router ports are in use is VERY IMPORTANT!

  3. Start the router and open its console (Figure 3)
    1. Login: admin
    2. Password: (nothing just hit Enter)
    3. Set a new password (ex. Security1)

      NOTE: You can change the hostname of the router for clarity. This will be useful when we build more complicated and interconnected networks later.

      > system identity set name=new_name

      Terminal command execution
      Figure 4 – Set new router hostname

      MikroTik Router Troubleshooting

      If the router is stuck in an infinite boot-loop (throttling), ensure that KVM acceleration is DISABLED in the GNS3 VM configuration file.

      GNS3 configuration
      Figure 5 – GNS3 VM main menu
      Edit configuration file
      Figure 6 – GNS3 VM configuration

       

  4. Configure ether1 with a Red IP address (Figure 7)
    1. View the list of ethernet ports on the router

      > interface print

    2. Assign the IP address of 100.10.10.150 to ether1

      > ip address add address=100.10.10.150/24 interface=ether1

    3. Ensure the IP address has been taken

      > ip address print

    4. From the MikroTik router, try pinging one of the Red PCs from its console
      Terminal command execution
      Figure 8 – VPCS connectivity test

      NOTE: Routers will ping indefinitely whereas end devices usually only ping 4 to 5 times. This continuous pinging offered by routers aids in troubleshooting efforts. To stop the pinging, make sure the MikroTik console is active and press Ctrl+C.

    5. Troubleshoot as necessary until there’s connectivity between the Red PCs and ether1 on the router
  5. Configure ether2 with the Blue IP address of 200.20.20.250 by following step 4
  6. Verify that your network looks similar to the following
    GNS3 network topology
    Figure 9 – Finalized GNS3 network
  7. From PC4, try to ping PC1

    NOTE: You will get a No gateway found error. This is expected. At the time we built our LANs, we didn’t have a router. Now we need to configure our PCs to include the gateway address for their respective networks. The gateway address is the address the endpoint (ex PC1) needs to send its packets when the destination is outside of the LAN.

    Terminal command execution
    Figure 10 – No gateway found
  8. Use the VPCS IP command to assign each PC a gateway address
    1. The gateway address for the Red network is 100.10.10.150 (router port ether1)
    2. Configure PC1’s gateway addresses

      > ip 100.10.10.1/24 100.10.10.150

    3. Configure PC2’s gateway address

      > ip 100.10.10.2/24 100.10.10.150

    4. Repeat these steps to add the appropriate gateway address (200.20.20.250) to PC3 and PC4

Phase III – Testing your network

Testing – Testing – Testing.  It never ends.

  1. Open Wireshark packet capture between PC1 and the Red Switch
  2. Use PC1’s console to ping PC4

    > ping 200.20.20,20

    Terminal command execution
    Figure 11 – PC1 pinging PC4
  3. Watch Wireshark for the ARP and ICMP packets
    Wireshark packet capture
    Figure 12 – Wireshark packet capture
  4. Verify that you can do this between any two points in the network
End of Lab

Deliverables

Four screenshots are required to receive credit for this exercise:

  • PC1 console successfully pinging PC4
  • Wireshark results (ICMP packets) of PC2 successfully pinging PC3
  • Neatly labeled and organized GNS3 Workspace
  • Configuration settings of the MikroTik router console (interface print, ip address print)

Homeworks

Assignment 1 – Add Green LAN to the network.

DEVICE IP ADDRESS NETWORK MASK GATEWAY ADDRESS
PC5 177.50.0.1 255.255.255.0 177.50.0.250
PC6 177.50.0.2 255.255.255.0 177.50.0.250
Router Interface 177.50.0.250 255.255.255.0 none-this is the gateway!

Assignment 2 – Add Purple LAN to the network.

DEVICE IP ADDRESS NETWORK MASK GATEWAY ADDRESS
PC7 10.10.0.1 255.255.0.0 10.10.255.250
PC8 10.10.0.2 255.255.0.0 10.10.255.250
PC9 10.10.0.3 255.255.0.0 10.10.255.250
PC10 10.10.100.1 255.255.0.0 10.10.255.250
Router Interface 10.10.255.250 255.255.0.0 none-this is the gateway!

Recommended binary grading criteria:

  • Screenshot of the GNS3 Working environment where:
    • All connections are made according to instructions
    • All connections are labeled with the correct IP Address
    • Interface labels are turned on
    • Everything is organized neatly
  • Screenshot of Wireshark packet captures taken from the PC5-Switch link
    • PC5 from the Green subnet can successfully ping PC2 in the Red subnet
List of Figures for Print Copy
MikroTik startup screen
Figure 3 – MikroTik router login screen
Ether1 configured with red network IP address
Figure 7 – Ether1 configured with red network IP address

License

Icon for the Creative Commons Attribution 4.0 International License

Mastering Enterprise Networks Copyright © 2024 by Jacob Christensen is licensed under a Creative Commons Attribution 4.0 International License, except where otherwise noted.

Share This Book