Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have membase (membase.org) installed and I have to open a bunch of ports in order for the cluster to function

Adding the single ports was easy enough but I can't work out how to open the range 11200-11299

share|improve this question

3 Answers 3

You can specify port ranges to ufw (the command-line one), using : (colon) to separate the lowest and the highest port in the range. For example:

ufw allow 11200:11299/tcp

Note that the protocol part (/tcp or /udp) is mandatory with port ranges.

This works at least since Ubuntu 10.04.

share|improve this answer
    
+1. By the way ufw allow also opens ports for IPv6 by default. –  Yauhen Yakimovich May 26 at 11:00

I believe you can specify the range in the last tab of new rule, tick the checkbox at the bottom of the window to add more options (just to be safe). The range can be specified as 1000:1010 to open ports 1000-1010.

share|improve this answer
    
Thanks, confusing UI but it works. Now I just need to work out what the command-line would be for ufw –  Pieter Breed Oct 14 '10 at 10:10
    
Try this: ubuntuforums.org/showthread.php?t=823741 –  evgeny Oct 14 '10 at 10:17

The cleanest command line way I've seen is a little script like this:

for i in `seq 11200 11299`; do
  ufw allow $i
done
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.