WireGuard configuration
... / WireGuard configuration
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Question

WireGuard configuration

by
ThibaultL17
Created on 2024-08-16 07:00:34 (edited on 2024-09-04 13:53:39) in Solution Réseau et Sécurité-old

Bonjour à tous,

Sur WireGuard, j'aimerais accepter tous le trafic en provenance de mon Peer, donc je définis AllowedIPs = 0.0.0.0/0 mais cela va également router tout mon trafic vers ce peer, ce que je ne souhaite pas. (seul les packets en provenance de 51.195.54.221 sont routés dedans, via des règles ip rule)

Comment procéder ? (La trafic "normal" doit être routé sur eth0)

Voici ma configuration:

[Interface]
PrivateKey = XXXXXX
Address = 10.66.64.2/24
PostUp = ip route add 51.195.54.221 dev eth1
PostUp = ip rule add from 51.195.54.221 lookup wg1
PostUp = ip route add default dev wg1 table wg1
PostDown = ip route del 51.195.54.221 dev eth1
PostDown = ip rule del from 51.195.54.221 lookup wg1
PostDown = ip route del default dev wg1 table wg1

[Peer]
PublicKey = pkc5ELF2B0jhNmhjM3WKzd9xONU1RS4ZCB5l6yST9WU=
PresharedKey = XXXXX
Endpoint = [IPv6]:50000
AllowedIPs = 0.0.0.0/0

Merci beaucoup par avance.