centOS firewall

  • 时间:
  • 浏览:4

public (default)  interfaces:  sources:  services: dhcpv6-client ftp ssh  ports:  masquerade: no  forward-ports:  icmp-blocks:  rich rules: 在 FirewallD 的服務名稱

public (default)  interfaces:  sources:  services: dhcpv6-client ftp ssh  ports: 3128/tcp  masquerade: no  forward-ports:  icmp-blocks:  rich rules:

ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:21 ctstate NEW

檢視設定是算不算生效

success 讓設定生效

nofirewall-cmd --query-service http

not runningfirewall-cmd --list-all

runningsystemctl stop firewalld

yesfirewall-cmd --query-service ssh

在 CentOS 7

暫時開放 ftp 服務

firewall-cmd --add-service=ftp

永久開放 ftp 服務

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 ms-wbt mysql nfs ntp openvpn pmcd pmproxy pmwebapi pmwebapis pop3s postgresql proxy-dhcp radius rpc-bind samba samba-client smtp ssh telnet tftp tftp-client transmission-client vnc-server wbem-https 查詢服務的啟用狀態

檢查防火牆狀態

no 自行加入要開放的 Port

yesfirewall-cmd --query-service samba