Two WireGuard Interfaces with same key?

Can I use the same key on multiple interfaces?
For example:

interface: wg_51821
  public key: PUB_KEY1
  private key: (hidden)
  listening port: 51821

peer: PEER_KEY2
  endpoint: [ip2]:51820
  allowed ips:, ::/0
  latest handshake: 1 minute, 59 seconds ago
  transfer: 101.07 GiB received, 27.30 GiB sent

interface: wg_51820
  public key: PUB_KEY1
  private key: (hidden)
  listening port: 51820

peer: PEER_KEY1
  endpoint: [ip1]:51820
  allowed ips:, ::/0
  latest handshake: 49 seconds ago
  transfer: 13.66 MiB received, 11.16 MiB sent

I experience weird behavior. I am unsure where to start.

Why not try another key for your second interface and see if the weird behaviour disappears? :stuck_out_tongue: You'll be quick to know :slight_smile:

1 Like

It helped but I don't know if it was the reason for the weird behavior or if it just masked just the underlying issue. Sometimes no connection was established, or daemons operating on the interface went crazy. That is why I asked for help. :slight_smile:

OK. Wasn't sure you already ruled it out...

I wouldn't suggest this, but it might work (given the right situations)

What is the purpose of your multiple WG interfaces? You can have multiple peers connecting to the same interface if that is what you are trying to achieve. And if that is the case, you don't need to have multiple interfaces defined, which means you have just one key.

While we're at it, what is the purpose of this WG config in general? Is this a "road warrior" type setup (i.e. connect back to this device from some remote location), or is this an outbound connection (for example, setting up a tunnel for all of the traffic at this location -- often useful for connecting to commercial VPNs), or a site-to-site VPN?

Can you describe the specifics of the behavior?

Also, are both of the peers connecting simultaneously? Or is it just one at a time?

1 Like