Centos 7 firewalld常用命令
firewalld是centos7的一大特性,最大的好处有两个:支持动态更新,不用重启服务;第二个就是加入了防火墙的“zone”概念。
◾永久打开一个端口: firewall-cmd –permanent –add-port=8080/tcp
◾永久关闭一个端口: firewall-cmd –permanent –remove-port=8080/tcp
◾永久打开某项服务: firewall-cmd –permanent –add-service=http
◾永久关闭某项服务: firewall-cmd –permanent –remove-service=http
◾进行端口转发: firewall-cmd –permanent –add-forward-port=port=80:proto=tcp:toport=8080:toaddr=192.0.2.55
◾允许转发到其他地址: firewall-cmd –permanent –add-masquerade
◾重新加载防火墙: firewall-cmd –reload
运行、停止、禁用firewalld
◾启动:# systemctl start firewalld
◾查看状态:# systemctl status firewalld 或者 firewall-cmd –state
◾停止:# systemctl disable firewalld
◾禁用:# systemctl stop firewalld
配置firewalld
◾查看版本: firewall-cmd –help
◾查看设置: ◾显示状态: firewall-cmd –get-active-zones
◾查看指定接口所属区域:$ firewall-cmd –get-zone-of-interface=eth0
◾拒绝所有包:# firewall-cmd –panic-on
◾取消拒绝状态:# firewall-cmd –panic-off
◾查看是否拒绝:$ firewall-cmd –query-panic
转自-小过的布拉格
https://xiaoguo.net/wiki/centos-7-firewalld.html
推荐阅读
-
Centos 7防火墙Firewall
-
Linux常用软件安装与配置(CentOS7)
-
Centos 7 firewalld常用命令
-
Centos 7安装使用firewall
-
centos7最小化安装下命令行界面安装图形化界面方法+下载图形化界面重启后进入不了图形化界面的解决方法
-
CentOS7根目录磁盘扩容(/dev/mapper/centos-root 空间不足)
-
centos7开机不进入图形界面
-
java 程序在windows上传输文件/目录(文件夹)到linux(centOS7)
-
centos7 lvm分区扩容
-
Virtualbox - windows下挂载本地文件夹到Linux(CentOS7)虚拟机