开启端口或服务

查看预定义服务

# firewall-cmd --get-service
RH-Satellite-6 amanda-client amanda-k5-client bacula bacula-client ceph ceph-mon dhcp dhcpv6 dhcpv6-client dns docker-registry dropbox-lansync freeipa-ldap freeipa-ldaps freeipa-replication ftp high-availability http https imap imaps ipp ipp-client ipsec iscsi-target kadmin kerberos kpasswd ldap ldaps libvirt libvirt-tls mdns mosh mountd ms-wbt mysql nfs ntp openvpn pmcd pmproxy pmwebapi pmwebapis pop3 pop3s postgresql privoxy proxy-dhcp ptp pulseaudio puppetmaster radius rpc-bind rsyncd samba samba-client sane smtp smtps snmp snmptrap squid ssh synergy syslog syslog-tls telnet tftp tftp-client tinc tor-socks transmission-client vdsm vnc-server wbem-https xmpp-bosh xmpp-client xmpp-local xmpp-server

永久开启服务

# firewall-cmd --permanent --zone=public --add-service=http

临时开启服务

# firewall-cmd --zone=public --add-service=http

永久开启端口

#firewall-cmd --permanent --zone=public --add-port=8080-8081/tcp

临时开启端口

#firewall-cmd  --zone=public --add-port=8080-8081/tcp

重新加载规则

# firewall-cmd --reload

查询已经开启的服务

# firewall-cmd --permanent --zone=public --list-services 

查询已经开启的端口

# firewall-cmd --permanent --zone=public --list-ports

[ 编辑 | 历史 ]
最近由“jilili”在“2017-06-26 08:05:10”修改