Skip to content

[th/nmcli-import-wg-dnssearch] nmcli: fix import WireGuard profile with DNS domain and address family disabled

Thomas Haller requested to merge th/nmcli-import-wg-dnssearch into main

In NetworkManager, a profile cannot have "ipvx.dns" or "ipvx.dns-search" while the corresponding IP method is disabled. Together with the oddity that in NetworkManager DNS settings are separate per IPv4 and IPv6, this causes problems:

  $ cat wg0.conf
  PrivateKey = CBXpiLxQ98TLISJ2cypEFtQb/djzYzENyy0jzhWa/UA=
  Address =
  DNS =,

  PublicKey = Wus1sBzZiQkyxr6ZitUFNvfYD7KJkwTsWlcxvJ/4SHI=
  Endpoint =
  AllowedIPs =

  $ nmcli connection import type wireguard file wg0.conf
  Error: failed to import 'wg0.conf': Failed to create WireGuard connection: ipv6.dns-search: this property is not allowed for 'method=disabled'.

#832 (closed)

Merge request reports