Working with Static Routes

1 hour
  • 3 Learning Objectives

About this Hands-on Lab

In this learning activity, you will need to create a script that modifies the routing table, to prohibit connectivity to google.com. You’ll also add an entry to use 10.0.1.20 as the gateway for the 10.0.8.0/24 subnet.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

View the routing table, and prohibit connectivity to google.com.

You can view the routing table using the following command:

ip route show

You should install the bind-utils package which includes the host command, to get the IPs associated with google.com.

host google.com

Once you have the IP address(es), you can prohibit connectivity to them using the following command:

ip route add prohibit <IP_ADDRESS>

Add an entry for the 10.0.8.0/24 network to use 10.0.1.20 as the gateway.

Add the following entry:

ip route add 10.0.8.0/24 via 10.0.1.20

Write a script that creates both entries.

Using a text editor like vim, create and edit the file /home/cloud_user/routes.sh :

 #!/bin/bash

 ip route add prohibit <GOOGLE_IP>
 ip route add 10.0.8.0/24 via 10.0.1.20

Additional Resources

Your supervisor has asked you to make two network changes to a host:

  1. Prohibit the host's connectivity to google.com.
  2. Prepare the host for connecting to an as yet unconfigured network by adding a static route for the 10.0.8.0/24 network that uses 10.0.1.20 as the gateway.

Note: The 10.0.8.0/24 network will not be available prior to or after adding the route, as it hasn't yet been provisioned by your organization. This is a preperatory step.

To restart the network: instead of: systemctl restart network use: systemctl restart NetworkManager

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?