OpenMPTCProuter(で使っているVPS)にPi-holeをインストールして広告ブロックを施す
※2022/9/30追記※
どうもVPSにpi-holeを入れるとOpenMPTCProuterのステータスが以下のようになり、VPSが正常に認識?されなくなるらしい。
グラフによる回線使用状況を確認する限り、2回線をちゃんと利用しているようだが、管理画面がこの状態というのはなんとも気持ちが悪い。
$ pihole disable
で停止しても変化なし。
$ pihole uninstall
でpi-holeをアンインストールしても変化なしです(一応試した)。
pi-hole自体は有用なので、とりあえず様子見。(必要があれば別のサーバで運用も視野に入れたい)
→ラズパイ4に入れて運用する方向に変更しました。
engetu21.hatenablog.com
※追記終わり※
Pi-hole(パイホール)はAdBlocking、要するにサイト広告をブロックしてくれるアプリケーションとのこと。(DNSキャッシュとかもできるらしいけど)
docs.pi-hole.net
前回OpenMPTCProuterの対応をしたので、これを導入してみる。
engetu21.hatenablog.com
OpenMPTCProuterで使っているVPSに入れることで、ネットワーク配下のクライアントすべての通信に適用されるため、スマホやWindowsPC等、個別にAdBlockアプリを入れてるのが不要になります。
元々OpenMPTCProuterとは全く関係ない代物ですが、OpenMPTCProuterをルータとして動かすと必然的にPi-holeを動かしているVPSも通過するため、自然に通信上で適用がなされる(という仕組みになるらしい)。
なお、Piと名前がついているものの、ラズパイ以外のサーバに普通に入るとのこと。
あとYoutubeの動画広告を回避は難しいらしいです。
GitHubにインストール方法が書いてあったため、試しにインストールしてみます。
github.com
$ wget -O - http://www.openmptcprouter.com/server/omr-pihole.sh | sudo sh
キャプチャ忘れてたので、あとからコピペしたログで…
qqqlqqqqqqqqqqqqqqqqqqqqqqqqqStatic IP Neededqqqqqqqqqqqqqqqqqqqqqqqqqqqkqqqqq x x x x x The Pi-hole is a SERVER so it needs a STATIC IP ADDRESS to x x function properly. x x x x IMPORTANT: If you have not already done so, you must ensure that x x this device has a static IP. x x x x Depending on your operating system, there are many ways to achieve x x this, through DHCP reservation, or by manually assigning one. x x x x Please continue when the static addressing has been configured. x x x x x x x x x tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu x <Continue> < Exit > x mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
Continueを押下
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x Choose An Interface (press space to toggle selection) x x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x x x (*) ens3 available x x x x ( ) mlvpn0 available x x x x ( ) gt-udp-tun0 available x x x x ( ) dsvpn0 available x x x x ( ) omr-bonding available x x x x ( ) ovpnbonding3 available x x x x ( ) ovpnbonding1 available x x x x ( ) ovpnbonding4 available x x x x ( ) ovpnbonding5 available x x x x ( ) ovpnbonding6 available x x x x ( ) ovpnbonding2 available x x x x ( ) ovpnbonding7 available x x x x ( ) ovpnbonding8 available x x x mqqqqqqqqqqqqqqqqqqqqqqv(+)qqqqqqqqqqqqqqqqqqqqqqqqqqqqqq76%qqqqqj x tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu x <Select> < Exit > x mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
NICの指定はens3のままでいいのでSelectを押下
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x Select Upstream DNS Provider. To use your own, select Custom. x x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x x x Google (ECS, DNSSEC) x x x x OpenDNS (ECS, DNSSEC) x x x x Level3 x x x x Comodo x x x x DNS.WATCH (DNSSEC) x x x x Quad9 (filtered, DNSSEC) x x x x Quad9 (unfiltered, no DNSSEC) x x x mqqqqv(+)qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq70%qqqqqj x x x x x x x x x x x x x tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu x < OK > < Exit > x mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
DNSは何でもいいけど、無難にGoogleあたりを選択してOK
qqqlqqqqqqqqqqqqqqqqqqqqqqqqqqqqBlocklistsqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkqqqqq x x x Pi-hole relies on third party lists in order to block ads. x x x x You can use the suggestion below, and/or add your own after x x installation. x x x x Select 'Yes' to include: x x x x StevenBlack's Unified Hosts List x x x x x x x x x x x x x x x tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu x < Yes > < No > x mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
Yesを選択
qqqlqqqqqqqqqqqqqqqqqqqqqqqAdmin Web Interfaceqqqqqqqqqqqqqqqqqqqqqqqqqqkqqqqq x x x x x Do you want to install the Admin Web Interface? x x x x x x x x x x x x x x x x x x x x x x x x x x x tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu x < Yes > < No > x mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
Yesを選択
qqqlqqqqqqqqqqqqqqqqqqqqqqqqqqqqWeb Serverqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkqqqqq x x x x x A web server is required for the Admin Web Interface. x x x x Do you want to install lighttpd and the required PHP modules? x x x x NB: If you disable this, and, do not have an existing web server x x and required PHP modules (sqlite3 xml intl json) installed, the x x web interface will not function. Additionally the web server user x x needs to be member of the "pihole" group for full functionality. x x x x x x x x x x x x x tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu x < Yes > < No > x mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
Yesを選択
qqqlqqqqqqqqqqqqqqqqqqqqqqqqqqEnable Loggingqqqqqqqqqqqqqqqqqqqqqqqqqqqqkqqqqq x x x x x Would you like to enable query logging? x x x x x x x x x x x x x x x x x x x x x x x x x x x tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu x < Yes > < No > x mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
Yesを選択
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x Select a privacy mode for FTL. x x https://docs.pi-hole.net/ftldns/privacylevels/ x x lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x x x (*) 0 Show everything x x x x ( ) 1 Hide domains x x x x ( ) 2 Hide domains and clients x x x x ( ) 3 Anonymous mode x x x x x x x x x x x mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj x x x x x x x x x x x x x tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu x <Continue> < Exit > x mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
設定を変えずにContinueを選択
lqqqqqqqqqqqqqqqqqqqqqqInstallation Complete!qqqqqqqqqqqqqqqqqqqqqqqqk x Configure your devices to use the Pi-hole as their DNS server x x using: x x x x IPv4: XXX.XXX.XXX.XXX x x IPv6: Not Configured x x If you have not done so already, the above IP should be set to x x static. x x View the web interface at http://pi.hole/admin or x x http://XXX.XXX.XXX.XXX/admin x x x x Your Admin Webpage login password is XXXXXXXXXXXX x x x x x x x x x x x tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqu x < OK > x mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
OKを押下
インストールが完了後、OpenMPTCProuterに接続されている作業用PCから以下のアドレスにアクセスします。
下記URLは外部の別PCからはもちろん、VPSのIPアドレスを指定したhttp通信もダメだったので、必ずOpenMPTCProuterの配下PCで以下のURLでなければいけないようです。(そこら辺を把握してなくて時間かかった)
ログインが完了すると以下のような画面になります。
現状はBlockリスト等は何も弄ってないため、それはまた後日やります。
ボチボチ弾いてはいる模様。
Pi-hole適用前
Pi-hole適用後
なお、初期パスワードは覚えづらいので、VPSにSSHで入って以下のコマンドで変更可能です。
$ pihole -a -p
Enter New Password (Blank for no password):
Confirm Password:
[?] New password set
ブロックリストの追加については以下に記事起こしました。
engetu21.hatenablog.com