]> Cypherpunks.ru repositories - govpn.git/blob - doc/example.texi
Ability to use TUN-interfaces under GNU/Linux
[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 TUN/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
23 @verbatim
24 client% ./utils/newclient.sh Alice
25 Passphrase:
26 Your client verifier is: $balloon$s=32768,t=16,p=2$bwR5VjeCYIQaa8SeaI3rqg
27
28 Place the following YAML configuration entry on the server's side:
29
30     Alice:
31         up: /path/to/up.sh
32         iface: or TUN/TAP interface name
33         verifier: $balloon$s=32768,t=16,p=2$bwR5VjeCYIQaa8SeaI3rqg$KCNIqfS4DGsBTtVytamAzcISgrlEWvNxan1UfBrFu10
34 @end verbatim
35
36 @strong{Prepare the server}. Add this entry to @file{peers.yaml}
37 configuration file:
38
39 @verbatim
40 Alice:
41     iface: tap10
42     verifier: $balloon$s=32768,t=16,p=2$bwR5VjeCYIQaa8SeaI3rqg$KCNIqfS4DGsBTtVytamAzcISgrlEWvNxan1UfBrFu10
43 @end verbatim
44
45 @strong{Prepare network on GNU/Linux IPv4 server}:
46
47 @verbatim
48 server% ip addr add 192.168.0.1/24 dev wlan0
49 server% ip tuntap add dev tap10 mode tap
50 server% ip addr add 172.16.0.1/24 dev tap10
51 server% ip link set up dev tap10
52 @end verbatim
53
54 @strong{Run server daemon itself}:
55
56 @verbatim
57 server% govpn-server -bind 192.168.0.1:1194
58 @end verbatim
59
60 @strong{Prepare network on GNU/Linux IPv4 client}:
61
62 @verbatim
63 client% ip addr add 192.168.0.2/24 dev wlan0
64 client% ip tuntap add dev tap10 mode tap
65 client% ip addr add 172.16.0.2/24 dev tap10
66 client% ip link set up dev tap10
67 client% ip route add 0/1 via 172.16.0.1
68 client% ip route add 128/1 via 172.16.0.1
69 @end verbatim
70
71 @strong{Run client daemon itself}:
72 @verbatim
73 client% govpn-client \
74     -verifier '$balloon$s=32768,t=16,p=2$bwR5VjeCYIQaa8SeaI3rqg' \
75     -iface tap10 \
76     -remote 192.168.0.1:1194
77 @end verbatim
78
79 @strong{FreeBSD IPv6 similar client-server example}:
80
81 @verbatim
82 server% ifconfig em0 inet6 fe80::1/64
83 server% govpn-server -bind "fe80::1%em0"
84 @end verbatim
85
86 @verbatim
87 client% ifconfig me0 inet6 -ifdisabled auto_linklocal
88 client% ifconfig tap10
89 client% ifconfig tap10 inet6 fc00::2/96 up
90 client% route -6 add default fc00::1
91 client% govpn-client \
92     -verifier '$balloon$s=32768,t=16,p=2$bwR5VjeCYIQaa8SeaI3rqg' \
93     -iface tap10 \
94     -remote "[fe80::1%me0]":1194
95 @end verbatim