分类: LINUX
2016-12-24 11:11:01
firewall-cmd --state
输出
running
firewall-cmd --get-active-zones
输出
FedoraWorkstation interfaces: enp3s0
firewall-cmd --get-zone-of-interface=enp3s0
输出
FedoraWorkstation
firewall-cmd --zone=FedoraWorkstation --list-interfaces
输出
enp3s0
firewall-cmd --zone=FedoraWorkstation --list-all
输出
FedoraWorkstation (default, active)
interfaces: enp3s0 sources: services: dhcpv6-client mdns samba-client ssh
ports: 1025-65535/udp 1025-65535/tcp
masquerade: no forward-ports: icmp-blocks: rich rules:
firewall-cmd --get-service
输出
amanda-client amanda-k5-client bacula bacula-client dhcp dhcpv6 dhcpv6-client dns freeipa-ldap freeipa-ldaps freeipa-replication ftp high-availability http https imaps ipp ipp-client ipsec kadmin kerberos kpasswd ldap ldaps libvirt libvirt-tls mdns mountd ms-wbt mysql nfs ntp openvpn pmcd pmproxy pmwebapi pmwebapis pop3s postgresql privoxy proxy-dhcp puppetmaster radius rpc-bind samba samba-client sane smtp squid ssh synergy telnet tftp tftp-client tor-socks transmission-client vnc-server wbem-https xmpp-bosh xmpp-client xmpp-local xmpp-server
firewall-cmd --zone=FedoraWorkstation --add-port=8080/tcp --permanent
firewall-cmd --zone=FedoraWorkstation --add-port=5060-5061/udp --permanent
删除
firewall-cmd --zone=FedoraWorkstation --remove-port=8080/tcp
firewall-cmd --zone=FedoraWorkstation --remove-port=5060-5061/udp
firewall-cmd --zone=FedoraWorkstation --add-service=smtp --permanent
删除
firewall-cmd --zone=FedoraWorkstation --remove-service=smtp