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 You’ll also add an entry to use as the gateway for the subnet.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

View the routing table, and prohibit connectivity to

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


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 network to use as the gateway.

Add the following entry:

ip route add via

Write a script that creates both entries.

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


 ip route add prohibit <GOOGLE_IP>
 ip route add via

Additional Resources

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

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

Note: The 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?