I am trying to run Wireguard VPN to my server.
I created /etc/wireguard/wg0.conf with:
[Interface]
PrivateKey = ****
[Peer]
PublicKey = ****
PresharedKey = ****
Endpoint = xx.xx.xx.xx:51194
AllowedIPs = x.x.x.0/24
PersistentKeepalive = 5
Then I run:
ip link add dev wg0 type wireguard
wg setconf wg0 /etc/wireguard/wg0.conf
ip addr add x.x.x.x/32 dev wg0
ip link set up dev wg0
ip route add x.x.x.0/24 dev wg0
This works fine. But how can I start my VPN automatically at startup (reboot)?
There is no system, crontab, if I put these commands to /etc/rc.local they do not run, also if I create /etc/init.d/S99wireguard this doesn't run.
Any help?
I am trying to run Wireguard VPN to my server.
I created /etc/wireguard/wg0.conf with:
Then I run:
This works fine. But how can I start my VPN automatically at startup (reboot)?
There is no system,
crontab, if I put these commands to/etc/rc.localthey do not run, also if I create/etc/init.d/S99wireguardthis doesn't run.Any help?