Implementing Privoxy on PFSense Router Firewall

On this occasion, let's try to discuss how to install and configure Privoxy on the PFSense Router. Before reviewing in more depth, it's a good idea to first get to know what Privoxy is. Privoxy is a non-caching web proxy with filtering capabilities to enhance privacy, modifying web page data and HTTP headers before the page is rendered by the browser. Privoxy is a "privacy-enhancing proxy," filtering Web pages and removing ads. Privoxy can be customized by the user, for both stand-alone systems and multi-user networks.

Privoxy is based on Internet Junkbuster and released under the GNU General Public License. One of the main uses of privacy is to limit ″internet junk″ such as pop-up ads and other annoyances. Privoxy is often used in combination with Tor or Squid and can be used to bypass Internet censorship. After you know what Privoxy is, we can start installing Privoxy.


A. Instalasi Privoxy

To install Privoxy on a PFSense Router, the steps are almost the same as installing Tor on a PFSense Router. If you read the previous article, you will definitely have no difficulty installing Privoxy. We open the PUTTY remote console, log in with our PFSense Router LAN IP, namely 192.168.9.3. In the Shell PUTTY menu, type the following script to install Privoxy "pkg install privoxy".



After installing Privoxy is complete, we continue by creating a boot script in the rc.conf file, the aim is so that every time the PFSense Router is turned off the Privoxy application can run automatically. Enter the script privoxy_enable="YES" in the rc.conf file.

[2.6.0-RELEASE][root@router1.unixexplore.com]/root: ee /etc/rc.conf

privoxy_enable="YES"


A. Privoxy Configuration

The main file in Privoxy is the config file in the /usr/local/etc/privoxy folder. This file is what we will configure, in this file socks5 Tor will be forwarded. At the end of the installation the config file is not in the /usr/local/etc/privoxy folder, we have to copy it from the /usr/local/share/examples/privoxy folder.

[2.6.0-RELEASE][root@router1.unixexplore.com]/root: cd /usr/local/share/examples/privoxy
[2.6.0-RELEASE][root@router1.unixexplore.com]/usr/local/share/examples/privoxy: cp config /usr/local/etc/privoxy

After that, we edit Privoxy's config file. To make it easier to edit the config file, use the WINSCP application, the steps are the same as PUTTY, you log in with the PFSense router's LAN IP, namely 192.168.9.3. We don't change all the config file scripts, only some of them, follow the following script guide:

logdir /var/log/privoxy
logfile logfile
listen-address 192.168.9.1:8118
toggle 1
buffer-limit 4096
forward-socks5   /   192.168.9.1:9050 .

Listen-address is the IP address and Privoxy Port
forward-socks5 is the IP address and Tor Port
So it's explained, Privoxy forwards to socks5 on the Tor IP and Port.
After finishing editing the config file, we continue by creating the rc.d privoxy startup script in the /usr/local/etc/rc.d folder.

[2.6.0-RELEASE][root@router1.unixexplore.com]/root: cd /usr/local/etc/rc.d
[2.6.0-RELEASE][root@router1.unixexplore.com]/usr/local/etc/rc.d: mv privoxy privoxy.sh

We continue by creating the privoxy_relaunch.sh file in the /usr/local/bin folder, then enter the following script in the privoxy_relaunch.sh file.

[2.6.0-RELEASE][root@router1.unixexplore.com]/root: touch /usr/local/bin/privoxy_relaunch.sh
[2.6.0-RELEASE][root@router1.unixexplore.com]/root: chmod +x /usr/local/bin/privoxy_relaunch.sh
[2.6.0-RELEASE][root@router1.unixexplore.com]/root: ee /usr/local/bin/privoxy_relaunch.sh

#!/usr/bin/env sh
service /usr/local/etc/rc.d/privoxy.sh status > /dev/null
if [ $% != 0 ]; then
service /usr/local/etc/rc.d/privoxy.sh start
fi

Now we go to the PFSense Web GUI, edit the crontab file, click Services>>>Cron>>>Settings, then click the Add button.

After creating the crontab file, it means all stages have been completed. Now we restart the Privoxy application. Use the service script privoxy.sh restart.
[2.6.0-RELEASE][root@router1.unixexplore.com]/root: service privoxy.sh restart
Stopping privoxy.
Waiting for PIDS: 35839.
Starting privoxy.
[2.6.0-RELEASE][root@router1.unixexplore.com]/root:

The words PIDS: 35839 and Starting privoxy indicate that the Privoxy application is RUNNING on the PFSense Router server. This means that now your PFSense Router has Privoxy installed properly. In practice, you can combine Privoxy with the Tor or Polipo application and you can even combine it with Squid proxy.
Iwan Setiawan

I Like Adventure: Mahameru Mount, Rinjani Mount I Like Writer FreeBSD

Post a Comment

Previous Post Next Post