Method 1
CentOS:
1. Open the firewall systemctl start firewalld 2. Open the specified port firewall-cmd --zone=public --add-port=1935/tcp --permanent Command meaning: --zone #Scope --add-port=1935/tcp #Add port, the format is: port/communication protocol --permanent #Permanently effective, without this parameter, it will fail after restarting 3. Restart the firewall firewall-cmd --reload 4. Check the port number netstat -ntlp //View all current tcp ports netstat -ntulp |grep 1935 //View all 1935 port usage
Method 2
#Open port: 8080
/sbin/iptables -I INPUT -p tcp –dport 8080 -j ACCEPT
Method 3
-A INPUT -m state –state NEW -m tcp -p tcp –dport 8080 -j ACCEPT
service iptables restart