Report this

What is the reason for this report?

How to open a range ports in debian?

Posted on October 19, 2016

Hi, 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!



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

Hello, @thiago.tda

As per @xMudrii reply you can use UFW in order to do that.

UFW, or Uncomplicated Firewall, is an interface to iptables that is geared towards simplifying the process of configuring a firewall. While iptables is a solid and flexible tool, it can be difficult for beginners to learn how to use it to properly configure a firewall. If you’re looking to get started securing your network and are not sure which tool to use, UFW may be the right choice for you.

You can check our full tutorial here for Debian 10:

https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-with-ufw-on-debian-10

Allowing Specific Port Ranges

You can specify port ranges with UFW. For example, some applications use multiple ports instead of a single port.

For example, to allow X11 connections, which use ports 6000-6007, use these commands:

sudo ufw allow 6000:6007/tcp sudo ufw allow 6000:6007/udp

Hope that this helps! Regards, Alex

Hi @thiago.tda,

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

In case you are using IPTABLES:

  1. sudo iptables -A INPUT -p udp -m udp --dport 5060 -j ACCEPT
  2. 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:

  1. sudo ufw allow 5060/udp
  2. sudo ufw allow 10000:20000/udp

Good luck :)

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.