Centos 6、7防火墙iptables开放指定端口(80)和设置ftp的方法
查看开放的端口
sudo /etc/init.d/iptables status
开放指定端口
开放80端口,允许数据包从80端口进入,开放其它端口一样改成对应的数字,比如ftp21和ssh的22端口
sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT
保存所做的更改
sudo /etc/rc.d/init.d/iptables save
ftp的设置方法
sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
更多请看 https://www.zhaokeli.com/article/8112.html
首发 http://www.foxwho.com/article/95 .
同步自 我的博客 http://www.foxwho.com