modifié : mkwgconf-p2p.sh
nouveau fichier : wg0-1.conf supprimé : wg0-1.conf modifié : wg0-2.conf modifié : wg0-3.conf nouveau fichier : wg0-4.conf
This commit is contained in:
@@ -11,7 +11,10 @@ PortB=51820 # Port ecoute extremite B
|
||||
AddressCwg=10.0.0.3/32 # Adresse VPN Wireguard extremite C
|
||||
EndpointC=172.16.0.110 # Adresse extremite C
|
||||
PortC=51820 # Port ecoute extremite C
|
||||
|
||||
AddressDwg=10.0.0.3/32 # Adresse VPN Wireguard extremite D
|
||||
EndpointD=10.121.38.35 # Adresse extremite D
|
||||
PortD=61820 # Port ecoute extremite D
|
||||
|
||||
umask 077 ;
|
||||
wg genkey > endpoint-a.key
|
||||
wg pubkey < endpoint-a.key > endpoint-a.pub
|
||||
@@ -22,12 +25,17 @@ wg pubkey < endpoint-b.key > endpoint-b.pub
|
||||
wg genkey > endpoint-c.key
|
||||
wg pubkey < endpoint-c.key > endpoint-c.pub
|
||||
|
||||
wg genkey > endpoint-d.key
|
||||
wg pubkey < endpoint-d.key > endpoint-d.pub
|
||||
|
||||
PKA=$(cat endpoint-a.key)
|
||||
pKA=$(cat endpoint-a.pub)
|
||||
PKB=$(cat endpoint-b.key)
|
||||
pKB=$(cat endpoint-b.pub)
|
||||
PKC=$(cat endpoint-c.key)
|
||||
pKC=$(cat endpoint-c.pub)
|
||||
PKD=$(cat endpoint-d.key)
|
||||
pKD=$(cat endpoint-d.pub)
|
||||
|
||||
cat <<FINI > wg0-1.conf
|
||||
# local settings for Endpoint A
|
||||
@@ -42,11 +50,18 @@ PublicKey = $pKB
|
||||
Endpoint = ${EndpointB}:$PortB
|
||||
AllowedIPs = $AddressBwg
|
||||
|
||||
# remote settings for Endpoint B
|
||||
# remote settings for Endpoint C
|
||||
[Peer]
|
||||
PublicKey = $pKC
|
||||
Endpoint = ${EndpointC}:$PortC
|
||||
AllowedIPs = $AddressCwg
|
||||
|
||||
# remote settings for Endpoint D
|
||||
[Peer]
|
||||
PublicKey = $pKD
|
||||
Endpoint = ${EndpointD}:$PortD
|
||||
AllowedIPs = $AddressDwg
|
||||
|
||||
FINI
|
||||
|
||||
|
||||
@@ -77,3 +92,17 @@ PublicKey = $pKA
|
||||
Endpoint = ${EndpointA}:$PortA
|
||||
AllowedIPs = $AddressAwg
|
||||
FINI
|
||||
|
||||
cat <<FINI > wg0-4.conf
|
||||
# local settings for Endpoint D
|
||||
[Interface]
|
||||
PrivateKey = $PKD
|
||||
Address = $AddressDwg
|
||||
ListenPort = $PortD
|
||||
|
||||
# remote settings for Endpoint A
|
||||
[Peer]
|
||||
PublicKey = $pKA
|
||||
Endpoint = ${EndpointA}:$PortA
|
||||
AllowedIPs = $AddressAwg
|
||||
FINI
|
||||
|
||||
Reference in New Issue
Block a user