]> Cypherpunks.ru repositories - govpn.git/blob - doc/example.texi
Use YAML instead of JSON for server configuration file
[govpn.git] / doc / example.texi
1 @node Example
2 @section Example usage
3
4 Let's assume that there is some insecure link between your computer and
5 WiFi-reachable gateway.
6
7 @itemize
8 @item You have got @code{wlan0} NIC with 192.168.0/24 network on it.
9 @item You want to create virtual encrypted and authenticated 172.16.0/24
10 network and use it as a default transport.
11 @item Assume that outgoing GoVPN packets can be fragmented, so we do not
12 bother configuring MTU of TAP interfaces. For better performance just
13 lower it and check that no fragmentation of outgoing UDP packets occurs.
14 @end itemize
15
16 @strong{Install}. At first you must @ref{Installation, install} this
17 software: download, @ref{Integrity, check the signature}, compile.
18
19 @strong{Prepare the client}. Generate client's verifier for Alice as an
20 example:
21
22 @verbatim
23 client% ./utils/newclient.sh Alice
24 Enter passphrase:
25 Your client verifier is: $argon2d$m=4096,t=128,p=1$bwR5VjeCYIQaa8SeaI3rqg
26
27 Place the following YAML configuration entry on the server's side:
28
29     Alice:
30         up: /path/to/up.sh
31         iface: or TAP interface name
32         verifier: $argon2d$m=4096,t=128,p=1$bwR5VjeCYIQaa8SeaI3rqg$KCNIqfS4DGsBTtVytamAzcISgrlEWvNxan1UfBrFu10
33
34 Verifier was generated with:
35
36     ./utils/storekey.sh /tmp/passphrase
37     govpn-verifier -key /tmp/passphrase
38 @end verbatim
39
40 @strong{Prepare the server}. Add this entry to @code{peers.yaml}
41 configuration file:
42
43 @verbatim
44 Alice:
45     iface: tap10
46     verifier: $argon2d$m=4096,t=128,p=1$bwR5VjeCYIQaa8SeaI3rqg$KCNIqfS4DGsBTtVytamAzcISgrlEWvNxan1UfBrFu10
47 @end verbatim
48
49 @strong{Prepare network on GNU/Linux IPv4 server}:
50
51 @example
52 server% umask 077
53 server% ip addr add 192.168.0.1/24 dev wlan0
54 server% tunctl -t tap10
55 server% ip addr add 172.16.0.1/24 dev tap10
56 server% ip link set up dev tap10
57 @end example
58
59 @strong{Run server daemon itself}:
60
61 @example
62 server% govpn-server -bind 192.168.0.1:1194
63 @end example
64
65 @strong{Prepare network on GNU/Linux IPv4 client}:
66
67 @example
68 client% umask 066
69 client% utils/storekey.sh key.txt
70 client% ip addr add 192.168.0.2/24 dev wlan0
71 client% tunctl -t tap10
72 client% ip addr add 172.16.0.2/24 dev tap10
73 client% ip link set up dev tap10
74 client% ip route add default via 172.16.0.1
75 @end example
76
77 @strong{Run client daemon itself}:
78 @example
79 client% govpn-client \
80     -key key.txt \
81     -verifier '$argon2d$m=4096,t=128,p=1$bwR5VjeCYIQaa8SeaI3rqg' \
82     -iface tap10 \
83     -remote 192.168.0.1:1194
84 @end example
85
86 @strong{FreeBSD IPv6 similar client-server example}:
87
88 @example
89 server% ifconfig em0 inet6 fe80::1/64
90 server% govpn-server -bind "fe80::1%em0"
91 @end example
92
93 @example
94 client% ifconfig me0 inet6 -ifdisabled auto_linklocal
95 client% ifconfig tap10
96 client% ifconfig tap10 inet6 fc00::2/96 up
97 client% route -6 add default fc00::1
98 client% govpn-client \
99     -key key.txt \
100     -verifier '$argon2d$m=4096,t=128,p=1$bwR5VjeCYIQaa8SeaI3rqg' \
101     -iface tap10 \
102     -remote "[fe80::1%me0]":1194
103 @end example