| Prochaine révision | Révision précédente |
| wireguard:accueil [2021/11/21 17:49] – créée: basic setup phsw | wireguard:accueil [2025/10/25 20:31] (Version actuelle) – [Derrière un NAT] add link phsw |
|---|
| ====== Wireguard ====== | ====== Wireguard ====== |
| |
| | |
| | * [[https://github.com/pirate/wireguard-docs]] |
| | * [[https://dev.to/tangramvision/what-they-don-t-tell-you-about-setting-up-a-wireguard-vpn-1h2g]] |
| | * [[https://www.procustodibus.com/blog/2021/03/wireguard-logs/|Four ways to view WireGuard logs]] |
| | * [[https://linuxfr.org/news/wireguard-protocole-de-communication-chiffre-sur-udp-et-logiciel-libre|WireGuard, protocole de communication chiffré sur UDP et logiciel libre]] |
| | * [[https://dataswamp.org/~solene/2024-07-02-linux-vpn-netns.html|WireGuard and Linux network namespaces]] |
| | * [[https://it-notes.dragas.net/2024/07/15/bridging-networks-across-vps-wireguard-vxlan-freebsd/|Bridging Networks Across VPS With Wireguard and VXLAN on FreeBSD]] |
| | * [[https://korben.info/wg-easy-interface-web-simplifiee-wireguard.html|WG-Easy : l'interface web simplifiée pour WireGuard]] |
| | * [[https://blog.thea.codes/nordvpn-wireguard-namespaces/|Split tunneling using Wireguard and namespaces]] |
| | * [[https://enge.math.u-bordeaux.fr/blog/wireguard.html|Wireguard VPN with Guix]] |
| |
| Installer le paquet ''wireguard''. | Installer le paquet ''wireguard''. |
| AllowedIPs = 10.0.0.3/32 | AllowedIPs = 10.0.0.3/32 |
| </code> | </code> |
| | |
| | Ajouter ''net.ipv4.ip_forward=1'' à ''/etc/sysctl.conf''. |
| |
| Sur le client ''A'': | Sur le client ''A'': |
| PublicKey = <la clé publique de C> | PublicKey = <la clé publique de C> |
| Endpoint = 192.168.1.100:51823 | Endpoint = 192.168.1.100:51823 |
| AllowedIPs = 10.0.0.0/24 | AllowedIPs = 10.0.0.1/32, 10.0.0.3/32 |
| | PersistentKeepalive = 25 |
| </code> | </code> |
| |
| ''AllowedIPs'' contient les adresses IP que le serveur C va router au sein du VPN. | * ''AllowedIPs'' contient les adresses IP que le serveur C va router au sein du VPN. |
| | * ''PersistentKeepalive'' permet d'initier automatiquement la connexion des clients au serveur et de la maintenir fonctionnelle. Sans cela, A ne pourra parler à B en passant par C que si B a déjà parlé à C auparavant (un article qui en parle: [[https://jrs-s.net/2018/08/05/routing-between-wg-interfaces-with-wireguard/]]) |
| | |
| | Adapter pour le client ''B''. |
| |
| |
| |
| |
| | ==== Derrière un NAT ==== |
| | |
| | Objectif : que deux machines chacune derrière leur NAT puisse établir un tunnel sans faire passer tout le trafic par un serveur central (on a besoin d'un serveur central servant de point de rencontre pour partager les informations de connexion). |
| | |
| | * [[https://headscale.net/stable/#__do_not_save__|Headscale]] : implémentation libre et auto-hébergée du serveur Tailscale, qui semble pouvoir répondre à ce besoin |
| | * [[https://github.com/anderspitman/awesome-tunneling]] |
| | * [[https://hcartiaux.github.io/posts/2025-01-30-headscale/|Create a private network with Headscale and Tailscale]] |
| | * https://fossorial.io/Getting%20Started/quick-install |
| | * https://netbird.io/ |
| | * [[https://github.com/darksunstealth/multi-vpn-routing]] |
| | * [[https://blog.nommy.moe/blog/exotic-mesh-vpn/|Testing "exotic" p2p VPN]] |
| | |
| | Une solution est de faire du NAT-hole-punching : |
| | * [[https://github.com/malcolmseyd/natpunch-go]] |
| | * [[https://github.com/hoyho/wg-wormhole]] |
| | * [[https://github.com/alex14fr/wgsig]] |
| | * [[https://www.jordanwhited.com/posts/wireguard-endpoint-discovery-nat-traversal/|WireGuard Endpoint Discovery and NAT Traversal using DNS-SD]] |
| | * [[https://github.com/connet-dev/connet]] |
| |