
Ubuntu 20.04LTSにdigitalocean vdsがあります。 WireGuardを設定するためにこのコマンドを使用しました。https://www.vultr.com/docs/set-up-wireguard-vpn-on-ubuntu-20-04/。 Android 携帯電話または iPad を接続しようとすると、通常はログに次のように表示されます。
ラインバッカーログ:
https://drive.google.com/file/d/17mJfn-3pL8blWptVu4oUC04vw3uCb1Sb/view?usp=sharing(このファイルに何が必要なのかわからないので、ここに残してください。)
現在のサーバー側では:
#wgshow
interface: wg0
public key: <pub key>
private key: (hidden)
listening port: 51820
peer: <pub key>
endpoint: x.x.x.x:63360
allowed ips: 172.26.5.67/32
transfer: 2.46 KiB received, 1.53 KiB sent
#systemctlステータスwg-quick@wg0
[email protected] - WireGuard via wg-quick(8) for wg0
Loaded: loaded (/lib/systemd/system/[email protected]; disabled; vendor pr>
Active: active (exited) since Fri 2022-09-02 10:43:40 UTC; 2h 5min ago
Docs: man:wg-quick(8)
man:wg(8)
https://www.wireguard.com/
https://www.wireguard.com/quickstart/
https://git.zx2c4.com/wireguard-tools/about/src/man/wg-quick.8
https://git.zx2c4.com/wireguard-tools/about/src/man/wg.8
Process: 17323 ExecStart=/usr/bin/wg-quick up wg0 (code=exited, status=0/SU>
Main PID: 17323 (code=exited, status=0/SUCCESS)
サーバーに接続を確立しましたが、一度だけ切断した後に再接続したことはありません。
サーバー構成があります。
#sysctl-p
net.ipv4.ip_forward = 1
#ufw状態
状態:非アクティブ
[Interface]
Address = 172.26.3.155/16
SaveConfig = true
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A
POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D
POSTROUTING -o eth0 -j MASQUERADE
ListenPort = 51820
PrivateKey = server_private_key
[Peer]
Blockquote
PublicKey = client_pub_key
AllowedIPs = 172.26.5.67/32
Endpoint = xx.xxx.xx.xx:63364 <--my phone ip:port (port always changed after reconnection)
クライアント構成があります。
[Interface]
Address = 172.26.5.67/16
DNS = 1.1.1.1
PrivateKey = client_p_key
[Peer]
PublicKey = serv_pub_key
AllowedIPs = 0.0.0.0/0
Endpoint = xxx.xxx.x.x:51820 <- server ip:port ip wich I use to ssh connection
PersistentKeepalive = 25