Page 1 of 1

error deleting firewall rule in GUFW [solved]

Posted: Thu Feb 17, 2011 4:28 pm
by jomaweb
Hi

trying to delete some previous added rules in GUFW I get an error: "error executing operation" (translated from my Spanish desktop)

is there any other way to delete some user rules?

thanks

Re: error deleting firewall rule in GUFW

Posted: Sat Feb 19, 2011 4:09 pm
by CiaW
I had one I wanted to delete but hadn't yet, so I tried it and got the same error. I decided to try opening it in a root terminal to see if there was any error message output and there wasn't. I checked /var/log/messages and didn't see anything. I enabled ufw logging for level warn under preferences, tried again and it just shows the command to delete the ALLOW but nothing else.

So basically I'm in the same boat... :?

Re: error deleting firewall rule in GUFW

Posted: Sat Feb 19, 2011 5:25 pm
by hippy
Try it this way:

Open a terminal and delete it from there.

example: sudo ufw delete deny 23399/tcp

Re: error deleting firewall rule in GUFW

Posted: Sat Feb 19, 2011 6:24 pm
by jomaweb
sudo ufw delete allow from 192.168.1.128/tcp
ERROR: Bad source address

Re: error deleting firewall rule in GUFW

Posted: Sat Feb 19, 2011 6:40 pm
by hippy
Ah you wish to remove the Ip, i was thinking ports in my example.

Try it this way then:

sudo ufw delete allow from 192.168.1.7

Re: error deleting firewall rule in GUFW

Posted: Sun Feb 20, 2011 5:36 am
by jomaweb
sudo ufw delete allow from 192.168.1.128
[sudo] password for jose:
Could not delete non-existent rule


But you know? that rule exists. I can see it in GUFW

Re: error deleting firewall rule in GUFW

Posted: Sun Feb 20, 2011 8:09 am
by hippy
jomaweb wrote:sudo ufw delete allow from 192.168.1.128
[sudo] password for jose:
Could not delete non-existent rule


But you know? that rule exists. I can see it in GUFW
I am not sure as to why this is not working for you, on my pc i set up the rule you have as a trial using GUFW then opened a terminal and deleted it using the command i gave above with no problems.

To try to help further please post the result of sudo ufw status

You can also check the different commands that you can use by again opening up a terminal and typing "man ufw" (without quotes) as well as that i did some searching and found this also which may help https://help.ubuntu.com/community/UFW

Hope this helps jomaweb

Re: error deleting firewall rule in GUFW

Posted: Sun Feb 20, 2011 1:52 pm
by CiaW
Using the syntax above didn't work for me either, but I wasn't trying to delete an IP just a port/tcp -- but it did come up with a help screen which left me confused. So I decided to read the man pages, and here's some of what it says relevant to deleting a rule:
To delete a rule, simply prefix the original rule with delete. For
example, if the original rule was:
ufw deny 80/tcp
Use this to delete it:
ufw delete deny 80/tcp
You may also specify the rule by NUM, as seen in the status numbered
output. For example, if you want to delete rule number '3', use:
ufw delete 3
So what I did was type (in a root terminal) 'ufw status numbered' (sans quotes) and got the output with numbers in front of the few rules I have. I then typed ufw delete 6 and it asked me to confirm:
Deleting:
allow 54161/udp
Proceed with operation (y|n)? y
and the rule was deleted! I then ran the ufw status numbered again to find the new number for the 2nd one I wanted to delete and realized it might be better to delete the higher number first so that the lower numbers higher on the list don't get renumbered, if you want to delete more than 1 rule. Once again, rtfm saves the day. :D

Re: error deleting firewall rule in GUFW [solved]

Posted: Sun Feb 20, 2011 2:17 pm
by jomaweb
CiaW wrote:Using the syntax above didn't work for me either, but I wasn't trying to delete an IP just a port/tcp -- but it did come up with a help screen which left me confused. So I decided to read the man pages, and here's some of what it says relevant to deleting a rule:
To delete a rule, simply prefix the original rule with delete. For
example, if the original rule was:
ufw deny 80/tcp
Use this to delete it:
ufw delete deny 80/tcp
You may also specify the rule by NUM, as seen in the status numbered
output. For example, if you want to delete rule number '3', use:
ufw delete 3
So what I did was type (in a root terminal) 'ufw status numbered' (sans quotes) and got the output with numbers in front of the few rules I have. I then typed ufw delete 6 and it asked me to confirm:
Deleting:
allow 54161/udp
Proceed with operation (y|n)? y
and the rule was deleted! I then ran the ufw status numbered again to find the new number for the 2nd one I wanted to delete and realized it might be better to delete the higher number first so that the lower numbers higher on the list don't get renumbered, if you want to delete more than 1 rule. Once again, rtfm saves the day. :D

this way works like a charm!!!

thank's a lot CiaW