0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Cloudflare Tunnel + WARP ClientでAdblockする方法

Posted at

背景

最近、Cloudflare TunnelとWARP Clientを使って、「外出先から常に自宅LANへ入るルート」を作りました。
外から見える固定IPが無くてもルートを作れるのが、個人的に画期的です。作るときの手順は以下を参照ください。

しかし、この方法でVPNを張ると、iPhoneなどではAdblockが外れてしまうという欠点がありました。
ググって解消する方法があったので、メモとして共有します

方法

  1. Cloudflare Zero Trustのダッシュボードへ行きます。
    https://one.dash.cloudflare.com/

  2. メニューから「Gateway」→「Firewall Policy」を選び、「Add a policy」を押します。
    image.png

  3. 「STEP 1 Name your policy」は名前を付けるだけなので、何らか入力します。
    image.png

  4. 「STEP 2 Build an expression」で、「Add condition」を選び、以下のように追加します。

    • Selector: Domain
    • Operator: matches regex
    • Value: 以下をコピペ
      (advert|adserv|adsystem|doubleclick|2mdn|truecaller|uberads|206ads|360in|360yield|3lift|a2z|aarki|ad2iction|adcolony|addthis|adform|adhaven|adlooxtracking|admicro|adnxs|adpushup|adroll|adsafeprotected|adsbynimbus|adspruce|adsrvr|adswizz|adtelligent|adventori|adzerk|aerserv|amplitude|aniview|anzuinfra|apester|aralego|atdmt|atwola|bannersnack|batmobi|bluecava|blueconic|carambo|casalemediacriteo|crittercismriteo|crittercism|revcontent|ijinshan|imrworldwide|inmobi|marketo|moatads|moatpixel|mookie|perfectaudience|permutive|pubmatic|pushwoosh|rayjump|revcontent|revjet|rfihub|richrelevance|rqmob|rubiconproject|onetag|samba|scopely|scorecardresearch|shareaholic|sharethis|sharethrough|smaato|snapads|speedshiftmedia|supersonicads|swrve|taboola|tremorhub|unity3d|vertamedia|videohub|vungle|wzrkt|xiaomi|yieldlove|yieldmo|yieldoptimizer|baidu|chinanet|yandex|googlesyndication)
      

    image.png

  5. 上記の宛先に行きたくないので、「STEP 3 Select an action」は、Actionを「Block」にします。

  6. 最後に「Save Policy」で保存して完了です。

補記

注意

原理を考えればわかりますが、ドメインを正規表現でブロックしているだけです。
そのため、問題ないサイトもブロックされる可能性があります。
この点は、改良版のやり方を追記予定です

見つけた背景

ぐぐると、Redditにて議論されているスレッドがありました。

その中で「簡単な方法が以下で紹介されているよ」と紹介されていました。

0
1
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?