I'm trying to use luci-proto-wireguard to configure wireguard, following these directions, but the interface does not get created - ip and ifconfig show that no wireguard interface exists. I've tried connecting and reconnecting numerous times, but it hasn't helped. The generated stanzas in /etc/configure/network look like this:
config interface 'foo'
option proto 'wireguard'
option private_key 'private_key1'
option listen_port '51820'
list addresses '10.0.0.1/32'
config wireguard_foo
option public_key 'public_key2'
list allowed_ips '10.0.0.2'
The other endpoint is set up similarly. Feel free to change IP addresses and omit/include options to suit your requirements. Not every option is mandatory.
Thanks, but I'm still not getting the point of which mandatory configuration I'm missing. My 'config interface' is pretty much the same as yours. The key options in my 'config wireguard_foo' stanza also seem to be the same as yours. Most of the other stuff doesn't seem like it should prevent the interface from coming up, and as I've said, I've followed these instructions, by the guy who apparently wrote the OpenWRT Wireguard support, quite closely. Can you be a bit more specific about what else I need to add.?
Observe that my configuration has a CIDR mask for the allowed_ips directives (I chose /24 because I want to allow an entire subnet rather than a single host), but not for the addresses directive.
If I swap my configuration around to match yours (adding a CIDR mask to the addresses directive, and removing it from the allowed_ips directives) then the interface fails to come up.
Really dumb question time, so apologies if you've done this already: have you restarted the network stack after writing the configuration? /etc/init.d/network restart
OpenWrt 18.06.0, r7188-b0b5c64c22, on a TP-LINK Archer C2600. I had been simply restarting the interface via the Luci buttons, but I just tried via /etc/init.d and it's still not working. I probably am doing something silly, so feel free to continue with any suggestions at all.
Yay! It's working. The thing that seems to have been wrong was the inclusion of a second, stray, empty 'config wireguard_foo' stanza in /etc/config/network.
I think that it was added at some point by Luci, but it may have been something I did wrong. Now I have to go back and see which of the other things are also fragile.