-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathopenvpn-example.yml
65 lines (59 loc) · 1.62 KB
/
openvpn-example.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
- hosts: my_openwrt_router
gather_facts: no
pre_tasks:
- raw: opkg update && opkg install python -d ram && ln -snf /tmp/usr/bin/python /usr/bin/python
vars:
vpn_port: 1194
roles:
- role: openwrt-network
interfaces:
vpn:
ifname: tun0
proto: none
auto: True
- role: openwrt-firewall
zones:
- index: "{{ use_unused_index_for_this_zone }}"
network: vpn
forward: REJECT
input: ACCEPT
output: ACCEPT
masq: True
forwardings:
- index: "{{ use_unused_index_for_this_forwarding }}"
src: vpn
dest: wan
- index: "{{ use_unused_index_for_this_forwarding + 1 }}"
src: vpn
dest: lan
- index: "{{ use_unused_index_for_this_forwarding + 2 }}"
src: vpn
dest: dmz
rules:
- index: "{{ use_unused_index_for_this_rule }}"
name: accept_openvpn_inbound
src: '*'
proto: 'tcp udp'
family: ipv4
dest_port: "{{ vpn_port }}"
target: ACCEPT
- role: openwrt-openvpn
enabled: True
dev: tun
config_name: my_config_name
server_address: my.vpn.domain.name.net
port: "{{ vpn_port }}"
ca_key_size: 4096
ca_country: US
ca_province: CA
ca_locality: LA
ca_org: my.organisation
ca_email: [email protected]
ca_org_unit: my.org.unit
ca_common_name: my.common.name
clients:
- my.first.client
environment:
PATH: "/usr/sbin:/usr/bin:/sbin:/bin:/tmp/usr/bin/"
LD_LIBRARY_PATH: "/tmp/lib:/tmp/usr/lib"