]> Cypherpunks.ru repositories - govpn.git/blob - doc/example.texi
Use ssh/terminal package for reading passwords directly from terminal
[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 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 @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% ip addr add 192.168.0.1/24 dev wlan0
53 server% tunctl -t tap10
54 server% ip addr add 172.16.0.1/24 dev tap10
55 server% ip link set up dev tap10
56 @end example
57
58 @strong{Run server daemon itself}:
59
60 @example
61 server% govpn-server -bind 192.168.0.1:1194
62 @end example
63
64 @strong{Prepare network on GNU/Linux IPv4 client}:
65
66 @example
67 client% ip addr add 192.168.0.2/24 dev wlan0
68 client% tunctl -t tap10
69 client% ip addr add 172.16.0.2/24 dev tap10
70 client% ip link set up dev tap10
71 client% ip route add default via 172.16.0.1
72 @end example
73
74 @strong{Run client daemon itself}:
75 @example
76 client% govpn-client \
77     -verifier '$argon2d$m=4096,t=128,p=1$bwR5VjeCYIQaa8SeaI3rqg' \
78     -iface tap10 \
79     -remote 192.168.0.1:1194
80 @end example
81
82 @strong{FreeBSD IPv6 similar client-server example}:
83
84 @example
85 server% ifconfig em0 inet6 fe80::1/64
86 server% govpn-server -bind "fe80::1%em0"
87 @end example
88
89 @example
90 client% ifconfig me0 inet6 -ifdisabled auto_linklocal
91 client% ifconfig tap10
92 client% ifconfig tap10 inet6 fc00::2/96 up
93 client% route -6 add default fc00::1
94 client% govpn-client \
95     -verifier '$argon2d$m=4096,t=128,p=1$bwR5VjeCYIQaa8SeaI3rqg' \
96     -iface tap10 \
97     -remote "[fe80::1%me0]":1194
98 @end example