Fedora-防火墙firewall-cmd相关

来源:互联网 发布:黄勇杀人案 知乎 编辑:程序博客网 时间:2024/06/06 01:36

改完后要执行firewall-cmd --reload!!!

查看防火墙状态


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: 

查看当前区域活动的services

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

<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
阅读(152) | 评论(0) | 转发(0) |
0

上一篇:常见字符编码

下一篇: VirtualBox的虚拟机上网以及虚拟机如何与主机互通

相关热门文章
  • linux 常见服务端口
  • xmanager 2.0 for linux配置
  • 【ROOTFS搭建】busybox的httpd...
  • openwrt中luci学习笔记
  • Linux里如何查找文件内容...
  • linux dhcp peizhi roc
  • 关于Unix文件的软链接
  • 求教这个命令什么意思,我是新...
  • sed -e "/grep/d" 是什么意思...
  • 谁能够帮我解决LINUX 2.6 10...
给主人留下些什么吧!~~
原创粉丝点击