centos 7 改用 firewalld

https://blog.gtwang.org/linux/centos-7-firewalld-command-setup-tutorial/

[root@dns9 ~]# firewall-cmd --get-default-zone
public
[root@dns9 ~]# firewall-cmd --get-active-zones
public
  interfaces: enp2s0
[root@dns9 ~]# firewall-cmd --get-zone-of-interface=enp2s0
public
[root@dns9 ~]# firewall-cmd --get-services
RH-Satellite-6 amanda-client amanda-k5-client bacula bacula-client bitcoin bitcoin-rpc bitcoin-testnet bitcoin-testnet-rpc ceph ceph-mon cfengine condor-collector ctdb dhcp dhcpv6 dhcpv6-client dns docker-registry dropbox-lansync elasticsearch freeipa-ldap freeipa-ldaps freeipa-replication freeipa-trust ftp ganglia-client ganglia-master high-availability http https imap imaps ipp ipp-client ipsec iscsi-target kadmin kerberos kibana klogin kpasswd kshell ldap ldaps libvirt libvirt-tls managesieve mdns mosh mountd ms-wbt mssql mysql nfs nrpe ntp openvpn ovirt-imageio ovirt-storageconsole ovirt-vmconsole pmcd pmproxy pmwebapi pmwebapis pop3 pop3s postgresql privoxy proxy-dhcp ptp pulseaudio puppetmaster quassel radius rpc-bind rsh rsyncd samba samba-client sane sip sips smtp smtp-submission smtps snmp snmptrap spideroak-lansync 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 --zone=public --add-service=http
firewall-cmd --zone=public --permanent --add-service=http

firewall-cmd --zone=public --add-service=https
firewall-cmd --zone=public --permanent --add-service=https

移除 
firewall-cmd --zone=public --remove-service=http
firewall-cmd --zone=public --permanent --remove-service=http

 

 

Tags