伺服器IP: 端口: |
WireGuard 內部IP: 客戶端第一個 IP: 客戶端數量: WireGuard 網卡ID: 客戶端 AllowedIPs: (ex. 10.0.0.0/24, 10.99.0.0/24) 客戶端保持連線: 秒 (可選) |
伺服器私鑰: 伺服器公鑰: |
伺服器IP: 端口: |
WireGuard 內部IP: 客戶端第一個 IP: 客戶端數量: WireGuard 網卡ID: 客戶端 AllowedIPs: (ex. 10.0.0.0/24, 10.99.0.0/24) 客戶端保持連線: 秒 (可選) |
伺服器私鑰: 伺服器公鑰: |
伺服器設定 {{ server }}:{{ port }}
set interfaces wireguard wg{{ wgnum }} address '{{ network }}.1/32'
set interfaces wireguard wg{{ wgnum }} port '{{ port }}'
set interfaces wireguard wg{{ wgnum }} private-key '{{ serverkeys.privateKey }}'
{{ line }}
set interfaces wireguard wg{{ wgnum }} peer client{{ client }} allowed-ips '{{ network }}.{{ client }}/32'
set interfaces wireguard wg{{ wgnum }} peer client{{ client }} public-key '{{ value.publicKey }}'
客戶端設定 (第一個 IP: {{network}}.{{startip}}, 數量: {{ clientcount }} 個)
[Interface]
## {{ value.name }}
Address = {{ network }}.{{ client }}/24
PrivateKey = {{ value.privateKey }}
[Peer]
PublicKey = {{ serverkeys.publicKey }}
AllowedIPs = {{ allowedips }}
Endpoint = {{ server }}:{{ port }}
{{ pklState }}