firewalld

### 基本操作
###### 安装
yum -y install firewalld
###### 图形安装
yum -y install firewall-config
###### 开机启动
systemctl enable firewalld
###### 禁止开机启动
systemctl disable firewalld
###### 查看状态
systemctl status firewalld
###### 启动/停止/重启firewalld
systemctl start firewalld
systemctl stop firewalld
systemctl restart firewalld

##### 添加服务,其实就是开启22端口
firewall-cmd –permanent –add-service=ssh
##### 添加端口
firewall-cmd –permanent –add-port=1234/tcp
##### 删除服务
firewall-cmd –permanent –remove-service=ssh
##### 删除端口
firewall-cmd –permanent –remove-port=1234/tcp
##### 立即生效
firewall-cmd –reload
##### 查看被firewalld允许的服务
firewall-cmd –permanent –list-all
##### 端口转发
###### 将80端口转发至8080
firewall-cmd –add-forward-port=port=80:proto=tcp:toport=8080
###### 将80端口转发至192.168.0.1
firewall-cmd –add-forward-port=port=80:proto=tcp:toaddr=192.168.0.1
###### 将80端口的流量转发至192.168.0.1的8080端口
firewall-cmd –add-forward-port=port=80:proto=tcp:toaddr=192.168.0.1:toport=8080
###### 删除端口转发
firewall-cmd –remove-forward-port=port=80:proto=tcp:toaddr=192.168.0.1

###### 查看转发端口
firewall-cmd –list-forward-ports

###### 参考
https://havee.me/linux/2015-01/using-firewalls-on-centos-7.html
http://blog.51cto.com/anspace/1956403
https://blog.csdn.net/slovyz/article/details/78487182
https://my.oschina.net/sokes/blog/826705