CentOS 7 中firewall-cmd命令详细介绍
CentOS7中firewall-cmd命令
在CentOS7
暂时开放ftp服务
#firewall-cmd--add-service=ftp
永久开放ftp服务
#firewall-cmd--add-service=ftp--permanent
永久关闭
#firewall-cmd--remove-service=ftp--permanent
success
让设定生效
#systemctlrestartfirewalld
检查设定是否生效
#iptables-L-n|grep21
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcpdpt:21ctstateNEW
检查防火墙状态
#firewall-cmd--state
running
#systemctlstopfirewalld
#firewall-cmd--state
notrunning
#firewall-cmd--list-all public(default) interfaces: sources: services:dhcpv6-clientftpssh ports: masquerade:no forward-ports: icmp-blocks: richrules:
在FirewallD的服务名称
#firewall-cmd--get-service amanda-clientbaculabacula-clientdhcpdhcpv6dhcpv6-clientdnsftp high-availabilityhttphttpsimapsippipp-clientipseckerberoskpasswd ldapldapslibvirtlibvirt-tlsmdnsmountdms-wbtmysqlnfsntpopenvpn pmcdpmproxypmwebapipmwebapispop3spostgresqlproxy-dhcpradius rpc-bindsambasamba-clientsmtpsshtelnettftptftp-clienttransmission-clientvnc-serverwbem-https
查询服务的启用状态
#firewall-cmd--query-serviceftp
yes
#firewall-cmd--query-servicessh
yes
#firewall-cmd--query-servicesamba
no
#firewall-cmd--query-servicehttp
no
自行加入要开放的Port
#firewall-cmd--add-port=3128/tcp #firewall-cmd--list-all public(default) interfaces: sources: services:dhcpv6-clientftpssh ports:3128/tcp masquerade:no forward-ports: icmp-blocks: richrules:
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
热门推荐
3 祝福语简短的微信
10 幼儿祝福语大全简短贺卡
11 感谢教官文案祝福语简短
12 鼠年同事祝福语简短创意
13 元旦祝福语 简短独特群发
14 妈咪跟我生日祝福语简短
15 给儿子新婚祝福语简短
16 伴娘祝福语长文案简短
17 恭喜高考完祝福语简短
18 生日祝福语送老公简短