According to RFC3021 (https://tools.ietf.org/html/rfc3021) it is good to use /31 networks on point-to-point links in order to save address space. I wanted to reduce the amount of address space I need and crossed this issue that this unfortunately does not work on WireGuard interfaces.
CLI
vyos@vyos# set interfaces wireguard wg01 address 192.168.151.208/31 Invalid value Value validation failed Set failed [edit] vyos@vyos# set interfaces wireguard wg01 address 192.168.151.210/31 Invalid value Value validation failed Set failed
Assigning 192.168.151.209/31 works. There is no issue when working on ethernet interfaces, all /31 addresses are accepted.
ipaddrcheck
root@vyos:/home/cpo# /usr/bin/ipaddrcheck --is-valid 192.168.151.209/31 root@vyos:/home/cpo# echo $? 0 root@vyos:/home/cpo# /usr/bin/ipaddrcheck --is-valid 192.168.151.210/31 root@vyos:/home/cpo# echo $? 0 root@vyos:/home/cpo# /usr/bin/ipaddrcheck --is-valid 192.168.151.211/31 root@vyos:/home/cpo# echo $?
Completion Helper
Also the completion helper displays something unusual when comparing to ethernet interfaces (removed DHCP as this is of no relevance for this case)
Ethernet
[email protected]# set interfaces ethernet eth0 address Possible completions: <x.x.x.x/x> IP address and prefix length <h:h:h:h:h:h:h:h/x> IPv6 address and prefix length
Wireguard
vyos@vyos# set interfaces wireguard wg01 address Possible completions: ipv4-address IPv4 address and prefix length <h:h:h:h:h:h:h:h/x> IPv6 address and prefix length
It states ipv4-address instead of <x.x.x.x/x>