- Lab
- A Cloud Guru
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.
Path Info
Table of Contents
-
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
andServer2
.From
Client1
:Once logged into
Client1
, you can verify web content availability fromServer1
andServer2
with these commands:curl 10.0.1.10
curl 10.0.1.20
-
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
-
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
-
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
-
Challenge
Confirm the Port is Forwarded
Confirm the port forward by running
curl
on the site fromClient1
:curl 10.0.1.10
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.