Slide 9
Slide 9 text
WireGuard-ESP32-Arduino を使う
#include
static WireGuard wg;
char private_key[] = "{YOUR [Interface] PrivateKey}";
IPAddress local_ip(192, 168, 200, 254); // [Interface] Address
char public_key[] = "{YOUR [Peer] PublicKey}";
char endpoint_address[] = "{YOUR [Peer] Endpoint}";
int endpoint_port = 11010;
configTime(9 * 60 * 60, 0, "ntp.jst.mfeed.ad.jp", "ntp.nict.jp", "time.google.com");
delay(3000); // Wait for adjust
wg.begin(local_ip, private_key, endpoint_address, public_key, endpoint_port);
接続 (setup()内 等)
設定 (ヘッダ部 等)
取り込み
1
2
3
公式からインストール可能
時刻合わせがポイント
WireGuard サーバーから
払い出された値を設定
https://github.com/ciniml/WireGuard-ESP32-Arduino
7行
3行