在服务器上跑一个服务,如果不对这个服务对外开放,外部系统是无法访问的。就比如在服务器上部署一个在8080端口监听的http服务,如果8080端口没对外开放,外部的浏览器是访问不到的。
一、系统版本
查看redhat系的系统版本:
$ cat /etc/redhat-release
CentOS Linux release 7.1.1503 (Core)
centos7之后,防火墙用的是firewall。
二、查看firewall状态
$ systemctl status firewalld
三、增加开放端口