Giter VIP home page Giter VIP logo

openwrt_cloudflare_warp's Introduction

How to use Cloudflare WARP on OpenWrt to bypass DPI (Deep Packet Inspection)

This tutorial was created mainly for Indonesian users, the government blocks some websites with DPI so simply changing the DNS doesn't work anymore. This is what I have:

Router: GL.iNet 6416
Firmware: OpenWrt 18.06.2
Modem: Huawei E3372 HiLink ( With IP: 192.168.8.1)
ISP: Tri Indonesia
PC: Manjaro Linux (This doesn't really matter what you have)

  1. On your PC, download the appropriate wgcf binary release from Github https://github.com/ViRb3/wgcf if you are using Linux the linux-amd64 binary is your best bet. Make sure to replace binary-release with the actual file name of the downloaded file
  2. Make the binary executable with: chmod +x binary-release
  3. Run ./binary-release register
  4. Accept terms and conditions
  5. Now run ./binary-release generate
  6. You'll get wgcf-profile.conf file, which you'll need to setup wireguard on your OpenWrt router. The file should look like this:

[Interface]
PrivateKey = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Address = 100.16.0.2/32
Address = fddd:5ca1:ab1e:8daf:209d:9414:d1e0:5d2c/128
DNS = 1.1.1.1
MTU = 1280
[Peer]
PublicKey = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
AllowedIPs = 0.0.0.0/0
AllowedIPs = ::/0
Endpoint = engage.cloudflareclient.com:2408

  1. Now on your OpenWrt router do: opkg update && opkg install wireguard wireguard-tools luci-proto-wireguard
  2. Edit your /etc/config/network and append the following lines, make sure to match the private_keys etc with the wgcf-profile.conf file that you have:

config interface 'Cloudflare'
    option proto 'wireguard'
    option private_key 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
    list addresses '100.16.0.2/32'
    list addresses 'fddd:5ca1:ab1e:8129:b248:d4f:3f37:7fbe/128'
    option mtu '1280'
    option dns '1.1.1.1'

config wireguard_Cloudflare
    option public_key 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
    option endpoint_host 'engage.cloudflareclient.com'
    option endpoint_port '2408'
    list allowed_ips '0.0.0.0/0'
    list allowed_ips '::/0'
    option route_allowed_ips '1'

config route 'route_wireguard'
    option interface 'Cloudflare'
    option target '0.0.0.0/0'
    option gateway '192.168.8.1' # This is the HiLink IP on my modem
    option metric '1024'

config route 'route_bimatri' # This configuration is optional
    option interface 'HiLink' # Match this with the name of your hilink interface, mine is 'HiLink'
    option target '103.10.66.0/24' # This is the IP of bima.tri.co.id
    option option netmask '255.255.255.0'
    option gateway '192.168.8.1' # This is the HiLink IP on my modem
    option metric '1024'

  1. Now do /etc/init.d/network restart
  2. Login to Luci WebUI. Go to Network > Interfaces and connect your Cloudflare Interface, if you're connected successfully, your Cloudflare interface should look like this:

enter image description here

Your routing table should look like this:

enter image description here

Now you should be able to access blocked websites like reddit.

References:
https://www.reddit.com/r/openwrt/comments/kgk5r1/comment/ggfqvhe/?utm_source=share&utm_medium=web2x&context=3
https://openwrt.org/docs/guide-user/network/routing/routes_configuration

openwrt_cloudflare_warp's People

Contributors

hillz2 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.