LoginSignup
2
5

More than 5 years have passed since last update.

Raspberry Piにprivoxyで広告ブロックサーバをたててみたメモ

Last updated at Posted at 2019-03-10

別にRaspberry Piじゃなくてもなんでも良いんだけど、ちょうどZero Wを余らせていたので。

Raspberry Pi Zero WにUSBネットワークアダプタを接続して有線LANに接続、ルータのDHCP設定で192.168.1.11の固定IPを振った。
※家の中に無線LANをやたらと増やしても仕方が無いため今回は本機(Zero W)の無線LANは一切使わないことにした

raspbian lite(2018-11-13-raspbian-stretch-lite)をインストールし、apt-getでprivoxyをインストール。
サーバでAdblockのフィルタを使用する広告ブロックプロキシを動かす パソコン鳥のブログ/ウェブリブログ を真似て、actionファイルとfilterファイルをダウンロードし、設定ファイル/etc/privoxy/configに対して対応するactionfileとfilterfile設定を追記。
さらに/etc/privoxy/configに対して

 listen-address  :8118
 accept-intercepted-requests 1

と設定をすればOK。iptablesの設定をしなくても広告ブロックサーバとして動いてくれるようだ。
使用時には、LAN内の別クライアントから、httpプロクシとして本機のIP:port(192.168.1.11:8118)を指定するだけで良い。
※LAN内なのでiptables設定そのものを一切していない

2
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
5