前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >服务器使用 systemd 自动启动 wireguard

服务器使用 systemd 自动启动 wireguard

作者头像
宋天伦
发布2023-10-21 09:46:57
4990
发布2023-10-21 09:46:57
举报
文章被收录于专栏:fryteafrytea

本文 首发于 🌱 煎茶,请注明 来源。

  1. Generate a valid and working WireGuard configuration file /etc/wireguard/wg0.conf. Our setup guide offers details. Note: You may have to replace the Endpoint hostname with the WireGuard server IP address in the WireGuard configuration file. DNS may or may not be applied when systemd brings the wg0 interface up.
  2. Add the WireGuard service to systemd
代码语言:javascript
复制
   sudo systemctl enable wg-quick@wg0.service
   sudo systemctl daemon-reload
  1. Start the new service immediately:
代码语言:javascript
复制
sudo systemctl start wg-quick@wg0
  1. Reboot your computer system to verify the automatic connection on startup works as expected.
  2. Check the service status:
代码语言:javascript
复制
   systemctl status wg-quick@wg0
  1. To remove the service and clean up the system:
代码语言:javascript
复制
sudo systemctl stop wg-quick@wg0
sudo systemctl disable wg-quick@wg0.service
sudo rm -i /etc/systemd/system/wg-quick@wg0*
sudo systemctl daemon-reload
sudo systemctl reset-failed

References#

注:本作品采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可。

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • References#
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档