Quantcast
Channel: Magnus K Karlsson
Viewing all articles
Browse latest Browse all 526

Introduction to firewalld in RHEL 7

$
0
0

Overview

Figure The Firewall Stack https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Security_Guide/sec-Using_Firewalls.html

firewall-cmd

Everything in firewalld are organized in zones.

--list-all-zonesList everything for every zones.
--get-active-zonesPrint currently active zones altogether with interfaces and sources used in these zones.
--get-default-zonePrint default zone for connections and interfaces.
--set-default-zone=<ZONE>Set default zone for connections and interfaces.
--add-source= [--zone=<ZONE>]Bind source to zone.
--remove-source= [--zone=<ZONE>]Unbind source to zone.
--add-interface= [--zone=<ZONE>]Bind interface to zone.
--change-interface= [--zone=<ZONE>]Bind interface to different zone.

Comments for zones from RHEL 7 Security Guide Using Firewalls.

publicFor use in public areas. You do not trust the other computers on the network to not harm your computer. Only selected incoming connections are accepted.
externalFor use on external networks with masquerading enabled especially for routers. You do not trust the other computers on the network to not harm your computer. Only selected incoming connections are accepted.
dmzFor computers in your demilitarized zone that are publicly-accessible with limited access to your internal network. Only selected incoming connections are accepted.
workFor use in work areas. You mostly trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.
homeFor use in home areas. You mostly trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.
internalFor use on internal networks. You mostly trust the other computers on the networks to not harm your computer. Only selected incoming connections are accepted.
trustedAll network connections are accepted.

Below are commands to alter firewall. All command are only added in runtime and first adding options --permanent while it be written to disk and made permanent.

--get-servicesList all predefined services.
--add-service= [--zone=<ZONE>]Open/allow traffic to service.
--remove-service= [--zone=<ZONE>]Remove/deny traffic to serice
--add-port= [--zone=<ZONE>]Open/allow traffic on port and protocol.
--remove-port= [--zone=<ZONE>]Remove/deny on port and protocol.
--reloadReload persistent rules from /usr/lib/firewalld/ and /etc/firewalld/.

Examples


Viewing all articles
Browse latest Browse all 526

Trending Articles