WireGuard / wireguard-vyatta-ubnt

WireGuard for Ubiquiti Devices
https://www.wireguard.com/
GNU General Public License v3.0
1.46k stars 68 forks source link

Commit fails when trying to delete allowed-ips? #65

Closed iandees closed 3 years ago

iandees commented 3 years ago

I was trying to follow the readme instructions to get my system running with two peers. I typo'd the allowed-ips for my peers, so I ended up with this:

ubnt@ubnt# show interfaces wireguard wg0
 listen-port 51820
 peer 7Q+NVKjkbShtcw1kUpP63+qf1Wm2JxpX8FbNKr+pvHQ= {
     allowed-ips 192.168.3.3/24
     allowed-ips 192.168.33.3/24
     allowed-ips 192.168.33.3/32
 }
 peer YTfDftJNsBAmRZQ11xpGaI8DEMC6GsuBYmXGfeZVmQM= {
     allowed-ips 192.168.33.2/24
     allowed-ips 192.168.33.2/32
 }
 private-key /config/auth/wg.key
 route-allowed-ips true
[edit]

When I try to remove those allowed-ips, committing fails:

ubnt@ubnt# delete interfaces wireguard wg0 peer 7Q+NVKjkbShtcw1kUpP63+qf1Wm2JxpX8FbNKr+pvHQ= allowed-ips 192.168.3.3/24
[edit]
ubnt@ubnt# commit
Commit failed
[edit]

I've tried removing single IPs at a time like this all the way to removing the whole wireguard config section. All fail.

Any ideas for what might be going on here?

iandees commented 3 years ago

This is on an EdgeRouter PoE with EdgeOS v2.0.1 installed and Wireguard installed from e100-v2-v1.0.20201221-v1.0.20200827.deb.

stoffeastrom commented 3 years ago

Try setting route allowed-ips false first e.g

set interfaces wireguard wg0 route-allowed-ips false
iandees commented 3 years ago

Thanks, that seems to have helped:

ubnt@ubnt:~$ configure
[edit]
ubnt@ubnt# set interfaces wireguard wg0 route-allowed-ips false
[edit]
ubnt@ubnt# commit
[edit]
ubnt@ubnt# delete interfaces wireguard wg0 peer 7Q+NVKjkbShtcw1kUpP63+qf1Wm2JxpX8FbNKr+pvHQ= allowed-ips 192.168.3.3/24
[edit]
ubnt@ubnt# commit
[ interfaces wireguard wg0 peer 7Q+NVKjkbShtcw1kUpP63+qf1Wm2JxpX8FbNKr+pvHQ= ]
Warning: AllowedIP has nonzero host part: 192.168.33.3/24

[edit]