CentOS 7 firewall-cmd Command
Centos 7 firewall commands
In CentOS 7
Centos 7 firewall cmd
Open FTP Service temporarily
# Firewall-cmd--add-service=ftp
Permanent Open FTP Service
# Firewall-cmd--add-service=ftp--permanent
How to open firewall in centos 7
Permanently closed
# Firewall-cmd--remove-service=ftp--permanent
Success
Let the settings take effect
# systemctl Restart Firewalld
Turn on firewall centos 7
Check that the settings are in effect
# iptables-l-N | grep 21
ACCEPT TCP--0.0.0.0/0 0.0.0.0/0 TCP dpt:21 ctstate NEW
Check firewall status
# Firewall-cmd--state
Running
Enable port firewall centos 7
# Systemctl Stop Firewalld
# Firewall-cmd--state
Not running
How to check firewall rules in centos 7
# firewall-cmd--list-all public
(default)
interfaces:
Sources:
services:dhcpv6-client ftp ssh
Ports:
masquerade:no
forward-ports:
icmp-blocks:
Rich rules:
Name of service in FIREWALLD
# firewall-cmd--get-service
amanda-client bacula bacula-client dhcp DHCPv6 dhcpv6-client DNS FTP
High-availability http HTTPS imaps IPP ipp-client IPSec Kerberos kpasswd
LDAP ldaps libvirt libvirt-tls MDNs mountd m S-WBT MySQL NFS ntp openvpn
pmcd pmproxy pmwebapi pmwebapis pop3s postgresql proxy-dhcp radius
rpc-bind Samba SA mba-client smtp ssh telnet tftp tftp-client transmission-client vnc-server Wbem-https
The enabled state of the query service
# Firewall-cmd--query-service FTP
Yes
# firewall-cmd--query-service SSH
Yes
# Firewall-cmd--query-service Samba
No
# Firewall-cmd--query-service http
No
Join the Port you want to open yourself
# firewall-cmd--add-port=3128/tcp
# firewall-cmd--list-all public
(default)
interfaces:
sources:
services:dhcpv6-client ftp ssh
ports:3128/tcp
masquerade:no
forward-ports:
icmp-blocks:
Rich rules:
Thank you for reading, I hope to help you, thank you for your support for this site!