Page MenuHomePhabricator

config issue when creating multiple wg interfaces at the same time.
Closed, ResolvedPublicBUG

Description

set interfaces wireguard wg0 address '10.1.1.1/32'
set interfaces wireguard wg0 peer rt-2 allowed-ips '0.0.0.0/0'
set interfaces wireguard wg0 peer rt-2 endpoint '127.0.0.1:1111'
set interfaces wireguard wg0 peer rt-2 pubkey 'QwY01u5Vfoh/haCAgBx0R1k/eOgzYM0kAgHdW4MSulk='

set interfaces wireguard wg1 address '10.2.1.1/32'
set interfaces wireguard wg1 peer rt-1 allowed-ips '0.0.0.0/0'
set interfaces wireguard wg1 peer rt-1 endpoint '127.0.0.1:1112'
set interfaces wireguard wg1 peer rt-1 pubkey 'AwY01u5Vfoh/haCAgBx0R1k/eOgzYM0kAgHdW4MSulk='

commit

causes:
[ interfaces wireguard wg1 ]
Can't set IP 10.2.1.1/32 on wg1

[[interfaces wireguard wg1]] failed
Commit failed

If the config is being entered per interface, no issues.

Details

Difficulty level
Unknown (require assessment)
Version
rc4
Why the issue appeared?
Will be filled on close
hagbard created this task.Tue, Oct 30, 4:09 PM
hagbard claimed this task.
syncer triaged this task as Normal priority.
hagbard added a subscriber: runar.Tue, Oct 30, 4:24 PM

All right, node.tag gets called twice. In the first round both interfaces are being configured correctly, then the parser calls it again (node.tag) and of course the IP already exists, so the error is valid from a script perspective.
Related to the issue @runar reported: https://phabricator.vyos.net/T786.

runar added a comment.Tue, Oct 30, 5:15 PM

This is exactly the same issue i reported in T786, for every interface thats created the script runs its full processing.. when 10 interfaces are created it tries to execute it 10 times and so on. I have purposed a fix for this behaveor in T786 and there is a PR (https://github.com/vyos/vyos-1x/pull/33) on this. Another thing that could be done to fix this is to fix the underlaying vbash code that makes this happen, but i think that is a larger task.