Git Product home page Git Product logo

wireguard_playbook's Introduction

Wireguard ansible playbook

Requarements

Debian/ubuntu on remote hosts Redhat/centos need to test

Install

how to use

Change hosts file:

[vpn]

anyname1 	ansible_host=<public_ip_1> 	vpn_ip=10.200.0.1 	site_net=<local_subnet_1>
anyname2 	ansible_host=<public_ip_2> 	vpn_ip=10.200.0.2 	site_net=<local_subnet_2>

I'm using DigitalOcean droplets in different regions, So if droplets in the same DC then traffic don't route in tunnel else I make route to IP address of eth1 interface over wireguard tunnel

You can replace in template wg0.conf.j2

AllowedIPs = {{ hostvars[host]['vpn_ip'] }}/32 {% if site_net != hostvars[host]['site_net'] %}, {{ hostvars[host]['ansible_eth1'].ipv4.address }} {% endif %}

hostvars[host]['site_net']

this will make routes for marked subnets over tunnels but will not working if hosts has same subnet.

Still in progress...

ansible-playbook full-mesh.yml

wireguard_playbook's People

Stargazers

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