Many people asked us, how to open ports in Linux?, is it difficult?
In this post we will help you to open the ports without any problems and some tricks for this.
First is the command to open all port’s
iptables -I ENTRY -j ACCEPT

Now we will tell you how to open a port or several at the same time with different formats.
▸Only 1 TCP port
sudo iptables -I INPUT -p tcp –dport 8765 -j ACCEPT
▸Only 1 UDP port
sudo iptables -I INPUT -p UDP –dport 8765 -j ACCEPT
Now how to open several port’s at the same time.
▸TCP
sudo iptables -I INPUT -p UDP –dport 7000: 8000 -j ACCEPT
▸UDP
sudo iptables -I INPUT -p UDP –dport 7000: 8000 -j ACCEPT
This way the ports from 7000 to 8000 are open.
What is a port and more info: https://www.journaldev.com/34113/opening-a-port-on-linux