CentOS7离线安装firewalld及端口配置
一、安装
1. 依赖模块
ebtables-2.0.10-13.el7.x86_64.rpm
libselinux-python-2.2.2-6.el7.x86_64.rpm
python-slip-0.4.0-2.el7.noarch.rpm
python-slip-dbus-0.4.0-2.el7.noarch.rpm
firewalld-0.3.9-14.el7.noarch.rpm
2. 安装模块
rpm -ivh ebtables-2.0.10-13.el7.x86_64.rpm
rpm -ivh libselinux-python-2.2.2-6.el7.x86_64.rpm
rpm -ivh python-slip-0.4.0-2.el7.noarch.rpm
rpm -ivh python-slip-dbus-0.4.0-2.el7.noarch.rpm
rpm -ivh firewalld-0.3.9-14.el7.noarch.rpm --nodeps --force
3. 相关rpm打包下载地址
https://files.cnblogs.com/files/luoxiaolei/安装firewalld.zip
二、开放端口
1. 开放端口
firewall-cmd --zone=public --add-port=80/tcp --permanent
systemctl restart firewalld.service
2. 针对特定IP开放特定端口
source address 特定IP
port port 特定端口
firewall-cmd --permanent --add-rich-rule="rule family=ipv4 source address=11.64.221.10 port port=3306 protocol=tcp accept"
firewall-cmd --reload