February 9, 2010 · Security · Email This Post
Share

If you're new here, you may want to subscribe to my RSS feed and if you have questions related to your ubuntu system post question to our forums. Thanks for visiting!

If you want to setup firewall rule with UFW use the one of the following procedure

Solution 1

You can install gufw to manage UFW through GUI

sudo apt-get install gufw

Solution 2

If you want to Open tcp range from 33400 to 33444

Use the following syntax from your terminal

ufw allow proto tcp to any port 33400:33444

Solution 3

1) First you need to edit /var/lib/ufw/user.rules file

gksudo gedit /var/lib/ufw/user.rules

Now you need to add your rule after ### RULES ###

# Test rule to Open tcp range from 33400 to 33444
-A ufw-user-input -p tcp --dport 33400:33444 -j ACCEPT

  • Share/Bookmark

Related Articles

3 Comments to “How to manage range of ports in UFW”

  1. Jamie Strandboge says:

    Editing user.rules directly is not recommended because the file is managed by ufw and these changes will be lost the next time a rule is added, modified or removed via ufw or gufw. Please use solution 1 or 2 instead.

  2. Gilbert Dion says:

    There is a type in the command line:

    gksuo gedit /var/lib/ufw/user.rules

    gksuo should be gksudo…

  3. admin says:

    Updated main article.Thanks for your comment

Leave a Reply