![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
Ubuntu 9.10 is out!!!
When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu. The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely. |
|
Tutorials & Tips The place to find Ubuntu related Tips & Tricks. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Dark Roasted Ubuntu
![]() ![]() Join Date: Mar 2007
Location: Rochester, NY USA
Beans: 1,007
Ubuntu 9.10 Karmic Koala
|
How-To: UFW - Ucomplicated Firewall
I looked for a current how-to for UFW and when I did not see one I wanted to add one.
(important note: UFW is not the firewall. UFW just configures your iptables) in most cases I recommend doing the following immediately: Code:
sudo ufw default deny sudo ufw enable Some basic commands are: Turn on the firewall Code:
sudo ufw enable Code:
sudo ufw disable To add deny rules: blocking a port Code:
sudo ufw deny port <port number> blocking an ip address Code:
sudo ufw deny from <ip address> Code:
sudo ufw deny from <ipaddress> to port <port number> Code:
sudo ufw deny from 10.0.0.1/24 to any port 22 To add allow rules: to allow an ip address Code:
sudo ufw allow from <ip address> Code:
sudo ufw <port number> Code:
sudo ufw allow from <ipaddress> to any port <port number> Code:
sudo ufw allow from 10.0.0.0/24 to any port 22 To get the current status of your UFW rules Code:
sudo ufw status Code:
sudo ufw delete <rule type> from <ip address> to any port <port number> You need to be careful with setting up allow and deny rules that 'intersect' because the first rule matched is applied and the remaining are ignored. SECNARIO: you want to block access to port 22 from 192.168.0.1 and 192.168.0.7 but allow all other 192.168.0.x IPs to have access to port 22 Code:
sudo ufw deny from 192.168.0.1 to any port 22 sudo ufw deny from 192.168.0.7 to any port 22 sudo ufw allow from 192.168.0.0/24 to any port 22 you can check this by checking ufw status Code:
sudo ufw status To Action From -- ------ ---- 22:tcp DENY 192.168.0.1 22:udp DENY 192.168.0.1 22:tcp DENY 192.168.0.7 22:udp DENY 192.168.0.7 22:tcp ALLOW 192.168.0.0/24 22:udp ALLOW 192.168.0.0/24 I hope this helps you use ufw to secure your computer. Link to the documentation wiki Last edited by cprofitt; June 9th, 2008 at 04:40 PM.. |
|
|
|
|
|
#2 |
|
Skinny Soy Caramel Ubuntu
![]() Join Date: Aug 2007
Beans: 692
Ubuntu Jaunty Jackalope (testing)
|
Re: How-To: UFW
Every time I restart my computer I have to restart ufw. Is there a way to make it enabled at startup?
__________________
I would rather die of thirst than drink from the cup of mediocrity. Get better forum search results! |
|
|
|
|
|
#3 |
|
I Want My $2!!
![]() Join Date: Mar 2007
Location: Denver, CO
Beans: 7,058
Ubuntu 8.10 Intrepid Ibex
|
Re: How-To: UFW
Can you ICS with ufw as you can in iptables?
|
|
|
|
|
|
#4 | |
|
Chai anyone?
![]() |
Re: How-To: UFW
Quote:
I presume iptables boots at startup. And ufw is a "frontend" for iptables. So does ufw need to be running to enable the open ports that I have defined with ufw? ufw does not boot at startup: Code:
sudo ufw status [sudo] password for xxxxx: Firewall not loaded Code:
cat /etc/ufw/ufw.conf # /etc/ufw/ufw.conf # # set to yes to start on boot ENABLED=yes
__________________
Beginners: Enter Code entries in Terminal | Wifi help? | Multimedia | How to get help here | Enable Repos My sites: Lightweight LXDE-Ubuntu | FreeNAS Home Server| DropBox If you are a beginner - look at the Start here sticky in the Absolute Beginners Forum Get Ubuntu |
|
|
|
|
|
|
#5 |
|
First Cup of Ubuntu
![]() Join Date: Jul 2008
Beans: 5
|
Re: How-To: UFW
I would also like to know, I'm a little confused with this.
|
|
|
|
|
|
#6 |
|
I Want My $2!!
![]() Join Date: Mar 2007
Location: Denver, CO
Beans: 7,058
Ubuntu 8.10 Intrepid Ibex
|
Re: How-To: UFW
Im curious also -- I know for example iptables does not by default store settings between boots unless the settings are exported and then imported at boot, or a startup script is launched that re-enters the settings back into iptables. (iptables-save, iptables-restore). I thought Network Manager had the iptables-save, restore code calls built in, however if you are not using network manager, then that's another issue). In theory however, since ufw uses iptables, it would be possible manually to save and restore the settings using the save/restore commands by calling iptables directly rather than ufw.
|
|
|
|
|
|
#7 | |
|
First Cup of Ubuntu
![]() Join Date: Jul 2007
Beans: 2
|
Re: How-To: UFW
Quote:
works all time after reboot,and very easy to use |
|
|
|
|
|
|
#8 |
|
First Cup of Ubuntu
![]() Join Date: Jul 2008
Beans: 5
|
Re: How-To: UFW
Finally a link that works! I tried downloading that from ubuntu-unleashed, (and quite a few others), but I could never get the link to work. Google always said forbidden. Thank you for that!
|
|
|
|
|
|
#9 | |
|
Gee! These Aren't Roasted!
![]() |
Re: How-To: UFW
Quote:
Code:
Toggle logging: # ufw logging on|off
__________________
10 PRINT "HELLO WORLD!" 20 GOTO 10 |
|
|
|
|
| Bookmarks |
| Tags |
| firewall, ufw |
| Thread Tools | |
| Display Modes | |
|
|