Guest User

server.conf

a guest
Aug 16th, 2016
43
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $ cat /etc/systemd/system/wireguard.service
  2.  
  3. [Unit]
  4. Description=WireGuard Server
  5.  
  6. [Service]
  7. Type=oneshot
  8. RemainAfterExit=yes
  9. ExecStart=/bin/ip link add dev wg0 type wireguard
  10. ExecStart=/bin/ip address add fc00::10/7 dev wg0
  11. ExecStart=/usr/bin/wg setconf wg0 /etc/wireguard/server.conf
  12. ExecStart=/bin/ip link set up dev wg0
  13. ExecStop=/bin/ip link del dev wg0
  14.  
  15. [Install]
  16. WantedBy=multi-user.target
  17.  
  18.  
  19.  
  20. $ cat /etc/wireguard/server.conf
  21.  
  22. [Interface]
  23. PrivateKey = 4IQ6ra***BloF0E=
  24. ListenPort = 40111
  25.  
  26. [Peer]
  27. PublicKey = vWjIpwbIZD***4gR2zQE=
  28. AllowedIPs = fc00::20/7
  29.  
  30.  
  31.  
  32. $ ip a
  33.  
  34. 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
  35. link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  36. inet 127.0.0.1/8 scope host lo
  37. valid_lft forever preferred_lft forever
  38. inet6 ::1/128 scope host
  39. valid_lft forever preferred_lft forever
  40. 2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
  41. link/ether 00:50:56:00:7b:1e brd ff:ff:ff:ff:ff:ff
  42. inet 5.9.***.**7/24 brd 5.9.***.255 scope global ens3
  43. valid_lft forever preferred_lft forever
  44. inet6 2a01:4f8:***:***::5/64 scope global
  45. valid_lft forever preferred_lft forever
  46. inet6 fe80::25**:****:**00:7b1e/64 scope link
  47. valid_lft forever preferred_lft forever
  48. 39: wg0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1423 qdisc noqueue state UNKNOWN group default qlen 1
  49. link/none
  50. inet6 fc00::10/7 scope global
  51. valid_lft forever preferred_lft forever
  52. inet6 fe80::57**:****:**d7:e44b/64 scope link flags 800
  53. valid_lft forever preferred_lft forever
  54.  
  55.  
  56.  
  57. $ ip route
  58.  
  59. default via 5.9.***.**3 dev ens3
  60. 5.9.***.0/24 dev ens3 proto kernel scope link src 5.9.***.**7
RAW Paste Data