Linux Firewall (firewalld, firewall-cmd, firewall-config)

{tocify} $title = {Mục lục}
Hôm nay có việc đụng đến Firewall trên Centos 7 nên sẵn post bài này lên đây luôn cho những anh em nào cần.
Đỡ tốn thời gian tìm hiểu về firewalld khi lọ mọ mới chuyển từ iptables sang ^^!
Fedora 18 introduced firewalld as a replacement for the previous iptables service. Since RHEL7 and Oracle Linux 7 are based on Fedora 19, the switch from iptables service to firewalld is now part of the Enterprise Linux distributions. This article is a rework of the previous Linux Firewall article, bringing it up to date.
Note. You need to distinguish between the iptables service and the iptables command. Although firewalld is a replacement for the firewall management provided by iptables service, it still uses the iptables command for dynamic communication with the kernel packet filter (netfilter). So it is only the iptables service that is replaced, not the iptables command. That can be a confusing distinction at first.
Most installations will include the firewall functionality, but if you need to manually install it, do the following.