OpenVPN config generator

From EnigmaGuy Wiki
Revision as of 13:00, 24 January 2019 by Enigmaguy (talk | contribs)
Jump to navigation Jump to search

Simple configuration generator for OpenVPN which supports static IPs, udp/tcp

GitHub Project

Directory structure

├── clients
│   ├── client1
│   │   ├── client1.client.conf
│   │   └── keys
│   │       ├── ca.crt
│   │       ├── client1.crt
│   │       ├── client1.csr
│   │       └── client1.key
│   └── client2
│       ├── client2.client.conf
│       └── keys
│           ├── ca.crt
│           ├── client2.crt
│           ├── client2.csr
│           └── client2.key
├── genkey.py
├── server
│   ├── ccd
│   │   ├── client1
│   │   └── client2
│   ├── keys
│   │   ├── ca.crt
│   │   ├── ca.key
│   │   ├── dh2048.pem
│   │   ├── server.crt
│   │   ├── server.csr
│   │   └── server.key
│   └── server.conf

Config syntax

---
server:
  fqdn: 'openvpn.server.com'
  port: '443'
  proto: 'udp'
  topology: '192.168.10.0 255.255.255.0'

clients:
  - name: client1
    ip: 192.168.10.10
    subnet: 255.255.255.0

  - name: client2
    ip: 192.168.10.20
    subnet: 255.255.255.0

Usage

To generate keys and openvpn configs, just edit config file vpn.yml and run python script genkey.py which will generates all neccesary files. It does not overwrite existing configuration so when you add a new client previous client keys will stay untouched.