SlideShare a Scribd company logo
1
FIREWALL-CMD LAB
 CreatingYour OwnZones
While the predefined zones will probably be more than enough for most users, it can be helpful to
define your own zones that are more descriptive of their function.
For instance, you might want to create a zone for your server, called “privatekaan”.
When adding a zone, you must add it to the permanent firewall configuration. You can then reload to
bring the configuration into your running session. For instance, we could create the two zones we
discussed above by typing:
 sudo firewall-cmd --permanent --new-zone=privatekaan (Output  Success)
 You can verify that these are present in your permanent configuration by typing:
 sudo firewall-cmd --permanent --get-zones (Output  Zones | privatekaan )
 As stated before, these won’t be available in the runtime firewall yet:
 firewall-cmd --get-zones (Output  Zones without privatekaan)
 Reload the firewall to bring these new zones into the active runtime configuration:
 sudo firewall-cmd –reload
 firewall-cmd --get-zones
2
We can add the DNS service to our privatekaan zone:
 sudo firewall-cmd --zone= privatekaan --add-service=dns
 sudo firewall-cmd --zone= privatekaan --list-all
 We could then change our interfaces over to these new zones to test them out:
 sudo firewall-cmd --zone=privatekaan --change-interface=ens160
 At this point, you have the opportunity to test your configuration. If these values work for you,
you will want to add these rules to the permanent configuration. You could do that by running all
the commands again with the --permanent flag appended, but in this case we’ll use the --
runtime-to-permanent flag to save our entire runtime configuration permanently:
 sudo firewall-cmd --runtime-to-permanent (Output  Success)
3
 After permanently applying these rules, reload the firewall to test that the changes remain:
 sudo firewall-cmd –reload (Output  Success)
 Validate that the correct zones were assigned:
 firewall-cmd --get-active-zones (Output  Success; Success)
 And validate that the appropriate services are available for both of the zones:
 sudo firewall-cmd --zone=privatekaan --list-services (Output  dns)
 You have successfully set up your own zones! If you want to make one of these zones the default
for other interfaces, remember to configure that behavior with the --set-default-
zone= parameter:
 sudo firewall-cmd --set-default-zone=privatekaan (Output  Success)
 TestConnection
We configured “privatekaan” zone as our default active zone. And now it allows “DNS” traffic. We
can analyze via “tcpdump”
 From F5 BIG IP Device. Wehave“10.30.30.50” SelfIP for internal network
4
 From Apache Server. WecanseetheDNStraffic coming from our F5BIGIP
Syntax is  tcpdump –i ens160 host 10.30.30.50
 As we can see, we are able to analyze the TCP handshake between our F5 internal IP and CentOS
8 Apache Server.
Note: We removed the “SSH Service” from our active zone “privatekaan” but the connection wasn’t
dropped. It holds the previous sessions. If you try to reconnect again via SSH, you will not establish a
successful connection.
5
 Now we will allow the SSH service. Syntax is shown below:
 sudo firewall-cmd –zone=privatekaan –add-service=ssh –permenant
(Note: Since it is not our root user, it will ask for “sudo password”)
 We can see the services under our active zone on interface
 sudo firewall-cmd –zone=privatekaan –list-services –permenant
 Reload the firewall
 sudo firewall-cmd –reload
 Now we are able to connect to our Apache Server via SSH
1/18/2022
X
Kaan Aslandag
Signed by: www.kaan1.com

More Related Content

PDF
Configuration of NTP Server on CentOS 8
PDF
Configuration of BIND DNS Server On CentOS 8
PDF
Configuration IPTables On CentOS 8
PDF
Configuration Firewalld On CentOS 8
PDF
CentOS Server CLI Configuration (Nmcli & Hosts)
PDF
CentOS Server Gui Initial Configuration
PDF
IPTables Lab
PDF
Configuration of Smtp Server On CentOS 8
Configuration of NTP Server on CentOS 8
Configuration of BIND DNS Server On CentOS 8
Configuration IPTables On CentOS 8
Configuration Firewalld On CentOS 8
CentOS Server CLI Configuration (Nmcli & Hosts)
CentOS Server Gui Initial Configuration
IPTables Lab
Configuration of Smtp Server On CentOS 8

What's hot (20)

PDF
Dhcp
DOCX
3PAR: HOW TO CHANGE THE IP ADDRESS OF HP 3PAR SAN
PDF
Ftp configuration in rhel7
PDF
Basic security & info
PDF
How To Configure VNC Server on CentOS 7
PDF
TFTP Installation Configuration Guide
PDF
mail server
DOCX
How to shutdown the Netapp SAN 8.3 and 9.2 version
PDF
How to install and configure Postfix Mail Server in Redhat (RHEL) / CentOS Linux
PDF
How to Configure OpenFiler for NFS Share
PPTX
Presentation Linux Server setup Advance Networking
PDF
How To Install and Configure GNome on CentOS 7
DOCX
PPTX
Stacki: Automate with Spreadsheets (Tutorial)
PDF
Building a moat bastion server
PDF
Cisco vs. huawei CLI Commands
TXT
Server readme
PDF
Free radius billing server with practical vpn exmaple
PDF
How To Configure Nginx Load Balancer on CentOS 7
PDF
How To Install and Configure Salt Master on Ubuntu
Dhcp
3PAR: HOW TO CHANGE THE IP ADDRESS OF HP 3PAR SAN
Ftp configuration in rhel7
Basic security & info
How To Configure VNC Server on CentOS 7
TFTP Installation Configuration Guide
mail server
How to shutdown the Netapp SAN 8.3 and 9.2 version
How to install and configure Postfix Mail Server in Redhat (RHEL) / CentOS Linux
How to Configure OpenFiler for NFS Share
Presentation Linux Server setup Advance Networking
How To Install and Configure GNome on CentOS 7
Stacki: Automate with Spreadsheets (Tutorial)
Building a moat bastion server
Cisco vs. huawei CLI Commands
Server readme
Free radius billing server with practical vpn exmaple
How To Configure Nginx Load Balancer on CentOS 7
How To Install and Configure Salt Master on Ubuntu
Ad

Similar to Firewalld LAB (20)

PDF
Firewalld
PDF
CEH v12 Lesson 4 _ NTP, DNS _ Other Network En (1).pdf
DOCX
INFA 620Laboratory 4 Configuring a FirewallIn this exercise.docx
PDF
Varnish Configuration Step by Step
PDF
Vpn addind technique
ODP
Firewalld : A New Interface to Your Netfilter Stack
DOCX
Installation And Configuration Of DNS, Web And FTP Servers On Virtual Machine...
DOCX
Component pack 6006 install guide
PDF
dachnug51 - HCL Sametime 12 as a Software Appliance.pdf
PDF
Oracle cluster installation with grid and nfs
PDF
Lamp Server With Drupal Installation
PDF
Install nagios
PDF
Install nagios
PDF
Install nagios
DOCX
How to install squid proxy on server or how to install squid proxy on centos o
PDF
DENOG9 - Automating Juniper Devices with Ansible
PPTX
Vagrant, Ansible, and OpenStack on your laptop
PDF
Nat mikrotik
PDF
OSMC 2019 | Use Cloud services & features in your redundant Icinga2 Environme...
PPTX
Upgrading AD from Windows Server 2003 to Windows Server 2008 R2
Firewalld
CEH v12 Lesson 4 _ NTP, DNS _ Other Network En (1).pdf
INFA 620Laboratory 4 Configuring a FirewallIn this exercise.docx
Varnish Configuration Step by Step
Vpn addind technique
Firewalld : A New Interface to Your Netfilter Stack
Installation And Configuration Of DNS, Web And FTP Servers On Virtual Machine...
Component pack 6006 install guide
dachnug51 - HCL Sametime 12 as a Software Appliance.pdf
Oracle cluster installation with grid and nfs
Lamp Server With Drupal Installation
Install nagios
Install nagios
Install nagios
How to install squid proxy on server or how to install squid proxy on centos o
DENOG9 - Automating Juniper Devices with Ansible
Vagrant, Ansible, and OpenStack on your laptop
Nat mikrotik
OSMC 2019 | Use Cloud services & features in your redundant Icinga2 Environme...
Upgrading AD from Windows Server 2003 to Windows Server 2008 R2
Ad

Recently uploaded (20)

PDF
distributed database system" (DDBS) is often used to refer to both the distri...
PDF
737-MAX_SRG.pdf student reference guides
PDF
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
PPTX
Fundamentals of safety and accident prevention -final (1).pptx
PDF
Exploratory_Data_Analysis_Fundamentals.pdf
PDF
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
PPT
Total quality management ppt for engineering students
PPTX
Nature of X-rays, X- Ray Equipment, Fluoroscopy
PDF
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
PDF
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...
PDF
III.4.1.2_The_Space_Environment.p pdffdf
PPTX
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
PPTX
Feature types and data preprocessing steps
PDF
Soil Improvement Techniques Note - Rabbi
PDF
COURSE DESCRIPTOR OF SURVEYING R24 SYLLABUS
PDF
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
EXPLORING LEARNING ENGAGEMENT FACTORS INFLUENCING BEHAVIORAL, COGNITIVE, AND ...
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
distributed database system" (DDBS) is often used to refer to both the distri...
737-MAX_SRG.pdf student reference guides
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
Fundamentals of safety and accident prevention -final (1).pptx
Exploratory_Data_Analysis_Fundamentals.pdf
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
Total quality management ppt for engineering students
Nature of X-rays, X- Ray Equipment, Fluoroscopy
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...
III.4.1.2_The_Space_Environment.p pdffdf
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
Feature types and data preprocessing steps
Soil Improvement Techniques Note - Rabbi
COURSE DESCRIPTOR OF SURVEYING R24 SYLLABUS
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
R24 SURVEYING LAB MANUAL for civil enggi
EXPLORING LEARNING ENGAGEMENT FACTORS INFLUENCING BEHAVIORAL, COGNITIVE, AND ...
Automation-in-Manufacturing-Chapter-Introduction.pdf

Firewalld LAB

  • 1. 1 FIREWALL-CMD LAB  CreatingYour OwnZones While the predefined zones will probably be more than enough for most users, it can be helpful to define your own zones that are more descriptive of their function. For instance, you might want to create a zone for your server, called “privatekaan”. When adding a zone, you must add it to the permanent firewall configuration. You can then reload to bring the configuration into your running session. For instance, we could create the two zones we discussed above by typing:  sudo firewall-cmd --permanent --new-zone=privatekaan (Output  Success)  You can verify that these are present in your permanent configuration by typing:  sudo firewall-cmd --permanent --get-zones (Output  Zones | privatekaan )  As stated before, these won’t be available in the runtime firewall yet:  firewall-cmd --get-zones (Output  Zones without privatekaan)  Reload the firewall to bring these new zones into the active runtime configuration:  sudo firewall-cmd –reload  firewall-cmd --get-zones
  • 2. 2 We can add the DNS service to our privatekaan zone:  sudo firewall-cmd --zone= privatekaan --add-service=dns  sudo firewall-cmd --zone= privatekaan --list-all  We could then change our interfaces over to these new zones to test them out:  sudo firewall-cmd --zone=privatekaan --change-interface=ens160  At this point, you have the opportunity to test your configuration. If these values work for you, you will want to add these rules to the permanent configuration. You could do that by running all the commands again with the --permanent flag appended, but in this case we’ll use the -- runtime-to-permanent flag to save our entire runtime configuration permanently:  sudo firewall-cmd --runtime-to-permanent (Output  Success)
  • 3. 3  After permanently applying these rules, reload the firewall to test that the changes remain:  sudo firewall-cmd –reload (Output  Success)  Validate that the correct zones were assigned:  firewall-cmd --get-active-zones (Output  Success; Success)  And validate that the appropriate services are available for both of the zones:  sudo firewall-cmd --zone=privatekaan --list-services (Output  dns)  You have successfully set up your own zones! If you want to make one of these zones the default for other interfaces, remember to configure that behavior with the --set-default- zone= parameter:  sudo firewall-cmd --set-default-zone=privatekaan (Output  Success)  TestConnection We configured “privatekaan” zone as our default active zone. And now it allows “DNS” traffic. We can analyze via “tcpdump”  From F5 BIG IP Device. Wehave“10.30.30.50” SelfIP for internal network
  • 4. 4  From Apache Server. WecanseetheDNStraffic coming from our F5BIGIP Syntax is  tcpdump –i ens160 host 10.30.30.50  As we can see, we are able to analyze the TCP handshake between our F5 internal IP and CentOS 8 Apache Server. Note: We removed the “SSH Service” from our active zone “privatekaan” but the connection wasn’t dropped. It holds the previous sessions. If you try to reconnect again via SSH, you will not establish a successful connection.
  • 5. 5  Now we will allow the SSH service. Syntax is shown below:  sudo firewall-cmd –zone=privatekaan –add-service=ssh –permenant (Note: Since it is not our root user, it will ask for “sudo password”)  We can see the services under our active zone on interface  sudo firewall-cmd –zone=privatekaan –list-services –permenant  Reload the firewall  sudo firewall-cmd –reload  Now we are able to connect to our Apache Server via SSH 1/18/2022 X Kaan Aslandag Signed by: www.kaan1.com