X-Git-Url: http://www.git.cypherpunks.ru/?p=govpn.git;a=blobdiff_plain;f=doc%2Fexample.texi;h=688898a76bf350e646fac90b3ef7f702a5c40aa1;hp=217513e06be62c0283e53251e185c61ab0c641c7;hb=a11b0bda178937e6891770f40f800d69b5640313;hpb=24d44126ebe1afab9d7652d457a6d3d50ecf0c71 diff --git a/doc/example.texi b/doc/example.texi index 217513e..688898a 100644 --- a/doc/example.texi +++ b/doc/example.texi @@ -1,90 +1,95 @@ -@node Example usage +@node Example @section Example usage Let's assume that there is some insecure link between your computer and WiFi-reachable gateway. -@itemize @bullet +@itemize @item You have got @code{wlan0} NIC with 192.168.0/24 network on it. @item You want to create virtual encrypted and authenticated 172.16.0/24 network and use it as a default transport. -@item @code{wlan0} MTU is 1500, 20 bytes overhead per IPv4. So MTU for -GoVPN is 1500 - 20 - 8 = 1472. -@item During startup client and server will say that TAP interface MTU -is 1432. +@item Assume that outgoing GoVPN packets can be fragmented, so we do not +bother configuring MTU of TUN/TAP interfaces. For better performance just +lower it and check that no fragmentation of outgoing UDP packets occurs. @end itemize -Do not forget about setting @code{GOMAXPROC} environment variable for -using more than one CPU on both sides: +@strong{Install}. At first you must @ref{Installation, install} this +software: download, @ref{Integrity, check the signature}, compile. -@example -% export GOMAXPROC=4 -@end example +@strong{Prepare the client}. Generate client's verifier for Alice as an +example: -As a preparation you have to generate peer directory (register new -client) on the server side using @code{utils/newsclient.sh}, generate -@ref{Verifier} on client side and place it on the server: -@example -server% ./utils/newclient.sh Alice -Place verifier to peers/6d4ac605ce8dc37c2f0bf21cb542a713/verifier +@verbatim +client% ./utils/newclient.sh Alice +Passphrase: +Your client verifier is: $balloon$s=32768,t=16,p=2$bwR5VjeCYIQaa8SeaI3rqg -client% ./utils/storekey.sh /tmp/passphrase -Enter passphrase:[my secure passphrase is here] -client% govpn-verifier -id 6d4ac605ce8dc37c2f0bf21cb542a713 -key /tmp/passphrase -562556cc9ecf0019b4cf45bcdf42706944ae9b3ac7c73ad299d83f2d5a169c55 -client% rm /tmp/passphrase +Place the following YAML configuration entry on the server's side: -server% cat > peers/6d4ac605ce8dc37c2f0bf21cb542a713/verifier <> peers/6d4ac605ce8dc37c2f0bf21cb542a713/up.sh +@strong{Prepare network on GNU/Linux IPv4 server}: + +@verbatim 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 tuntap add dev tap10 mode tap 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 +@end verbatim + +@strong{Run server daemon itself}: + +@verbatim +server% govpn-server -bind 192.168.0.1:1194 +@end verbatim -@example -client% umask 066 -client% utils/storekey.sh key.txt +@strong{Prepare network on GNU/Linux IPv4 client}: + +@verbatim 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 tuntap add dev tap10 mode tap 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 6d4ac605ce8dc37c2f0bf21cb542a713 -iface tap10 \ - -remote 192.168.0.1:1194 -mtu 1472 -done -@end example +client% ip route add 0/1 via 172.16.0.1 +client% ip route add 128/1 via 172.16.0.1 +@end verbatim + +@strong{Run client daemon itself}: +@verbatim +client% govpn-client \ + -verifier '$balloon$s=32768,t=16,p=2$bwR5VjeCYIQaa8SeaI3rqg' \ + -iface tap10 \ + -remote 192.168.0.1:1194 +@end verbatim -FreeBSD IPv6 client-server example: +@strong{FreeBSD IPv6 similar client-server example}: -@example +@verbatim server% ifconfig em0 inet6 fe80::1/64 -server% GOMAXPROC=4 govpn-server -bind "fe80::1%em0" -@end example +server% govpn-server -bind "fe80::1%em0" +@end verbatim -@example +@verbatim client% ifconfig me0 inet6 -ifdisabled auto_linklocal client% ifconfig tap10 -client% ifconfig tap10 inet6 fc00::2/96 mtu 1412 up +client% ifconfig tap10 inet6 fc00::2/96 up client% route -6 add default fc00::1 -client% export GOMAXPROC=4 -client% while :; do - govpn-client -key key.txt -id 6d4ac605ce8dc37c2f0bf21cb542a713 -iface tap10 \ - -remote [fe80::1%me0]:1194 -done -@end example +client% govpn-client \ + -verifier '$balloon$s=32768,t=16,p=2$bwR5VjeCYIQaa8SeaI3rqg' \ + -iface tap10 \ + -remote "[fe80::1%me0]":1194 +@end verbatim