]> Cypherpunks.ru repositories - govpn.git/blobdiff - doc/example.texi
JSON configuration
[govpn.git] / doc / example.texi
index 384d16ac7720e025d722293069bf137a7e2edc50..c26284650498e9b2a7e5ff290dc3799bdf0a93e0 100644 (file)
@@ -1,4 +1,4 @@
-@node Example usage
+@node Example
 @section Example usage
 
 Let's assume that there is some insecure link between your computer and
@@ -14,42 +14,80 @@ GoVPN is 1500 - 20 - 8 = 1472.
 is 1432.
 @end itemize
 
-Do not forget about setting @code{GOMAXPROC} environment variable for
-using more than one CPU.
+@strong{Install}. At first you must @ref{Installation, install} this
+software: download, @ref{Integrity, check the signature}, compile.
 
-GNU/Linux IPv4 client-server example:
+@strong{Prepare the client}. Generate client's identity and verifier for
+Alice as an example:
+@verbatim
+client% ./utils/newclient.sh Alice
+Enter passphrase:
+Your id is: 7012df29deee2170594119df5091d4a2
+
+Place the following JSON configuration entry on the server's side:
+
+    "7012df29deee2170594119df5091d4a2": {
+        "name": "Alice",
+        "up": "/path/to/up.sh",
+        "verifier": "fb43255ca3fe5bd884e364e5eae0cd37ad14774930a027fd38d8938fd0b57425"
+    }
+
+Verifier was generated with:
+
+    ./utils/storekey.sh /tmp/passphrase
+    govpn-verifier -id 7012df29deee2170594119df5091d4a2 -key /tmp/passphrase
+@end verbatim
+
+@strong{Prepare the server}. Add this entry to @code{peers.json}
+configuration file.
+
+@strong{Prepare network on GNU/Linux IPv4 server}:
 
 @example
-server% echo "echo tap10" >> peers/CLIENTID/up.sh
+server% umask 077
+server% echo "#!/bin/sh" > /path/to/up.sh
+server% echo "echo tap10" >> /path/to/up.sh
 server% ip addr add 192.168.0.1/24 dev wlan0
 server% tunctl -t tap10
 server% ip link set mtu 1432 dev tap10
 server% ip addr add 172.16.0.1/24 dev tap10
 server% ip link set up dev tap10
-server% GOMAXPROC=4 govpn-server -bind 192.168.0.1:1194 -mtu 1472
 @end example
 
+@strong{Run server daemon itself}:
+
+@example
+server% govpn-server -bind 192.168.0.1:1194 -mtu 1472
+@end example
+
+@strong{Prepare network on GNU/Linux IPv4 client}:
+
 @example
 client% umask 066
-client% echo MYLONG64HEXKEY > key.txt
+client% utils/storekey.sh key.txt
 client% ip addr add 192.168.0.2/24 dev wlan0
 client% tunctl -t tap10
 client% ip link set mtu 1432 dev tap10
 client% ip addr add 172.16.0.2/24 dev tap10
 client% ip link set up dev tap10
 client% ip route add default via 172.16.0.1
-client% export GOMAXPROC=4
-client% while :; do
-    govpn-client -key key.txt -id CLIENTID -iface tap10 \
-        -remote 192.168.0.1:1194 -mtu 1472
-done
 @end example
 
-FreeBSD IPv6 client-server example:
+@strong{Run client daemon itself}:
+@example
+client% govpn-client \
+    -key key.txt \
+    -id 906e34b98750c4f686d6c5489508763c \
+    -iface tap10 \
+    -remote 192.168.0.1:1194 \
+    -mtu 1472
+@end example
+
+@strong{FreeBSD IPv6 similar client-server example}:
 
 @example
 server% ifconfig em0 inet6 fe80::1/64
-server% GOMAXPROC=4 govpn-server -bind "fe80::1%em0"
+server% govpn-server -bind "fe80::1%em0"
 @end example
 
 @example
@@ -57,9 +95,9 @@ client% ifconfig me0 inet6 -ifdisabled auto_linklocal
 client% ifconfig tap10
 client% ifconfig tap10 inet6 fc00::2/96 mtu 1412 up
 client% route -6 add default fc00::1
-client% export GOMAXPROC=4
-client% while :; do
-    govpn-client -key key.txt -id CLIENTID -iface tap10 \
-        -remote [fe80::1%me0]:1194
-done
+client% govpn-client \
+    -key key.txt \
+    -id 906e34b98750c4f686d6c5489508763c \
+    -iface tap10 \
+    -remote "[fe80::1%me0]":1194
 @end example