error deleting firewall rule in GUFW [solved]

Questions about applications and software
Forum rules
Before you post please read this

error deleting firewall rule in GUFW [solved]

Postby jomaweb on Thu Feb 17, 2011 4:28 pm

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
Last edited by jomaweb on Sun Feb 20, 2011 2:17 pm, edited 1 time in total.
jomaweb
Level 1
Level 1
 
Posts: 26
Joined: Sun Feb 21, 2010 6:58 am

Linux Mint is funded by ads and donations.
 

Re: error deleting firewall rule in GUFW

Postby CiaW on Sat Feb 19, 2011 4:09 pm

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... :?
CiaW
Level 3
Level 3
 
Posts: 170
Joined: Fri Sep 10, 2010 11:39 am
Location: Spokane Wash, USA

Re: error deleting firewall rule in GUFW

Postby hippy on Sat Feb 19, 2011 5:25 pm

Try it this way:

Open a terminal and delete it from there.

example: sudo ufw delete deny 23399/tcp
hippy

"To touch the earth is to have harmony with nature." Oglala Sioux
User avatar
hippy
Level 3
Level 3
 
Posts: 107
Joined: Wed Feb 14, 2007 9:00 pm
Location: near the hills (malvern uk)

Re: error deleting firewall rule in GUFW

Postby jomaweb on Sat Feb 19, 2011 6:24 pm

sudo ufw delete allow from 192.168.1.128/tcp
ERROR: Bad source address
jomaweb
Level 1
Level 1
 
Posts: 26
Joined: Sun Feb 21, 2010 6:58 am

Re: error deleting firewall rule in GUFW

Postby hippy on Sat Feb 19, 2011 6:40 pm

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
hippy

"To touch the earth is to have harmony with nature." Oglala Sioux
User avatar
hippy
Level 3
Level 3
 
Posts: 107
Joined: Wed Feb 14, 2007 9:00 pm
Location: near the hills (malvern uk)

Re: error deleting firewall rule in GUFW

Postby jomaweb on Sun Feb 20, 2011 5:36 am

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
jomaweb
Level 1
Level 1
 
Posts: 26
Joined: Sun Feb 21, 2010 6:58 am

Re: error deleting firewall rule in GUFW

Postby hippy on Sun Feb 20, 2011 8:09 am

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
hippy

"To touch the earth is to have harmony with nature." Oglala Sioux
User avatar
hippy
Level 3
Level 3
 
Posts: 107
Joined: Wed Feb 14, 2007 9:00 pm
Location: near the hills (malvern uk)

Re: error deleting firewall rule in GUFW

Postby CiaW on Sun Feb 20, 2011 1:52 pm

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
CiaW
Level 3
Level 3
 
Posts: 170
Joined: Fri Sep 10, 2010 11:39 am
Location: Spokane Wash, USA

Re: error deleting firewall rule in GUFW [solved]

Postby jomaweb on Sun Feb 20, 2011 2:17 pm

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
jomaweb
Level 1
Level 1
 
Posts: 26
Joined: Sun Feb 21, 2010 6:58 am

Linux Mint is funded by ads and donations.
 

Return to Software & Applications

Who is online

Users browsing this forum: No registered users and 5 guests