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