How to import wireguard config from CLI?

I got lost in the source code of luci-proto-wireguard -- can't figure out how does the config import work, more importantly how can I import the wireguard config file into an existing wg interface from CLI.

Any ideas?

If you have created a WG interface you have on the General Settings tab the option to:
Load configuration
That is what you do e.g. with a conf file from your VPN provider.

If you already have made a WG setup and you want to add a peer to an existing setup than on the Peers tab you can Import configuration as peer
I have never used it so do not know what it does.

(I usually do the opposite and export a configuration (this works not entirely as expected some information is missing, but we have been told that that is by design as it was not intended for this use))

from CLI :wink:

1 Like

What does an exported config file look like? You would need to parse that into UCI commands to load the config as a proto wireguard interface in the network config. There is no "import" script outside of Luci.

1 Like

That's what I was afraid of. :frowning: