Difference between revisions of "PeerGuardian Linux"

From ArchWiki
Jump to: navigation, search
m (Better use of wiki templates)
m (LAN: clearer wording on default blocking status.)
(10 intermediate revisions by 5 users not shown)
Line 1: Line 1:
[[Category:Networking (English)]]
+
[[Category:Networking]]
[[Category:Security (English)]]
+
[[Category:Security]]
 
+
''PeerGuardian Linux'' (pgl) is a privacy oriented firewall application. It blocks connections to and from hosts specified in huge block lists (thousands or millions of IP ranges). ''pgl'' is based on the Linux kernel netfilter framework and [[iptables]].
''PeerGuardian Linux'' (pgl) is a privacy oriented firewall application. It blocks connections to and from hosts specified in huge block lists (thousands or millions of IP ranges). ''pgl'' is based on the Linux kernel netfilter framework and iptables.
+
  
 
{{Warning|''pgl'' may block your complete network/internet access! Using too many
 
{{Warning|''pgl'' may block your complete network/internet access! Using too many
 
and/or inappropriate lists may seriously degrade your internet service.}}
 
and/or inappropriate lists may seriously degrade your internet service.}}
  
= Installation =
+
== Installation ==
 
There are two [[AUR]] packages to choose from: [https://aur.archlinux.org/packages.php?ID=51838 pgl-cli] includes only the daemon and CLI tools, while [https://aur.archlinux.org/packages.php?ID=51839 pgl] comes complete with a GUI (written using Qt).
 
There are two [[AUR]] packages to choose from: [https://aur.archlinux.org/packages.php?ID=51838 pgl-cli] includes only the daemon and CLI tools, while [https://aur.archlinux.org/packages.php?ID=51839 pgl] comes complete with a GUI (written using Qt).
  
= Configuration =
+
== Configuration ==
All the configuration files are located in {{filename|/etc/pgl/}}:
+
All the configuration files are located in {{ic|/etc/pgl/}}:
* {{filename|blocklists.list}} contains a list of URL for retrieving the various block lists,
+
* {{ic|blocklists.list}} contains a list of URL for retrieving the various block lists,
* {{filename|pglcmd.conf}}, empty by default, overrides the default settings present in {{filename|/usr/lib/pgl/pglcmd.defaults}},
+
* {{ic|pglcmd.conf}}, empty by default, overrides the default settings present in {{ic|/usr/lib/pgl/pglcmd.defaults}},
* {{filename|allow.p2p}} lists custom IP ranges that won't be filtered.
+
* {{ic|allow.p2p}} lists custom IP ranges that will not be filtered.
  
The most important aspect that you'll want to change as soon as possible are the preconfigured block lists. The default lists in {{filename|/etc/pgl/blocklists.list}} block many potentially legitimate IP address, so use your best judgment and the information available at [http://www.iblocklist.com/ I-Blocklist] to make your choice.
+
The most important aspect that you will want to change as soon as possible are the preconfigured block lists. The default lists in {{ic|/etc/pgl/blocklists.list}} block many potentially legitimate IP address, so use your best judgment and the information available at [http://www.iblocklist.com/ I-Blocklist] to make your choice.
  
If you install ''pgl'' on a workstation, it is recommended to disable the filtering of HTTP connections. Sipmly add the following to {{filename|/etc/pgl/pglcmd.conf}}:
+
If you install ''pgl'' on a workstation, it is recommended to disable the filtering of HTTP connections by adding the following to {{ic|/etc/pgl/pglcmd.conf}}:
  
{{File|/etc/pgl/pglcmd.conf|<nowiki>WHITE_TCP_OUT="http https"</nowiki>}}
+
{{hc|/etc/pgl/pglcmd.conf|2=<nowiki>WHITE_TCP_OUT="http https"</nowiki>}}
  
Also, depending on the lists you use, some program might not be able to reach the outside world. For instance, if you use MSN for instant messaging, you'll need to add port 1863 to the white list:
+
Also, depending on the lists you use, some program might not be able to reach the outside world. For instance, if you use MSN for instant messaging, you will need to add port 1863 to the white list:
  
{{File|/etc/pgl/pglcmd.conf|<nowiki>WHITE_TCP_OUT="http https 1863"</nowiki>}}
+
{{hc|/etc/pgl/pglcmd.conf|2=<nowiki>WHITE_TCP_OUT="http https msnp"</nowiki>}}
  
 
Conversely, you could white list all the ports except the ones used by the program you are trying to restrain. The following example only use the block lists to stop incoming traffic on ports 53 (DNS) and 80 (HTTP):
 
Conversely, you could white list all the ports except the ones used by the program you are trying to restrain. The following example only use the block lists to stop incoming traffic on ports 53 (DNS) and 80 (HTTP):
  
{{File|/etc/pgl/pglcmd.conf|<nowiki>WHITE_TCP_IN="0:79 81:65535"
+
{{hc|/etc/pgl/pglcmd.conf|2=<nowiki>WHITE_TCP_IN="0:79 81:65535"
 
WHITE_UDP_IN="0:52 54:65535"</nowiki>}}
 
WHITE_UDP_IN="0:52 54:65535"</nowiki>}}
  
= Starting up =
+
=== Firewall ===
  
Once you are comfortable with the configuration of both the daemon and the lists, type in:
+
Since it is best to start ''pgl'' after your iptables based firewall, you should create an override for pgl.service by editing {{ic|/etc/systemd/system/pgl.service}} and adding your firewall service to the "After=" argument. This will ensure that ''pgl'' only starts '''after''' all the rules have been properly set up.
  
{{Cli|# rc.d start pgl}}
+
Here is an example when using the [[Uncomplicated Firewall]]:
 +
 
 +
{{hc|/etc/systemd/system/pgl.service|2=<nowiki>
 +
.include /usr/lib/systemd/system/pgl.service
 +
 
 +
[Unit]
 +
After=ufw.service
 +
</nowiki>}}
 +
 
 +
If you have already enabled the pgl.service, type the following command to update systemd:
 +
 
 +
{{bc|# systemctl reenable pgl.service}}
 +
 
 +
=== LAN ===
 +
 
 +
By default, ''pgl'' blocks traffic on your local IPv4 addresses. To disable this behavior, you need to manually install the [https://www.archlinux.org/packages/?q=net-tools net-tools] package or use the WHITE_IP_* settings as described below.
 +
 
 +
Let us say that ''pgl'' is installed on your workstation (192.168.0.5) and you want to reach some services on another computer (192.168.0.1) on your LAN. Simply add the following to {{ic|/etc/pgl/pglcmd.conf}}:
 +
 
 +
{{hc|/etc/pgl/pglcmd.conf|2=<nowiki>WHITE_IP_OUT="192.168.0.0/24"</nowiki>}}
 +
 
 +
If your workstation also hosts services that you would make available to your LAN, add:
 +
 
 +
{{hc|/etc/pgl/pglcmd.conf|2=<nowiki>WHITE_IP_IN="192.168.0.0/24"</nowiki>}}
 +
 
 +
For further information, please refer to the # Whitelist IPs # section of {{ic|/usr/lib/pgl/pglcmd.defaults}}.
 +
 
 +
== Starting up ==
 +
 
 +
Once you are comfortable with the configuration of both the daemon and lists, type in:
 +
 
 +
{{bc|# systemctl start pgl.service}}
  
 
To make sure that ''pgl'' works as intended, issue this command:
 
To make sure that ''pgl'' works as intended, issue this command:
  
{{Cli|# pglcmd test}}
+
{{bc|# pglcmd test}}
 +
 
 +
Should you want ''pgl'' to run automatically, use the following syntax to activate it:
  
Should you want ''pgl'' to run automatically, just add “pgl” to your {{filename|/etc/rc.conf/}} DAEMONS array.
+
{{bc|# systemctl enable pgl.service}}

Revision as of 15:27, 8 January 2013

PeerGuardian Linux (pgl) is a privacy oriented firewall application. It blocks connections to and from hosts specified in huge block lists (thousands or millions of IP ranges). pgl is based on the Linux kernel netfilter framework and iptables.

Warning: pgl may block your complete network/internet access! Using too many and/or inappropriate lists may seriously degrade your internet service.

Installation

There are two AUR packages to choose from: pgl-cli includes only the daemon and CLI tools, while pgl comes complete with a GUI (written using Qt).

Configuration

All the configuration files are located in /etc/pgl/:

  • blocklists.list contains a list of URL for retrieving the various block lists,
  • pglcmd.conf, empty by default, overrides the default settings present in /usr/lib/pgl/pglcmd.defaults,
  • allow.p2p lists custom IP ranges that will not be filtered.

The most important aspect that you will want to change as soon as possible are the preconfigured block lists. The default lists in /etc/pgl/blocklists.list block many potentially legitimate IP address, so use your best judgment and the information available at I-Blocklist to make your choice.

If you install pgl on a workstation, it is recommended to disable the filtering of HTTP connections by adding the following to /etc/pgl/pglcmd.conf:

/etc/pgl/pglcmd.conf
WHITE_TCP_OUT="http https"

Also, depending on the lists you use, some program might not be able to reach the outside world. For instance, if you use MSN for instant messaging, you will need to add port 1863 to the white list:

/etc/pgl/pglcmd.conf
WHITE_TCP_OUT="http https msnp"

Conversely, you could white list all the ports except the ones used by the program you are trying to restrain. The following example only use the block lists to stop incoming traffic on ports 53 (DNS) and 80 (HTTP):

/etc/pgl/pglcmd.conf
WHITE_TCP_IN="0:79 81:65535"
WHITE_UDP_IN="0:52 54:65535"

Firewall

Since it is best to start pgl after your iptables based firewall, you should create an override for pgl.service by editing /etc/systemd/system/pgl.service and adding your firewall service to the "After=" argument. This will ensure that pgl only starts after all the rules have been properly set up.

Here is an example when using the Uncomplicated Firewall:

/etc/systemd/system/pgl.service
.include /usr/lib/systemd/system/pgl.service

[Unit]
After=ufw.service

If you have already enabled the pgl.service, type the following command to update systemd:

# systemctl reenable pgl.service

LAN

By default, pgl blocks traffic on your local IPv4 addresses. To disable this behavior, you need to manually install the net-tools package or use the WHITE_IP_* settings as described below.

Let us say that pgl is installed on your workstation (192.168.0.5) and you want to reach some services on another computer (192.168.0.1) on your LAN. Simply add the following to /etc/pgl/pglcmd.conf:

/etc/pgl/pglcmd.conf
WHITE_IP_OUT="192.168.0.0/24"

If your workstation also hosts services that you would make available to your LAN, add:

/etc/pgl/pglcmd.conf
WHITE_IP_IN="192.168.0.0/24"

For further information, please refer to the # Whitelist IPs # section of /usr/lib/pgl/pglcmd.defaults.

Starting up

Once you are comfortable with the configuration of both the daemon and lists, type in:

# systemctl start pgl.service

To make sure that pgl works as intended, issue this command:

# pglcmd test

Should you want pgl to run automatically, use the following syntax to activate it:

# systemctl enable pgl.service