Giter VIP home page Giter VIP logo

openvpn_auto_setup's Introduction

OpenVPN in tap/bridge mode in iocage jail

HowTo install and configure an freebsd / freenas iocage jail to access the whole lan (even avahi, bonjour broadcast) with openvpn in bridged mode.

Tested with Freenas 11.2-U3

This HowTo is based on this HowTo: https://www.ixsystems.com/community/resources/openvpn-in-tap-bridge-mode-in-iocage-jail.85/ extendet with the auto create script from here: https://github.com/Fazik/openvpn_auto_setup Many thanks to the authors!

ATTENTION: In version 11.2-U3 there is a known bug which should be fixed in 11.2-U4 For now heres a fix: https://www.ixsystems.com/community/threads/openvpn-issues-in-new-jails-after-11-1.59828/post-505700

Create Jail

Create a jail with advances properties and these parameters:

  • Release (I took newest available 11.2)
  • VNET enabled
  • IPv4 Interface vnet0
  • Fixed IP
  • Default Router IP address
  • Auto-start enabled
  • Custom Properties -> allow_tun enabled

Install OpenVPN, create certificates and user profile in the newly created jail

Install dependencies, download this repo, switch to folder and run the commmand:

pkg install git
portsnap fetch && portsnap extract
git clone https://github.com/nimoatwoodway/openvpn_auto_setup.git
cd openvpn_auto_setup

Run script

Thanks to Fazik for his script https://github.com/Fazik/openvpn_auto_setup. I've adjusted it a little to work in bridge mode.

/bin/sh openvpn_freebsd.sh [-i ] [-p ] [-u user1,user2...] [-d] [-t]

-i IP where to listen (default last)
-p Port on which listen(default 1194)
-u A list of users separated by commas(default client)
-c Duplicate cn(defaul off)
-t Use tcp(default udp)
-d Do not rebuild server keys and configs may be used to recreate or create new client keys

After successfull end You can get client config at /usr/local/etc/openvpn/$username/client.ovpn

Adjust some files to meet your network parameters

For a goog explanation what to do here: https://www.ixsystems.com/community/resources/openvpn-in-tap-bridge-mode-in-iocage-jail.85/

vi /usr/local/etc/openvpn/server.conf
vi /usr/local/etc/openvpn/up.sh

Start/Restart Service

service openvpn restart

You're done

Copy the client.ovpn from /usr/local/etc/openvpn/$username/client.ovpn and import into your prevered OpenVpn Client (Viscosity for MacOS in my case).

Easy as Schnitzel isn't it?

openvpn_auto_setup's People

Contributors

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