linux firewalld 防火墙操作

启动:

systemctl start firewalld

关闭:

systemctl stop firewalld

查看状态:

systemctl status firewalld

开机禁用:

systemctl disable firewalld

开机启用:

systemctl enable firewalld

配置firewalld-cmd

查看版本:

firewall-cmd --version

查看帮助:

firewall-cmd --help

显示状态:

firewall-cmd --state

重新载入:

firewall-cmd --reload

固定ip访问固定端口命令

firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="ip地址" port protocol="tcp" port="端口号" accept"

删除固定ip访问固定端口命令

firewall-cmd --permanent --remove-rich-rule="rule family="ipv4" source address="ip地址" port protocol="tcp" port="端口号" accept"

查看已添加的ip地址和端口信息

firewall-cmd --list-rich-rules

添加开放端口

 firewall-cmd --zone=public --add-port=82/tcp --permanent

查看开放的端口

firewall-cmd --list-port

 

posted @ 2020-07-20 09:12  译林  阅读(153)  评论(0编辑  收藏  举报