]> Cypherpunks.ru repositories - govpn.git/blob - doc/example.texi
Merge branch 'develop'
[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 JSON 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
35 Verifier was generated with:
36
37     ./utils/storekey.sh /tmp/passphrase
38     govpn-verifier -key /tmp/passphrase
39 @end verbatim
40
41 @strong{Prepare the server}. Add this entry to @code{peers.json}
42 configuration file:
43
44 @verbatim
45 {
46     "Alice": {
47         "iface": "tap10",
48         "verifier": "$argon2d$m=4096,t=128,p=1$bwR5VjeCYIQaa8SeaI3rqg$KCNIqfS4DGsBTtVytamAzcISgrlEWvNxan1UfBrFu10"
49     }
50 }
51 @end verbatim
52
53 @strong{Prepare network on GNU/Linux IPv4 server}:
54
55 @example
56 server% umask 077
57 server% ip addr add 192.168.0.1/24 dev wlan0
58 server% tunctl -t tap10
59 server% ip addr add 172.16.0.1/24 dev tap10
60 server% ip link set up dev tap10
61 @end example
62
63 @strong{Run server daemon itself}:
64
65 @example
66 server% govpn-server -bind 192.168.0.1:1194
67 @end example
68
69 @strong{Prepare network on GNU/Linux IPv4 client}:
70
71 @example
72 client% umask 066
73 client% utils/storekey.sh key.txt
74 client% ip addr add 192.168.0.2/24 dev wlan0
75 client% tunctl -t tap10
76 client% ip addr add 172.16.0.2/24 dev tap10
77 client% ip link set up dev tap10
78 client% ip route add default via 172.16.0.1
79 @end example
80
81 @strong{Run client daemon itself}:
82 @example
83 client% govpn-client \
84     -key key.txt \
85     -verifier '$argon2d$m=4096,t=128,p=1$bwR5VjeCYIQaa8SeaI3rqg' \
86     -iface tap10 \
87     -remote 192.168.0.1:1194
88 @end example
89
90 @strong{FreeBSD IPv6 similar client-server example}:
91
92 @example
93 server% ifconfig em0 inet6 fe80::1/64
94 server% govpn-server -bind "fe80::1%em0"
95 @end example
96
97 @example
98 client% ifconfig me0 inet6 -ifdisabled auto_linklocal
99 client% ifconfig tap10
100 client% ifconfig tap10 inet6 fc00::2/96 up
101 client% route -6 add default fc00::1
102 client% govpn-client \
103     -key key.txt \
104     -verifier '$argon2d$m=4096,t=128,p=1$bwR5VjeCYIQaa8SeaI3rqg' \
105     -iface tap10 \
106     -remote "[fe80::1%me0]":1194
107 @end example