Wireguard: Interface does not have a public key!

Hi,
Im trying to run a Wireguard VPN on my Router to connect to my LAN remotely. I followed the instructions in the wiki and generated a privatekey and entered it in LuCi. But Wire-Guard Status shows:
Interface does not have a public key!

I also had DNS Rebind Protection on as in this thread. But disabling it didnt help

System Log shows:

Fri May 24 17:05:58 2019 daemon.notice netifd: Interface 'Wireguard' is setting up now
Fri May 24 17:05:58 2019 daemon.notice netifd: Wireguard (16286): Line unrecognized: `PublicKey='
Fri May 24 17:05:58 2019 daemon.notice netifd: Wireguard (16286): Configuration parsing error
Fri May 24 17:06:04 2019 daemon.notice netifd: Interface 'Wireguard' is now down
Fri May 24 17:06:04 2019 daemon.notice netifd: Interface 'Wireguard' is setting up now

I'd be glad for any help you can offer me.

  • I'm not sure how that posting of mine was fully-instructive for you in the setup of a WG interface
  • Not sure why you believed DNS Rebind was an issue in your setup
  • I would suggest showing how you claimed to have generated the key for the interface, and your configs for the same

I think the issue is here the PublicKey line. To be sure, I'd have to see your /etc/config/network file, but the syntax is probably incorrect. It should look like this:

option public_key 'XXXXXXXXXXXXXXXX='

It that doesn't fix it, post your network file (obscure the keys and any other sensitive information, of course).

Sorry I dont understand your post. To be honest I didnt really understand what dns rebind protection is.
I followed this wiki article that said to only generate the privatekey and then paste it into LuCi and LuCi would then gernerate the publickey. https://openwrt.org/docs/guide-user/services/vpn/wireguard

This is my /etc/config/network It also includes an old setup that I deleted in LuCi. Im not sure why.

root@OpenWrt:~# cat /etc/config/network 

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'xxxxxx'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth0.1'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config interface 'wan'
        option ifname 'eth0.2'
        option proto 'dhcp'

config interface 'wan6'
        option ifname 'eth0.2'
        option proto 'dhcpv6'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '2 3 4 5 0t'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '1 0t'

config wireguard_HomeVPN
        list allowed_ips '0.0.0.0'
        option public_key 'xxxxxx'

config wireguard_HomeVPN

config interface 'vpnserver'
        option ifname 'tun0'
        option proto 'none'

config interface 'Wireguard'
        option proto 'wireguard'
        option private_key 'xxxxxx'
        option listen_port '51820'

config wireguard_Wireguard
        list allowed_ips '192.168.1.123'
        option route_allowed_ips '1'
        option endpoint_port '51820'

Not quite helpful, as you config has a X'ed out key.

Since you have a key present, you should have no problem.

Otherwise, I would advise you're placing public and public keys in the proper places.

The option with the public key is a different old interface that i deleted. but somehow its still present in the config file.
Can I just generate a public key on the cli and copy it there in the file?

Then delete it.

That's what the instructions tell you to do; but for your interface, you put in the Private Key.