Projet

Général

Profil

Wireguard » Historique » Version 6

Version 5 (Matthieu Herrb, 14/04/2019 20:43) → Version 6/23 (Matthieu Herrb, 14/04/2019 21:00)

h1. Wireguard



h2. test VPN tetaneutral sur h9

<pre>
# modprobe wireguard
# umask 077
# wg genkey > /etc/wireguard/private
# wg pubkey < /etc/wireguard/private > /etc/wireguard/public
# ip link add dev wg0 type wireguard
# ip a add dev wg0 10.99.0.1/32
# ip -6 a add dev wg0 fe80::31/128
# wg set wg0 private-key ./private listen-port 55769
# ip link set wg0 up
</pre>

Pour chaque client, sur h9:

<pre>
# wg set wg0 peer <clé publique du client> allowed-ips 185.119.170.3/32,2a03:7220:8087:300::/56
# ip r add 185.119.170.3/32 dev wg0
# ip -6 r add 2a03:7220:8087:300::/56 dev wg0
</pre>

Config openwrt dans @/etc/config/network@
<pre>
config interface 'vpn0'
option proto 'wireguard'
option private_key '<clé privée>'
list addresses '185.119.170.3/32'
list addresses '2a03:7220:8087:300::1/56'

config wireguard_vpn0
option public_key 'DsIeOCRs/5uYdi8rLiBzRNmN4zUzKCQRqY3Sbl8NS0A=' # La clé publique de h9
option route_allowed_ips '1'
option endpoint_host '91.224.148.143'
option endpoint_port '55769'
option persistent_keepalive '25'
list allowed_ips '0.0.0.0/0'
list allowed_ips '::/0'
</pre>

Sur h7: router les IP via h9:
<pre>
ip r add 185.119.170.3/32 via 91.224.148.143 dev eth3.3131
ip -6 r add 2a03:7220:8087:300::/56 via fe80::80:8f dev eth3.3131
</pre>