Wireguard missing on Edgerouter Pro after reboot

My team took over an account with an existing install with an EdgeRouter Pro router. Someone previously set up Wireguard on it via CLI and with some help from people online we were able to manage it. Really all we’ve done in the last 2 years is add a user every couple of months. Yesterday the battery backup was swapped but now Wireguard isn’t running anymore.

administrator@r01:/$ show interfaces
Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down
Interface IP Address S/L Description


eth0 ext.net.wan.ip/CIDR u/u Internet
eth1 10.10.0.1/24 u/u Network
eth1.102 10.10.2.1/24 u/u Servers
eth1.104 10.10.4.1/23 u/u Wired
eth1.106 10.10.6.1/23 u/u Wireless
eth1.108 10.10.8.1/23 u/u Wireless Guest Network
eth1.110 10.10.10.1/24 u/u Voice
eth2 - A/D
eth3 - A/D
eth4 - A/D
eth5 - A/D
eth6 - A/D
eth7 - A/D
lo 127.0.0.1/8 u/u
::1/128

The wg0 interface is missing.

administrator@r01:/config$ show interfaces wireguard
Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down
Interface IP Address S/L Description

administrator@r01:/config$

But it doesn’t fail on query. There’s just no results.

I’ve found what I believe to be the keys in /config/auth/

Maybe a service isn’t started? Where do I begin looking to fix this?
Thanks for any help you can give.

Maybe someone can advise you
but my recommendation is to create a post at https://community.ui.com/
more people with edgeos there

VyOS is a fork of vyatta. This really isn’t the place for edgerouter support, but I happen to have some knowledge.

Can you verify that your Edgerouter Pro has wireguard installed by running wg version?

If it is, you should just need to run set interfaces wireguard wg0 private-key <key> and rebuild the rest of config. It’s strange that a power outage got rid of the configuration unless it wasn’t saved to the disk.

Also while at it take your time to update the firmware to latest available since there have been some CVE’s the past years for the EdgeOS (as with most vendors).

I asked here because in my searching I found some discussions on this forum where there was good information from others asking about Wireguard on EdgeOS.

Here are some more CLI responses.

administrator@r01:/$ sudo wg version
Invalid subcommand: `version'
Usage: wg <cmd> [<args>]

Available subcommands:
  show: Shows the current configuration and device information
  showconf: Shows the current configuration of a given WireGuard interface, for use with `setconf'
  set: Change the current configuration, add peers, remove peers, or change peers
  setconf: Applies a configuration file to a WireGuard interface
  addconf: Appends a configuration file to a WireGuard interface
  genkey: Generates a new private key and writes it to stdout
  genpsk: Generates a new preshared key and writes it to stdout
  pubkey: Reads a private key from stdin and writes a public key to stdout
You may pass `--help' to any of these subcommands to view usage.
administrator@r01:/$
administrator@r01:/$
administrator@r01:/$ wg version
Invalid subcommand: `version'
Usage: wg <cmd> [<args>]

Available subcommands:
  show: Shows the current configuration and device information
  showconf: Shows the current configuration of a given WireGuard interface, for use with `setconf'
  set: Change the current configuration, add peers, remove peers, or change peers
  setconf: Applies a configuration file to a WireGuard interface
  addconf: Appends a configuration file to a WireGuard interface
  genkey: Generates a new private key and writes it to stdout
  genpsk: Generates a new preshared key and writes it to stdout
  pubkey: Reads a private key from stdin and writes a public key to stdout
You may pass `--help' to any of these subcommands to view usage.
administrator@r01:/$ wg show
administrator@r01:/$ wg showconf
Usage: wg showconf <interface>
administrator@r01:/$ wg showconf wg0
Unable to access interface: Operation not permitted
administrator@r01:/$ sudo wg showconf wg0
Unable to access interface: No such device
administrator@r01:/$

As suggested - replacing the battery probably erased some NVRAM stuff so you need to redo the config and the private-keys etc being used.

It can also be a case that you first must factory reset the device (since you replaced the battery) to make it properly reformat all partitions and then reread the config from backup along with punshing in the private-keys etc to be used.

Similar to how replacing the battery on a regular PC motherboard will need you to first reset the bios then load the “optimize bios-settings” and finally put in your custom changes and then save and reboot the device to have it restored to the state it were before the battery got replaced.