Page MenuHomeVyOS Platform

WireGuard: Unable to assign /31 addresses to interface
Closed, DuplicatePublicBUG

Description

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>

Details

Difficulty level
Normal (likely a few hours)
Version
1.2.2
Why the issue appeared?
Will be filled on close

Event Timeline

c-po renamed this task from Can not assign /31 network to wireguard interface to WireGuard: Unable to assign /31 addresses to interface.Jul 22 2019, 8:14 PM
c-po assigned this task to hagbard.
c-po triaged this task as Normal priority.
c-po created this task.
c-po updated the task description. (Show Details)
c-po updated the task description. (Show Details)