這次我們是把昨天做好的wireguard vpn 介面啟動安裝到開機程序裡
文件: /usr/local/bin/start_wg_vpn.sh ,權限設定為744
-----------------------------------------------
#!/bin/bash
wg-quick up wg0 <--看你昨天設定好的config檔叫什麼
-----------------------------------------------
文件 /etc/systemd/system/start_wg_vpn.service 權限設定為664
----------------------------
[Unit]
After=network.target
[Service]
ExecStart=/usr/local/bin/start_wg_vpn.sh
[Install]
WantedBy=default.target
------------------------------
-----
$ sudo systemctl daemon-reload $ sudo systemctl enable start_wg_vpn.service