boringtun icon indicating copy to clipboard operation
boringtun copied to clipboard

Set configuration file

Open max-frai opened this issue 3 years ago • 1 comments

Hello, is it possible with boringtun core library to set configuration? My main goal is just to use vpn connection file and setup vpn connection in system with this library. So I have config file with keys, servers from my vpn provider. It looks like:

[Interface]
# NetShield = 0
# Moderate NAT = off
# VPN Accelerator = on
PrivateKey = PRIVATE KEY HERE
Address = SERVER ADDRESS/32
DNS = SERVER ADDRESS

[Peer]
PublicKey = PUBLIC KEY HERE
AllowedIPs = 0.0.0.0/0
Endpoint = SERVER ADDRESS:51820

How can I "apply" it to created tunnel? So I did the same logic as cli and check with wg show:

interface: utun42
  listening port: 58873

With wg-quick I can put config file into /etc/wireguard/test.conf and run it: wg-quick up test. And it creates vpn connection and works okay. Can I do the same with only this library? Or I should apply this config file on created tunnel with some other tool?

max-frai avatar Sep 21 '22 18:09 max-frai

If you are trying to do this with just the library, you will need to parse the file and instantiate the various objects yourself with the configuration parameters from the parsed file.

Noah-Kennedy avatar Sep 26 '22 17:09 Noah-Kennedy