centOS firewall-cmd 防火墙

本文涉及的产品
云防火墙,500元 1000GB
简介: CentOS 7 中firewall-cmd命令  (2014-11-11 16:01:25) 转载▼ 标签:  股票   分类: linux 在 CentOS 7 暫時開放 ftp...

CentOS 7 中firewall-cmd命令

  (2014-11-11 16:01:25)
标签: 

股票

 
分类: linux

在 CentOS 7
暫時開放 ftp 服務
firewall-cmd --add-service=ftp

永久開放 ftp 服務
firewall-cmd --add-service=ftp --permanent
永久關閉
firewall-cmd --remove-service=ftp --permanent
success

讓設定生效
systemctl restart firewalld

檢視設定是否生效
iptables -L -n | grep 21
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:21 ctstate NEW

檢查防火牆狀態
firewall-cmd --state
running

systemctl stop firewalld
firewall-cmd --state
not running


firewall-cmd --list-all
public (default)
  interfaces:
  sources:
  services: dhcpv6-client ftp ssh
  ports:
  masquerade: no
  forward-ports:
  icmp-blocks:
  rich rules:

在 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 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

查詢服務的啟用狀態
firewall-cmd --query-service ftp
yes
firewall-cmd --query-service ssh
yes
firewall-cmd --query-service samba
no
firewall-cmd --query-service http
no

自行加入要開放的 Port
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:
目录
相关文章
|
4月前
|
Linux 网络安全
Centos 防火墙端口控制命令
Centos 防火墙端口控制命令
98 3
|
4月前
|
网络协议 安全 Linux
linux配置防火墙 Centos7下 添加 端口白名单
linux配置防火墙 Centos7下 添加 端口白名单
846 0
|
4月前
|
XML 安全 Linux
【Linux】深入探究CentOS防火墙(Firewalld):基础概念、常用命令及实例操作
【Linux】深入探究CentOS防火墙(Firewalld):基础概念、常用命令及实例操作
|
4月前
|
Linux 网络安全
centos7如何关闭防火墙
centos7如何关闭防火墙
449 3
|
4月前
|
网络协议 Linux 网络安全
CentOS 7 防火墙指令
本文介绍了CentOS 7中管理防火墙`firewalld`的指令。
70 0
|
4月前
|
网络协议 Linux 网络安全
Linux(17)Centos5、6、7、8版本的防火墙常用命令
Linux(17)Centos5、6、7、8版本的防火墙常用命令
87 0
|
4月前
|
网络协议 Linux 网络安全
Centos7 防火墙策略rich-rule 限制ip访问-----图文详解
Centos7 防火墙策略rich-rule 限制ip访问-----图文详解
676 0
|
29天前
|
安全 Linux 应用服务中间件
在Linux中,包过滤防火墙与代理应用防火墙有什么区别?有哪些相应的产品?
在Linux中,包过滤防火墙与代理应用防火墙有什么区别?有哪些相应的产品?
|
18天前
|
机器学习/深度学习 安全 网络协议
Linux防火墙iptables命令管理入门
本文介绍了关于Linux防火墙iptables命令管理入门的教程,涵盖了iptables的基本概念、语法格式、常用参数、基础查询操作以及链和规则管理等内容。
178 73
|
23天前
|
Linux 网络安全
linux关闭方防火墙的命令
linux关闭方防火墙的命令
34 2