Giter Club home page Giter Club logo

xiaomivpn's Introduction

XiaomiVPN

A short introduction how to successfully install a VPN client on a Xiaomi router (MiWifi Mini).

When this router was setup, I faced many problems. I'd like to clarify them here and offer solutions to the most common hinderances.

The setup is as follows:

The router will have a usual connection which goes out with WAN. Additionally this connection is spread over WiFi into a certain SSID. On top of that another SSID is established which operates exclusively over the VPN.

Installation of OpenWrt

To install Openwrt on the MiWifi Router, manifold tutorials exists. This tutorial is the official OpenWrt tutorial. In short you need to:

  1. Register at the Mi Website your device
  2. Download the development firmware and the SSH Flash.
  3. Flashing first the device using the development firmware, using a pendrive/usb. After development firmware is installed the same procedure needs to be done with the SSH patch.
  4. Connect to the device using SSH. The password is obtained on the SSH website, if registration has already succeeded.
  5. Flash with your preferred firmware the device. E.g.
    cd /tmp; wget http://downloads.openwrt.org/chaos_calmer/15.05/ramips/mt7620/openwrt-15.05-ramips-mt7620-xiaomi-miwifi-mini-squashfs-sysupgrade.bin
    cat /proc/mtd

One other option is directly getting PandoraBox, which comes with some preinstalled packages, from here If there is a line "OS1", use OS1 in the following command as parameter, otherwise "firmware".

mtd -r write openwrt-15.05-ramips-mt7620-xiaomi-miwifi-mini-squashfs-sysupgrade.bin OS1
  1. After flashing is done, connect via LAN to the device on host

with User: root, no password.

Youre done and can begin working on the newly installed OpenWRT router.

Package Installation and Configuration

Multiple Packages are required to get a VPN and ChinaDNS running.

PPTP

When using PPTP as a VPN client, the following packages need to be installed. The package kmod-nf-nathelper-extra removes the default block of the PPTP client (since Chaos Chalmer).

opkg update
opkg install ppp-mod-pptp kmod-nf-nathelper-extra
opkg install luci-proto-ppp

To configure PPTP, it's nicety to use the Luci interface. Just go to: Interfaces → New Interface → pptp. Then simply configure your VPN.

After configuring, go to "Additional Settings" and remove the checked "use as default". If this is not done the VPN will be used as the default gateway for all the input/output of the router.

ChinaDNS

ChinaDNS, and ChinaDns-Luci ( if GUI is requested )

Take one of these luci-apps and accoringly one ChinaDNS package.

After the installation of the Luci package, a new category under the "Services" will appear. Click on Services → ChinaDNS.

Now configure the following:

  • Enable
  • Enable Bidirectional Filter
  • Local Port: 5353
  • CHNRoute File: /etc/chinadns_chnroute.txt
  • Upstream Servers: 114.114.114.114,8.8.8.8

Afterwards either check if chinadns is running by either looking in the luci page, or to be very sure, log into the router and run

/etc/init.d/chinadns enable
/etc/init.d/chinadns start

Which starts the service and also puts it on autostart.

DHCP and DNS

After ChinaDNS is sucessfully installed, login into the Luci interface and go to Luci → Network → DHCP and DNS.

  • General Settings

  • DNS forwardings : 127.0.0.1#5353

  • Resolv and Hosts File

  • Check that

Why do we need ChinaDNS?

It appreads that in some cases, even if your VPN is running, Chinas GFW will still block content from youtube and facebook ( maybe also others, but these were the most prominent). This is due to DNS poisoning from their side which somehow is not circumvented in the router ( Using the VPN on any usual device somehow leads to a proper result).

Routing setup

Lastly, we use iptables to enable policy structured routing.

xiaomivpn's People

Contributors

richermans avatar

Watchers

 avatar  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.