maj readme

This commit is contained in:
Grégory Lebreton 2021-08-10 18:07:34 +02:00
parent 2befc5ce63
commit 02f3028abc

View File

@ -32,18 +32,18 @@ Dans ce fichier de configuration, CLEF_PRIVEE_SERVEUR et INTERFACE_RESEAU sont
Address = 10.0.0.1/24
ListenPort = 51820
# Clef privée du serveur
PrivateKey = CLEF_PRIVEE_SERVEUR
PrivateKey = 'CLEF_PRIVEE_SERVEUR'
# Routing vers l'interface réseaux
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o INTERFACE_RESEAU -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o INTERFACE_RESEAU -j MASQUERADE
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o 'INTERFACE_RESEAU' -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o 'INTERFACE_RESEAU' -j MASQUERADE
```
La CLEF_PRIVEE_SERVEUR s'obtient avec la commande:
La 'CLEF_PRIVEE_SERVEUR' s'obtient avec la commande:
```bash
cat /etc/wireguard/privatekey
```
L'INTERFACE_RESEAU s'obtient avec la commande:
L'"INTERFACE_RESEAU" s'obtient avec la commande:
```bash
ip -o -4 route show to default | awk '{print $5}'
```
@ -91,15 +91,15 @@ nano /etc/wireguard/wg0.conf
[Interface]
# Clef privée du client
PrivateKey = CLIENT_PRIVATE_KEY
PrivateKey = 'CLIENT_PRIVATE_KEY'
# Adresse interne du client (en cohérence avec l'IP interne du serveur)
Address = 10.0.0.2/24
[Peer]
# Clef publique du serveur
PublicKey = SERVER_PUBLIC_KEY
PublicKey = 'SERVER_PUBLIC_KEY'
# Adresse IP publique du serveur
Endpoint = SERVER_IP_ADDRESS:51820
Endpoint = 'SERVER_IP_ADDRESS':51820
AllowedIPs = 0.0.0.0/0
```
Configuration de "l'IP forwarding":
@ -138,12 +138,12 @@ Appliquer la configuration suivante en renseignant CLEF-PRIVEE_CLIENT, IP_PUBLIQ
/etc/wireguard/wg0.conf
[Interface]
PrivateKey = CLIENT_PRIVATE_KEY
PrivateKey = 'CLIENT_PRIVATE_KEY'
Address = 10.0.0.2/24
[Peer]
PublicKey = SERVER_PUBLIC_KEY
Endpoint = SERVER_IP_ADDRESS:51820
PublicKey = 'SERVER_PUBLIC_KEY'
Endpoint = 'SERVER_IP_ADDRESS':51820
AllowedIPs = 0.0.0.0/0
```
Note: La port et les adresses IP internes au réseau peuvent également être modifiées (en cohérence avec la configuration du serveur)