Setting up a personal firewall on Debian using Guarddog
From NewbieDOC
- Chris Lale
- chrislale AT users DOT berlios DOT de
Go to NewbieDOC index
Revision History
Revision 0.1 | 6th February 2006 | Revised by Chris Lale | ||||||||||
Initial release. | ||||||||||||
| ||||||||||||
Revision 0.2 | 27th November 2007 | Revised by Chris Lale | ||||||||||
Reformatted for newbiedoc package. | ||||||||||||
This HOWTO describes how to install and use the Guarddog firewall configuration tool in Debian GNU/Linux. Guarddog use a simple but flexible GUI interface to configure iptables. It makes a great personal firewall for a standalone or networked PC.
1 Documentation
2 IntroductionA firewall is software that stops your computer communicating with other computers. A PC that cannot communicate with other computers is not much good if you want to use the internet. You must make holes in the firewall to permit communication in particular protocols (languages). Having a firewall does not mean that you can forget about other security measures. For example, the language of web pages is the HTTP protocol. The languages of email are the SMTP and POP3 protocols. You make holes in the firewall to allow these protocols by opening ports. Guarddog sets up a firewall using Guarddog is a configuration tool 3 Installing GuarddogInstall this package using Synaptic, Aptitude or guarddog During installation you may see a message like this: Setting up guarddog (2.4.0-1) ... Unable to start guarddog firewall - /etc/rc.firewall does not exist Don't worry. The 4 Run GuarddogRun From Gnome:
From KDE:
The first time you run Guarddog you may get this warning: Guarddog was unable to find a Guarddog firewall at /etc/rc.firewall. This is probably ok, it just means that this is the first time Guarddog has been run on this system. But please be aware that the firewall settings shown may not represent the system's current firewalling configuration. Your Guarddog firewall will take effect once you use the 'Apply' button or exit Guarddog using 'Ok'. You do not need to take any action. Just be aware that the default settings are not necessarily those of any existing firewall.
5 Configuring an Internet firewall on your Local PC5.1 ZonesBy default, Guarddog has two zones.
5.2 Permitting the Domain Name System (DNS) protocolThe DNS protocol enables you to access computers on the internet using a name like
Note: All boxes that are unticked will be blocked. Permitting just DNS is not sufficient to receive a web page from the internet. You must also permit HTTP - see below. Save and continue
You are about to modify the system's firewall configuration. These changes may disrupt current network connections. Do you wish to continue?
Starting firewall... Output: Using iptables. Resetting firewall rules. Loading kernel modules. Setting kernel parameters. Configuring firewall rules. Finished.
5.2.1 Test the firewallThe DNS protocol is now permitted, but HTTP is not (its Local box is still unticked). To test this, run a web browser and try to visit a site, eg google: http://google.co.uk Since the HTTP protocol is blocked, you should not be able to access the web page. The firewall is working! Disable the firewall by putting a cross in the Disable Firewall box.
You are about to disable the system's firewall. This will allow all network traffic and potentially leave your system vulnerable to attack. Unless you are an advanced user and know what you are doing I recommend that you cancel this action. These changes may also disrupt current network connections. Do you wish to continue?
Resetting firewall... Output: Using iptables. Resetting firewall rules. Finished.
Check that you can now receive web pages. Try again to visit google: http://google.co.uk You should see the web page! The firewall is disabled, so the HTTP protocol (and all the others) is permitted again. 5.3 Permitting the web page (HTTP) protocol Note: Re-enable the firewall before continuing. If you disabled the firewall in the previous step and do not re-enable it, all the protocols will be greyed-out. You must permit the HTTP protocol in order to be able to view web pages in your web browser. Some web pages use the secure HTTPS protocol instead eg if you are buying something online.
Save and continue
Check that you can receive web pages with the firewall enabled. Try again to visit google: http://google.co.uk You should receive a web page. 6 Permit other protocols you may needYou probably need more than just HTTP. If you send email you probably use an SMTP server, and if you receive email a POP3 server. If you have a website hosted remotely you probably need to permit the FTP or SSH protocols. You may also use network tools, such as PING, on the internet. Permit just the protocols that you need. Here is a list of some common protocols that you can permit to be served from the Internet zone to the Local zone.
There are others you may need like chat, games, media, etc. Just look through the Protocol tree in the Protocols tab. If you need something not listed, you can always add user-defined protocols to the list. Make the changes that you need and apply them with the Apply button. Test the new firewall configuration. When you are satisfied that everything is working correctly, save and exit by clicking on the OK button.
7 Using guarddog with a Samba NetworkSamba is a great way to run a small office or home network. Samba allows you to have both Linux and Windows computers on the network. Samba uses the SMB application level protocol. You must permit Windows Networking (NETBIOS) and Microsoft SMB over TCP for Windows 2000 and later. You need to know your local network's broadcast address and the addresses or address range of the computers on the network. 7.1 Set up a zone for the local networkThis example shows how to create a zone Home for a home LAN network with the address range 192.168.1.0/255.255.255.0 with a broadcast address of 192.168.1.255. Create a new zone:
Select the new zone and modify its properties:
7.2 Allow you PC to connect to the networkJoin the Home zone to the Local zone:
Apply the changes.
7.3 Test the network connectionsCheck that you can access your PC from another station on the network. For Windows machines, look in 'Network Neighborhood'. For Linux machines use LinNeighborhood, or use Nautilus (Gnome File Manager) or Konqueror (KDE File Manager) to look at 8 Adding user-defined protocols for Vipul's RazorCheck the Razor2 FAQs to find the ports you need. The FAQs are in the package documentation directory: /usr/share/doc/razor/FAQ For Debian Sarge, the information is: Outgoing TCP port 2703 (Razor2) and TCP port 7 (Echo). Razor2 uses TCP pings to discover what servers are closest to it. 8.1 Add new ports for Razor2 and Echo
8.2 Permit Razor2 and Echo
8.3 Permit PING
8.4 Test RazorRun $ razor-admin -d -discover If successful, you should see this line at the end of the debug messages: razor-admin finished successfully. If the firewall is still blocking razor, it continues to try and discover the servers, but without success. 9 Appendix A: LicenceCopyright (c) 2006-2007 Chris Lale, chrislale AT users DOT berlios DOT de.
Go to NewbieDOC index |