•  Home
  •  Dashboard
  •  Company
    • About Us
    • Blog
    • Careers
    • Contact Us
    • Data Centers
    • Looking Glass
    • Network
    • Reseller
  •  Hosting Services
    • Infrastructure
      • iColocation
    • Compute
      • cMetal
      • cVirtual
    • Storage
      • sObject
      • sBlock
    • Networking
      • nCDN
      • nIP Transit
      • nWavelength
    • Protection
      • pBackup
      • pDDoS
  •  Solutions
    • Ecommerce
    • Finance
    • Gaming
    • Hosting
    • Management
    • Security
    • System Integrator
  •  Support
    • Community
    • Knowledge Base
    • Open A Ticket
  •  USA & Canada: 800-933-1517
  •  International: 626-549-2801
  •  Email: sales@psychz.net
  • Services
    • new-colocation-header-img
      Infrastructure
      • iColocation
    • new-compute-header-img
      Compute
      • cMetal
      • cVirtual
    • new-storage-header-img
      Storage
      • sObject
      • sBlock
    • new-networking-header-img
      Networking
      • nCDN
      • nIP Transit
      • nWavelength
    • new-protection-header-img
      Protection
      • pBackup
      • pDDoS
  • Solutions
    • Ecommerce
    • Security
    • Gaming
    • Hosting
    • Management
    • Finance
    • System Integrator
  • Dashboard

Centos 7 Firewall Open Port

  • Home
  • Client
  • Qa Forum
  • Centos 7 Firewall Open Port

Posted By: Carlos | 1 Replies | Last Reply On: Oct 06, 2017 06:56:47

How to open a port in centos 7 firewall? 

Psychz - Shaibaz

Votes: 0Posted On: Oct 06, 2017 06:56:47
 

Centos 7 has a service called "firewalld" that maintains its traffic by creating different zones. The tool enables network/firewall zones to define the trust level of network connections and/or interfaces. It supports both IPv4 and IPv6 firewall settings. Firewalld uses zones and services to maintain and divert traffic.


Firewall Zones 

Zones are the set of rules that are pre-constructed in the firewall. You can use any of the zones for various types of traffic. "Public" is the default zone until it is changed. You can set different zones to different interfaces. Also, the services can be assigned to zones such that services are allowed for only that zone.
Here is a sample output of a public zone. 

 

To view the default zone, please run the following command.

sudo firewall-cmd --get-default-zone

 

To view the active zone, please run the following command.

sudo firewall-cmd --get-active-zones


Adding or removing a port to a zone

As you can see in the above screenshot, the value is blank in the port field. We can add a port to the zone by the help of the following command.

sudo firewall-cmd --zone=public --add-port="Enter the port number you want to allow traffic"/tcp --permanent

 

Remove a port

A port can be removed from a zone with the help of the following command.

sudo firewall-cmd --zone=public --remove-port="Enter the port number you want to deny traffic"/tcp --permanent


You can configure interfaces, services, forward the traffic of a port and other fields to the zones that will be discussed in later articles.

Was this reply helpful?

Related topics

  • Firewalld commands for CentOS 7 and CentOS 8
  • CentOS 7: "CALL IT RED HAT 7 LITE"
  • How Does A Firewall Work?
  • turn off firewall centos 7
  • Centos 7 Disable Firewall
  • Linux Firewall DDoS Protection
  • How to configure an IP range on Centos 7?
  • Web Application Firewall(WAF)
  • Setup VPN on CentOS 8
  • Yum Update Not Working on Centos 7
  • Whitelisting Edge Server IPs
  • Top Hosting Control Panels For Linux
  • How To Setup Application Load Balancer Using CDN
  • EasyApache 4: better than ever?
  • In Comparison: FreeBSD VS Linux
Copyright © 2025 Psychz Networks,
A Profuse Solutions Inc Company
Hosting Services
Infrastructure
  • iColocation
Compute
  • cMetal
  • cVirtual
Storage
  • sObject
  • sBlock
Networking
  • nCDN
  • nIP Transit
  • nWavelength
Protection
  • pBackup
  • pDDoS
Company
  • About Us
  • Blog
  • Careers
  • Contact Us
  • Data Centers
  • Looking Glass
  • Network
  • Reseller
Policies
  • Acceptable Usage Policy
  • Privacy Policy
  • Service Level Agreement
  • Terms and Conditions
Support
  • Community
  • Knowledge Base
  • Open A Ticket
Get In Touch
  • Psychz Networks,
    A Profuse Solutions Company
    611 Wilshire Blvd #300
    Los Angeles,California 90017
    USA
  • US/Canada: 800-933-1517
  • International: 626-549-2801