• 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. Input/Output Errors During XFS Filesystem Access In CentOS/RHEL 7
  2. dmenu Command Examples in Linux
  3. How to Install Mokutil package on CentOS/RHEL 7 and 8
  4. blight Command Examples in Linux
  5. debman Command Examples in Linux
  6. nslookup Command Examples in Linux
  7. check-support-status: command not found
  8. iostat: command not found
  9. How to recover GRUB (Corrupted boot partition) in CentOS/RHEL 5,6
  10. CentOS / RHEL : How to assemble a software RAID in Rescue mode

You May Also Like

Primary Sidebar

Recent Posts

  • nixos-rebuild Command Examples in Linux
  • nixos-option: Command Examples in Linux
  • nixos-container : Command Examples in Linux
  • nitrogen Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright