How to open a range ports in debian?

Posted October 19, 2016 26.2k views

I don’t cant open a range ports.
For exemple: range: 10000/20000 UPD and open port 5060/UDP, how to make?

Tks, sorry my english!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

1 answer

Hi @thiago.tda,

If you are trying to open a range ports for firewall follow one of solutions.

In case you are using IPTABLES:

  • sudo iptables -A INPUT -p udp -m udp --dport 5060 -j ACCEPT
  • sudo iptables -A INPUT -p udp -m udp --dport 10000:20000 -j ACCEPT

It is very probably that you are using IPTABLES so I recommend you to go with it.

If you somehow use ufw following will help:

  • sudo ufw allow 5060/udp
  • sudo ufw allow 10000:20000/udp

Good luck :)

Submit an Answer