Coder Social home page Coder Social logo

harish2704 / openvpn-update-resolv-conf Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alfredopalhares/openvpn-update-resolv-conf

0.0 2.0 0.0 19 KB

Script that updates DNS settings are pushed by the OpenVPN server

Shell 100.00%
opensuse openvpn netconfig

openvpn-update-resolv-conf's Introduction

OpenVPN Update resolvconf

Description

This is a script to update your /etc/resolv.conf with DNS settings that come from the received push dhcp-options. Since network management is out of OpenVPN client scope, this script adds and removes the provided from those settings.

This script was found on the OpenVPN page of the Archlinux Wiki

However if you have systemd 229 or newer the better option is to use script from https://github.com/jonathanio/update-systemd-resolved which uses DBus calls instead of creating temporary *.network files.

Usage

Install openresolv

Place the script in /etc/openvpn/update-resolv-conf.sh or anywhere the OpenVPN client can acess.

Add the following lines to your client configuration:

# This updates the resolvconf with dns settings
setenv PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
script-security 2
up /etc/openvpn/update-resolv-conf.sh
down /etc/openvpn/update-resolv-conf.sh
down-pre

Just start your openvpn client with the command you used to do.

Alternatively, if you don't want to edit your client configuration, you can add the following options to your openvpn command:

--setenv PATH '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' --script-security 2 --up /etc/openvpn/update-resolv-conf.sh --down /etc/openvpn/update-resolv-conf.sh --down-pre

Support

For bugs and another questions open a ticket in the Isssues Page.

You can find me on irc.freenode.org and in last case mail me through the email that is on my Github Profile

License

Licenced under GNU GPL.

Credits

2016 - WGH Added modified script to support systemd-networkd

2014 - Alfredo Palhares [email protected]

2013 - [email protected] Fixed intet name

2006 - [email protected]

openvpn-update-resolv-conf's People

Contributors

alfredopalhares avatar dc-gsokolik avatar flamusdiu avatar harish2704 avatar jpeletier avatar lonicerae avatar ptolom avatar reinboldg avatar tomwadley avatar wgh- 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.