February 9, 2010 · Security · Email This Post

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

Sponsored Link

Incoming search terms:

Related posts

4 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.

    [Reply]

  2. Gilbert Dion says:

    There is a type in the command line:

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

    gksuo should be gksudo…

    [Reply]

    admin Reply:

    Updated main article.Thanks for your comment

    [Reply]

  3. Jason Fulton says:

    The ufw sytanx to use is:

    ufw allow 33400:33444/tcp

    Hope that helps someone.

    [Reply]

Leave a Reply