teddysun / across

Across the Great Wall we can reach every corner in the world
https://teddysun.com
Apache License 2.0
4.94k stars 2.22k forks source link

wireguard.sh -r fails under Debian 10 #75

Closed walwimp closed 3 years ago

walwimp commented 3 years ago

Failure info:

root@vultr:~# /opt/wireguard.sh -r
[Mon Oct 12 01:33:59 UTC 2020] Check OS version
[Mon Oct 12 01:33:59 UTC 2020] Install dependencies for wireguard
[Mon Oct 12 01:33:59 UTC 2020] apt-get update
[Mon Oct 12 01:34:05 UTC 2020] apt-get -y install qrencode
[Mon Oct 12 01:34:06 UTC 2020] apt-get -y install iptables
[Mon Oct 12 01:34:07 UTC 2020] apt-get -y install bc
[Mon Oct 12 01:34:08 UTC 2020] apt-get -y install gcc
[Mon Oct 12 01:34:26 UTC 2020] apt-get -y install make
[Mon Oct 12 01:34:27 UTC 2020] apt-get -y install libmnl-dev
[Mon Oct 12 01:34:28 UTC 2020] apt-get -y install libelf-dev
[Mon Oct 12 01:34:29 UTC 2020] Install wireguard from repository
[Mon Oct 12 01:34:29 UTC 2020] apt-get update
[Mon Oct 12 01:34:35 UTC 2020] apt-get -y install wireguard
Extracting templates from packages: 100%
[Mon Oct 12 01:34:49 UTC 2020] Create server interface: /etc/wireguard/wg0.conf
[Mon Oct 12 01:34:49 UTC 2020] Create client interface: /etc/wireguard/wg0_client
[Mon Oct 12 01:34:49 UTC 2020] Generate a QR Code picture with client interface
[Mon Oct 12 01:34:49 UTC 2020] qrencode -s8 -o /etc/wireguard/wg0_client.png < /etc/wireguard/wg0_client
[Mon Oct 12 01:34:49 UTC 2020] Enable IP forward
[Mon Oct 12 01:34:49 UTC 2020] Setting firewall rules
[Mon Oct 12 01:34:49 UTC 2020] Starting WireGuard via wg-quick for wg0
[Mon Oct 12 01:34:49 UTC 2020] systemctl daemon-reload
[Mon Oct 12 01:34:49 UTC 2020] systemctl start wg-quick@wg0
Job for wg-quick@wg0.service failed because the control process exited with error code.
See "systemctl status wg-quick@wg0.service" and "journalctl -xe" for details.
[Mon Oct 12 01:34:49 UTC 2020] Execution command (systemctl start wg-quick@wg0) failed, please check it and try again.
root@vultr:~# systemctl status wg-quick@wg0.service
● wg-quick@wg0.service - WireGuard via wg-quick(8) for wg0
   Loaded: loaded (/lib/systemd/system/wg-quick@.service; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2020-10-12 01:34:49 UTC; 38s 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: 8158 ExecStart=/usr/bin/wg-quick up wg0 (code=exited, status=1/FAILURE)
 Main PID: 8158 (code=exited, status=1/FAILURE)

Oct 12 01:34:49 vultr.guest systemd[1]: Starting WireGuard via wg-quick(8) for wg0...
Oct 12 01:34:49 vultr.guest wg-quick[8158]: [#] ip link add wg0 type wireguard
Oct 12 01:34:49 vultr.guest wg-quick[8158]: RTNETLINK answers: Operation not supported
Oct 12 01:34:49 vultr.guest wg-quick[8158]: Unable to access interface: Protocol not supported
Oct 12 01:34:49 vultr.guest wg-quick[8158]: [#] ip link delete dev wg0
Oct 12 01:34:49 vultr.guest wg-quick[8158]: Cannot find device "wg0"
Oct 12 01:34:49 vultr.guest systemd[1]: wg-quick@wg0.service: Main process exited, code=exited, status=1/FAILURE
Oct 12 01:34:49 vultr.guest systemd[1]: wg-quick@wg0.service: Failed with result 'exit-code'.
Oct 12 01:34:49 vultr.guest systemd[1]: Failed to start WireGuard via wg-quick(8) for wg0.
walwimp commented 3 years ago

Fixed.