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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • 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. choose: A human-friendly and fast alternative to cut and (sometimes) awk
  2. Understanding RPM Versions and Naming Schemes
  3. funzip: Print the content of the first (non-directory) member in an archive without extraction
  4. iwconfig Command Examples in Linux
  5. mt: command not found
  6. lolcat Command Examples in Linux
  7. expand: Convert tabs to spaces
  8. jobs: command not found
  9. fd: An alternative to find command
  10. tee Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • glab Command Examples
  • “glab repo” Command Examples
  • “glab release” Command Examples
  • “glab pipeline” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright