安装 iptables
CentOS 7
yum install iptables
yum install iptables-services
启动 iptables
关闭 firewall
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
systemctl restart iptables # 启动iptables
systemctl enable iptables # 开机启动iptables
编辑规则
修改文件 /etc/sysconfig/iptables
开放端口号 4000
-A INPUT -p tcp -m tcp --dport 4000 -j ACCEPT