]> Cypherpunks.ru repositories - govpn.git/blob - doc/example.texi
Merge branch 'develop'
[govpn.git] / doc / example.texi
1 @node Example usage
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 @bullet
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 @code{wlan0} MTU is 1500, 20 bytes overhead per IPv4. So MTU for
12 GoVPN is 1500 - 20 - 8 = 1472.
13 @item During startup client and server will say that TAP interface MTU
14 is 1432.
15 @end itemize
16
17 @strong{Install}. At first you must @ref{Installation, install} this
18 software: download, check the signature, compile.
19
20 @strong{Prepare the server}. Create the new client, named (for example)
21 "Alice":
22
23 @example
24 server% ./utils/newclient.sh Alice
25 Place verifier to peers/6d4ac605ce8dc37c2f0bf21cb542a713/verifier
26 @end example
27
28 "6d4ac605ce8dc37c2f0bf21cb542a713" -- is the new client's identity.
29
30 @strong{Prepare the client}. Generate @ref{Verifier} for known client
31 identity:
32
33 @example
34 client% ./utils/storekey.sh /tmp/passphrase
35 Enter passphrase:[my secure passphrase is here]
36 client% govpn-verifier -id 6d4ac605ce8dc37c2f0bf21cb542a713 -key /tmp/passphrase
37 562556cc9ecf0019b4cf45bcdf42706944ae9b3ac7c73ad299d83f2d5a169c55
38 client% rm /tmp/passphrase
39 @end example
40
41 "562556cc9ecf0019b4cf45bcdf42706944ae9b3ac7c73ad299d83f2d5a169c55" --
42 this is verifier itself.
43
44 @strong{Save verifier on server}.
45
46 @example
47 server% cat > peers/6d4ac605ce8dc37c2f0bf21cb542a713/verifier <<EOF
48 562556cc9ecf0019b4cf45bcdf42706944ae9b3ac7c73ad299d83f2d5a169c55
49 EOF
50 @end example
51
52 @strong{Prepare network on GNU/Linux IPv4 server}:
53
54 @example
55 server% echo "echo tap10" >> peers/6d4ac605ce8dc37c2f0bf21cb542a713/up.sh
56 server% ip addr add 192.168.0.1/24 dev wlan0
57 server% tunctl -t tap10
58 server% ip link set mtu 1432 dev 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 -mtu 1472
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 link set mtu 1432 dev 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     -id 6d4ac605ce8dc37c2f0bf21cb542a713 \
87     -iface tap10 \
88     -remote 192.168.0.1:1194 \
89     -mtu 1472
90 @end example
91
92 @strong{FreeBSD IPv6 similar client-server example}:
93
94 @example
95 server% ifconfig em0 inet6 fe80::1/64
96 server% govpn-server -bind "fe80::1%em0"
97 @end example
98
99 @example
100 client% ifconfig me0 inet6 -ifdisabled auto_linklocal
101 client% ifconfig tap10
102 client% ifconfig tap10 inet6 fc00::2/96 mtu 1412 up
103 client% route -6 add default fc00::1
104 client% govpn-client \
105     -key key.txt \
106     -id 6d4ac605ce8dc37c2f0bf21cb542a713 \
107     -iface tap10 \
108     -remote "[fe80::1%me0]":1194
109 @end example