sudo apt install wireguard
sudo -i
cd /etc/wireguard
umask 077
wg genkey > internal-private.key
wg pubkey < internal-private.key > internal-public.key
cat internal-private.key
cat internal-public.key
sudo nano wg0.conf
# Setelah itu anda bisa masukan script berikut :
[Interface]
PrivateKey = cN10aAmxLz3SQqhkmNSVG7vLxzKoaM/C8CrQqn5R9UE=
Address = 10.0.0.4/32
ListenPort = 13231
[Peer]
PublicKey = Gi9yqwIxgEikbb7PIG55SowIpzb7DsWTlQhUcZllZyU=
Endpoint = 103.x.x.x:13231
# AllowedIPs = 0.0.0.0/0
AllowedIPs = 10.0.0.1/32
PersistentKeepalive = 10
sudo wg-quick up wg0
sudo wg show
sudo ip route show
sudo wg-quick down wg0
Jika ingin di buat autostartup wireguardnya
sudo systemctl enable wg-quick@wg0
untuk cek status autostartupnya
sudo systemctl status wg-quick@wg0