查看firewalld的配置文件:(firewalld的初始状态)
[root@centos8 ~]# cat /etc/firewalld/zones/public.xml
PublicFor use in public areas. You do not trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.
打开一个TCP端口:(TCP 25)
firewall-cmd --zone=public --add-port=25/tcp --permanent
注释: --permanent 永久生效,没有此参数服务器重启后失效
重新加载firewalld的配置:
firewall-cmd --reload