CentOS 7.1 版本
// 查看 firewalld
[root@wode006 sysconfig]# systemctl status firewalld
firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled)
Active: active (running) since 六 2015-07-04 20:56:57 CST; 1min 52s ago
Main PID: 8911 (firewalld)
CGroup: /system.slice/firewalld.service
└─8911 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid
7月 04 20:56:57 wode006 systemd[1]: Started firewalld - dynamic firewall d...n.
Hint: Some lines were ellipsized, use -l to show in full.
[root@wode006 sysconfig]#
// 查看 zone
[root@wode006 sysconfig]# firewall-cmd --get-active-zones
public
interfaces: enp7s0f0 enp7s0f1
[root@wode006 sysconfig]#
// 添加端口3306,并重启
[root@wode006 sysconfig]# firewall-cmd --permanent --zone=public --add-port=3306/tcp
success
[root@wode006 sysconfig]# firewall-cmd --permanent --zone=public --add-port=3306/udp
success
[root@wode006 sysconfig]# firewall-cmd --reload
success
[root@wode006 sysconfig]#
// 测试
原文地址:http://huangchao.blog.51cto.com/10446378/1670970