Outils pour utilisateurs

Outils du site


auto-hebergement

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
auto-hebergement [2023/12/13 12:00] admin_elemacauto-hebergement [2023/12/13 12:25] (Version actuelle) admin_elemac
Ligne 89: Ligne 89:
 https://www.reddit.com/r/WireGuard/comments/tr1tq7/client_has_no_internet_access_while_connected_to/ https://www.reddit.com/r/WireGuard/comments/tr1tq7/client_has_no_internet_access_while_connected_to/
  
 +==== Config WG sur VPS ====
  
 +installer debian 11
  
-Config client sur Yunohost+installer WG 
 + 
 +fichier /etc/wireguard/wg0.conf : 
 +<code> 
 +[Interface] 
 +Address = 10.66.66.1/24,fd42:42:42::1/64 
 +ListenPort = 51820 
 +PrivateKey = ****** 
 +PostUp = bash /etc/wireguard/PostUp.sh 
 +PostDown = bash /etc/wireguard/PostDown.sh 
 +#PostUp = iptables -I INPUT -p udp --dport 51820 -j ACCEPT 
 +#PostUp = iptables -I FORWARD -i ens6 -o wg0 -j ACCEPT 
 +#PostUp = iptables -I FORWARD -i wg0 -j ACCEPT 
 +#PostUp = iptables -t nat -A POSTROUTING -o ens6 -j MASQUERADE 
 +#PostUp = ip6tables -I FORWARD -i wg0 -j ACCEPT 
 +#PostUp = ip6tables -t nat -A POSTROUTING -o ens6 -j MASQUERADE 
 +#PostDown = iptables -D INPUT -p udp --dport 51820 -j ACCEPT 
 +#PostDown = iptables -D FORWARD -i ens6 -o wg0 -j ACCEPT 
 +#PostDown = iptables -D FORWARD -i wg0 -j ACCEPT 
 +#PostDown = iptables -t nat -D POSTROUTING -o ens6 -j MASQUERADE 
 +#PostDown = ip6tables -D FORWARD -i wg0 -j ACCEPT 
 +#PostDown = ip6tables -t nat -D POSTROUTING -o ens6 -j MASQUERADE 
 + 
 + 
 +### Client yunohost 
 +[Peer] 
 +PublicKey = ****** 
 +PresharedKey = ****** 
 +AllowedIPs = 10.66.66.2/32,fd42:42:42::2/128 
 +</code> 
 + 
 +Fichier PostUp.sh 
 +<code> 
 +iptables -A FORWARD -i wg0 -j ACCEPT;  
 +iptables -t nat -A POSTROUTING -o ens6 -j MASQUERADE;  
 +#ip6tables -A FORWARD -i wg0 -j ACCEPT;  
 +#ip6tables -t nat -A POSTROUTING -o ens6 -j MASQUERADE;  
 + 
 +# icmp 
 +iptables -A INPUT -p icmp -j ACCEPT; 
 +#ip6tables -A INPUT -p ipv6-icmp -j ACCEPT;  
 +  
 +# Routing TCP port 25 and 587 from Yunohost Server to internet  
 +for j in 25 587 
 +do 
 + iptables -t nat -A POSTROUTING -s 10.66.66.2 -p tcp --dport $j -j SNAT --to 217.160.99.43;  
 + iptables -A FORWARD -s 10.66.66.2 -p tcp --dport $j -j ACCEPT;  
 + #ip6tables -t nat -A POSTROUTING -s fd42:42:42::2 -p tcp --dport $j -j SNAT --to [insert public IPV6 of the VPS];  
 + #ip6tables -A FORWARD -s fd42:42:42::2 -p tcp --dport $j -j ACCEPT;  
 +done 
 + 
 +# Routing TCP port required from VPN server to Yunohost server 
 +for i in 25 53 80 140 443 587 993 1194 1195 1935 5222 5269 5432 5665 8099 8443 8447 50059 51820  
 +do  
 + iptables -t nat -A PREROUTING -i ens6 -p tcp --dport $i -j DNAT --to-destination 10.66.66.2;  
 + iptables -A FORWARD -d 10.66.66.2 -p tcp --dport $i -j ACCEPT;  
 + #ip6tables -t nat -A PREROUTING -i ens6 -p tcp --dport $i -j DNAT --to-destination fd42:42:42::2;  
 + #ip6tables -A FORWARD -d fd42:42:42::2 -p tcp --dport $i -j ACCEPT;  
 +done 
 + 
 +# Routing UDP port required from VPN server to Yunohost server 
 +iptables -A PREROUTING -t nat -i ens6 -p udp --dport 8099 -j DNAT --to-destination 10.66.66.2 
 + 
 +# Save and quit (CTRL+O, CTRL+X) 
 +</code> 
 + 
 +==== Config client WG sur Yunohost ====
  
 /opt/yunohost/wireguard_client/vps.conf : /opt/yunohost/wireguard_client/vps.conf :
auto-hebergement.txt · Dernière modification : 2023/12/13 12:25 de admin_elemac