項目需求開啟非80端口,在此記錄方便以后查詢
#1.系統為Ubuntu16
#2,運營商阿里云
查看系統開的端口命令有很多,這里使用
sudo netstat -plant
查看防火墻限制
sudo iptables -L
特定端口
sudo iptables -L | grep xxxx
開啟端口,先打開iptables配置文件
sudo vim /etc/iptables.rules
如圖
image.png
需要新增的端口同其他端口配置
保存配置文件
sudo iptables-restore < /etc/iptables.rules
最后查看是否生效
sudo iptables -nL