CentOS 7.1 版本
// 查看 firewalld
[[email protected] 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.
[[email protected] sysconfig]#
// 查看 zone
[[email protected] sysconfig]# firewall-cmd --get-active-zones
public
interfaces: enp7s0f0 enp7s0f1
[[email protected] sysconfig]#
// 添加端口3306,并重启
[[email protected] sysconfig]# firewall-cmd --permanent --zone=public --add-port=3306/tcp
success
[[email protected] sysconfig]# firewall-cmd --permanent --zone=public --add-port=3306/udp
success
[[email protected] sysconfig]# firewall-cmd --reload
success
[[email protected] sysconfig]#
// 测试