25 views

Open Port 80 in CentOS 7

To open port in Centos 7, use firewall-cmd (this is the command instead of iptables)

firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --reload

This command needs to be run as the root user.
Example:

[root@askdevops ~]# firewall-cmd --permanent --add-port=80/tcp
success
[root@askdevops ~]# firewall-cmd --reload
success

To list open ports

[root@askdevops ~]# firewall-cmd --list-ports
80/tcp

To list complete firewall status

[root@askdevops ~]# firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: enp0s3
  sources:
  services: ssh dhcpv6-client
  ports: 80/tcp
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:
Aug 28, 2018 by | 25 views
DevOpsRun.com is LIVE!

Articles for DevOps Geeks
MobaXterm Customization
CHMOD Explained!
Bash history powerful tips
Ubuntu bash from Windows
..