Results 1 to 3 of 3

Thread: UFW delete allow syntax for one particuar rule

  1. #1
    Join Date
    Feb 2008
    Beans
    76
    Distro
    Ubuntu 12.04 Precise Pangolin

    UFW delete allow syntax for one particuar rule

    I've got a silly little question about UFW. I set a rule like this:
    "514/udp ALLOW 192.168.1.0/24"
    I don't even remember exactly what I typed to set it. Anyway, on further reflection, I want to delete this rule. I've tried every combination of "to", "from", "port", "proto", etc. and received every combination of:
    "ERROR: Bad destination address", "ERROR: Wrong number of arguments", "ERROR: Need 'from' or 'to' with 'port'", and read the man ufw pages until my eyes watered. I can't for the life of me figure out how to delete this rule. I'm rapidly approaching the point of absolute fury in trying to get rid of this rule. I even removed and reinstalled UFW. Still there. Rather than destroy a perfectly good computer, well - what was a perfectly good computer until this UFW thing, I figured I'd kindly ask the community for a tip. (If anyone tells me to use Google or read the man pages, a: I've already done that to the point of exhaustion, and b: it will probably push me over the edge into an absolute berzerk rage which we'll all regret!)
    Thanks for any/all help!

  2. #2
    Join Date
    Apr 2012
    Beans
    7,256

    Re: UFW delete allow syntax for one particuar rule

    I've always just deleted by rule number e.g.

    Code:
    $ sudo ufw status numbered
    Status: active
    
         To                         Action      From
         --                         ------      ----
    [ 1] 22/tcp                     ALLOW IN    192.168.1.0/24
    [ 2] 80/tcp                     ALLOW IN    192.168.1.0/24
    
    $ sudo ufw delete 2
    Deleting:
     allow from 192.168.1.0/24 to any port 80 proto tcp

  3. #3
    Join Date
    Feb 2008
    Beans
    76
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: UFW delete allow syntax for one particuar rule

    Quote Originally Posted by steeldriver View Post
    I've always just deleted by rule number e.g.
    Oh, I've tried by number. Believe me.
    Code:
         To                         Action      From
         --                         ------      ----
    [ 1] 514/udp                    ALLOW IN    192.168.1.0/24
    
    sudo ufw delete 1
    The result of that command is the same as running sudo ufw --help
    It's the strangest thing. Also infuriating. Did I mention that? I meant to. I even did su - to become the root user and then tried all of the above. Same effect.
    Last edited by bpb_21; February 26th, 2013 at 04:47 AM. Reason: formatting

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •