2 @unnumbered User manual
4 GoVPN is split into two pieces: client and server. Each of them work on
5 top of UDP and TAP virtual network interfaces. Client and server have
6 several common configuration command line options:
10 Because of stateless UDP nature there is no way to know if
11 remote peer is dead, but after some timeout. Client and server
12 heartbeats each other every third part of heartbeat. Also this timeout
13 is the time when server purge his obsolete handshake and peers states.
14 @item Allowable nonce difference
15 To prevent replay attacks we just remembers
16 latest received nonce number from the remote peer and drops those who
17 has lower ones. Because UDP packets can be reordered during: that
18 behaviour can lead to dropping of not replayed ones. This options gives
19 ability to create some window of allows difference. That opens the door
20 for replay attacks for narrow time interval.
22 Maximum transmission unit.
25 Client needs to know his identification, path to the authentication key,
26 remote server's address, TAP interface name, and optional path to up and
27 down scripts, that will be executed after connection is either initiated
30 Server needs to know only the address to listen on and path to directory
31 containing peers information. This directory must contain subdirectories
32 with the names equal to client's identifications. Each of them must have
33 key file with corresponding authentication key, up.sh script that has to
34 print interface's name on the first line and optional down.sh.
41 @section Example usage
43 Let's assume that there is some insecure link between your computer and
44 WiFi-reachable gateway. You have got preconfigured @code{wlan0} network
45 interface with 192.168.0/24 network. You want to create virtual
46 encrypted and authenticated 172.16.0/24 network and use it as a default
47 transport. MTU for that wlan0 is 1500 bytes. GoVPN will say that maximum
48 MTU for the link is 1476, however it does not take in account TAP's
49 Ethernet frame header length, that in my case is 14 bytes long (1476 - 14).
51 Do not forget about setting @code{GOMAXPROC} environment variable for
52 using more than one CPU.
54 At first you have to generate client's authentication key and client's
55 unique identification. There is @code{utils/newclient.sh} script for
59 % ./utils/newclient.sh Alice
60 peers/9b40701bdaf522f2b291cb039490312/Alice
63 @code{9b40701bdaf522f2b291cb039490312} is client's identification.
64 @code{Alice} is just an empty file that can help to search them like
65 this: @verb{|find peers -name Alice|}. @code{key} file inside peer's
66 directory contains authentication key.
68 GNU/Linux IPv4 client-server example:
71 server% echo "#!/bin/sh" > peers/CLIENTID/up.sh
72 server% echo "echo tap10" >> peers/CLIENTID/up.sh
73 server% chmod 500 peers/CLIENTID/up.sh
74 server% ip addr add 192.168.0.1/24 dev wlan0
75 server% tunctl -t tap10
76 server% ip link set mtu 1462 dev tap10
77 server% ip addr add 172.16.0.1/24 dev tap10
78 server% ip link set up dev tap10
79 server% GOMAXPROC=4 govpn-server -bind 192.168.0.1:1194
84 client% echo MYLONG64HEXKEY > key.txt
85 client% ip addr add 192.168.0.2/24 dev wlan0
86 client% tunctl -t tap10
87 client% ip link set mtu 1462 dev tap10
88 client% ip addr add 172.16.0.2/24 dev tap10
89 client% ip link set up dev tap10
90 client% ip route add default via 172.16.0.1
91 client% export GOMAXPROC=4
93 govpn-client -key key.txt -id CLIENTID -iface tap10 -remote 192.168.0.1:1194
97 FreeBSD IPv6 client-server example:
100 server% cat > peers/CLIENTID/up.sh <<EOF
102 $tap=$(ifconfig tap create)
103 ifconfig $tap inet6 fc00::1/96 mtu 1462 up
106 server% chmod 500 peers/CLIENTID/up.sh
107 server% ifconfig em0 inet6 fe80::1/64
108 server% GOMAXPROC=4 govpn-server -bind fe80::1%em0
112 client% ifconfig me0 inet6 -ifdisabled auto_linklocal
113 client% ifconfig tap10
114 client% ifconfig tap10 inet6 fc00::2/96 mtu 1462 up
115 client% route -6 add default fc00::1
116 client% export GOMAXPROC=4
118 govpn-client -key key.txt -id CLIENTID -iface tap10 -remote [fe80::1%me0]:1194
125 client% cat > up.sh <<EOF
130 client% chmod +x up.sh
131 client% govpn -id CLIENTID -key key.txt -iface tap10 -remote [fe80::1%me0]:1194 -up ./up.sh
134 Client will exit if won't finish handshake during @code{-timeout}.
135 If no packets are received from remote side during timeout, then daemon
136 will stop sending packets to the client and client will exit. In all
137 cases you have to rehandshake again.