Skip to content
forked from Lincyaw/wg-mgr

simple wireguard configuration manager

Notifications You must be signed in to change notification settings

YifanYang6/wg-mgr

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Debian

Prepare:

sudo apt install wireguard

Usage:

  1. Update server config
# case 1
./vpn-tool setup > /etc/wireguard/wg0.conf
wg syncconf wg0 <(wg-quick strip wg0) 

# case 2
./vpn-tool setup > /etc/wireguard/wg0.conf
wg-quick down wg0 # optional
wg-quick up wg0 
  1. Add user
./vpn-tool adduser --id yourname

2.1 If want to advertise a subnet router,

./vpn-tool adduser --id router \
    --postup "iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -s 100.10.10.0/24 -o eth0 -j MASQUERADE" \
    --postdown "iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -s 100.10.10.0/24 -o eth0 -j MASQUERADE" \
    --advertise-routes "10.10.10.0/24"

2.2 To add a user that accepts the routes,

./vpn-tool adduser --id client --accept-routes
  1. Delete user
./vpn-tool deluser --id yourname
  1. Delete user
./vpn-tool getuser --id yourname

About

simple wireguard configuration manager

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 66.9%
  • Svelte 23.8%
  • JavaScript 4.2%
  • Makefile 3.3%
  • HTML 0.9%
  • TypeScript 0.6%
  • CSS 0.3%