How to open a range ports in debian?

October 19, 2016 17.4k views
Development Debian

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!

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 :)

Have another answer? Share your knowledge.