Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Google Cloud Platform icon
Labs

Port Forwarding with the Firewall

In this learning activity, you will need to configure port forwarding that will selectively forward web requests from one host to another.

Google Cloud Platform icon
Labs

Path Info

Level
Clock icon Advanced
Duration
Clock icon 1h 0m
Published
Clock icon Nov 14, 2018

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Verify port 80 is open on `Server1` and `Server2`

    You will want to verify that content is being served over port 80 on both Server1 and Server2.

    From Client1:

    Once logged into Client1, you can verify web content availability from Server1 and Server2 with these commands:

    curl 10.0.1.10

    curl 10.0.1.20

  2. Challenge

    Create a Zone named `testing` to Handle the Subnet Requests

    On Server1:

    Create a new firewall zone:

    firewall-cmd --permanent --new-zone=testing

    Reload the configuration, to pick up the new zone:

    firewall-cmd --reload

    Add the subnet as the source :

    firewall-cmd --permanent --zone=testing --add-source=10.0.1.0/24

    Make sure http as a service is added:

    firewall-cmd --permanent --zone=testing --add-service=http

    Reload the configuration to pick up these changes:

    firewall-cmd --reload

  3. Challenge

    Enable Masquerading for the Zone

    You will need to enable masquerading for the zone, in order to permit forwarding:

    firewall-cmd --permanent --zone=testing --add-masquerade

    Reload to pick up the new configuration:

    firewall-cmd --reload

  4. Challenge

    Add the Forwarding Rule to the Zone

    You will need to add the rule to forward the traffic coming in to the zone on port 80 out to 10.0.1.20:80:

    firewall-cmd --permanent --zone=testing --add-forward-port=port=80:proto=tcp:toport=80:toaddr=10.0.1.20

    Reload the configuration:

    firewall-cmd --reload

  5. Challenge

    Confirm the Port is Forwarded

    Confirm the port forward by running curl on the site from Client1:

    curl 10.0.1.10

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

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.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans