• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to allow all traffic from a server using firewalld in CentOS/RHEL

by admin

This post outlines steps to add a host or network range to a trusted zone, in firewalld, to allow all traffic regardless of the destination port.

To create a rule to allow all traffic from a node or network range, it should use the trusted network zone in firewalld.

1. To add an host to trusted zone do:

# firewall-cmd --zone=trusted --add-source=[source IP address]

For example:

# firewall-cmd --zone=trusted --add-source=10.11.12.13

or to make the rule persistent across reboots:

# firewall-cmd --zone=trusted --add-source=[source IP address] --permanent

2. If a network range is needed instead of an host, the command should be:

# firewall-cmd --zone=trusted --add-source=[network IP]/[netmask]

For example:

# firewall-cmd --zone=trusted --add-source=10.11.12.0/24

Note that when adding public and trusted zone, the public zone takes precedence over the trusted zone, so if there is an overlap, the trusted zone will not be used.

For example:

# firewall-cmd --zone=public --add-source=10.11.12.0/24
# firewall-cmd --zone=trusted --add-source=10.11.12.128/25

this trusted zone will not be used and only the rules for the public will be used.

Filed Under: CentOS/RHEL, CentOS/RHEL 7, CentOS/RHEL 8, Linux

Some more articles you might also be interested in …

  1. How to audit all Commands run on OEL 5,6 using auditd
  2. “-bash: firewall: command not found” – How to resolve in CentOS/RHEL 7
  3. Nohup Command Examples – Runs a Command that Keeps Running after You Log Out
  4. “systemd-udevd: Cannot Allocate Memory” and “A start job is running for dev-mapper-\x2droot.device” – CentOS/RHEL 7 booting issue
  5. Zenoss Core Installation & Configuration on CentOS/RHEL 6.X
  6. Understanding The /proc File System
  7. How to recreate LVM device files under /dev directory using vgmknodes
  8. getfacl Command Examples in Linux
  9. CentOS / RHEL 7 : How to set date, time / NTP and timezone using timedatectl
  10. How to disable NetworkManager on CentOS / RHEL 7

You May Also Like

Primary Sidebar

Recent Posts

  • JavaFX ComboBox: Set a value to the combo box
  • Nginx load balancing
  • nginx 504 gateway time-out
  • Images preview with ngx_http_image_filter_module

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright