Giter Club home page Giter Club logo

mullbot's Introduction

Mullbot

Mullbot is an interactive bash script for setting up and controlling a Mullvad VPN connection on an OpenWrt router running Dropbear.

Mullbot requires jq, OpenSSH, and GNU coreutils, and was developed and tested with GNU bash 5.1.16, and OpenWrt 21.02.3.

Control your Mullvad connection

Mullbot incorporates a set of functions for controlling a Wireguard connection to Mullvad VPN, and can quickly create a Wireguard connection according to Mullvad's instructions. It also enables quick switching between servers. It now includes filters for selecting only Mullvad-owned servers, and simple ping tests to determine the best server to use.

AutoLuCI

For a bit of added security, you can enable AutoLuCI, which will enable the uHTTPd service on the router when the script starts, and disable it when the script exits, with an optional exit trap. Commands are issued via SSH, so if you set up SSH authentication with a key and disable password authetication, this can serve as a roll-your-own 2FA option for your router's web interface.

For more info about securing your SSH setup with a Yubikey, see DrDuh's guide.

Screenshots

Simple interface:

Mullbot Interface

Convenient VPN control and status indicators:

Mullbot Menu

Easy server selection:

Mullbot Servers

Notes

Only tested with OpenWrt 21.02.3 and Bash 5.1.16

When you first run the script, it will download a backup of your router config to your home dir. Only the network, dhcp, and firewall files in /etc/config/ will be changed. If your router config gets broken, reset the device and upload the backup config.

All Mullbot's config files will be saved locally in ~/.mullbot/

Your router's network, dhcp, and firewall files will be copied to ~/.mullbot/configs/

with the file names appended with .bkp

Your chosen VPN settings will be written into new versions of these files and saved to new files appended with .mullbot If something goes wrong, and you still want to use this script, simply put your non-VPN versions of these files into ~/.mullbot/configs with .bkp at the end of the file names, and your working VPN configs into the .mullbot files.

When you select "Toggle VPN" the script checks whether you're connected to Mullvad and overwrites your router's config files with the appropriate local copies.

Please note that if the script hangs after the toggle operation, simply exit the script and reconnect to your router.

I made script to learn bash, git, and awk, and to get to grips with using OpenWrt.

I figured this would be a good way to learn, and make something that I'd find useful. Maybe you will too. While I've tried to test it, it isn't guaranteed to work.

mullbot's People

Contributors

drewbertza avatar

Stargazers

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