Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add static DNS server migration #34

Closed
jcronenberg opened this issue Nov 20, 2023 · 4 comments · Fixed by #76
Closed

Add static DNS server migration #34

jcronenberg opened this issue Nov 20, 2023 · 4 comments · Fixed by #76
Assignees
Labels
enhancement New feature or request migration Something needs to be changed/implemented in the wicked migration

Comments

@jcronenberg
Copy link
Owner

Previous discussion revealed that probably a full migration isn't possible (e.g. NETCONFIG_DNS_POLICY="STATIC_FALLBACK" isn't possible with NetworkManager).
But e.g. NETCONFIG_DNS_STATIC_SERVERS should be migrated.

@jcronenberg jcronenberg added enhancement New feature or request migration Something needs to be changed/implemented in the wicked migration labels Nov 20, 2023
@jcronenberg
Copy link
Owner Author

As for the implementation, AFAICT Netconfig isn't represented inside wicked show-config, so we'll need to implement a way to read /etc/sysconfig/config via e.g. https://github.com/dotenv-rs/dotenv

@jcronenberg jcronenberg added this to the YaST2 lan parity milestone Jan 9, 2024
@jcronenberg jcronenberg changed the title Add basic Netconfig migration Add static DNS server migration Jan 9, 2024
@jcronenberg
Copy link
Owner Author

The way I see it there are basically 2 possibilities to 'imitate' the netconfig behavior for NM.
A global DNS server configuration or adding the DNS servers to every connection in the ipv*.dns property.
Here's what I think some of the advantages and disadvantages for these are:

Global DNS

Pros:

  • The closest to the netconfig behavior
  • Maps better to what is actually written in /etc/resolv.conf
  • IMO better for servers where a lot of connections are more common and changing them globally simultaneously is more important

Cons:

  • Requires a configuration file either in /etc/NetworkManager/conf.d or /var/lib/NetworkManager/NetworkManager-intern.conf
  • Due to configuration file changes on a running system this requires a NM restart to take effect
  • This setting isn't accessible by nmcli only via DBUS

Setting DNS for every connection

Pros:

  • IMO seems to be the NM 'way' at least from what I read online, so what users may be used to.
  • IMO better for clients/simple setups where single connections are more common and changing quickly via nmcli is more important

Cons:

  • Tedious to change DNS servers for all connections
  • If single connections are changed it is not transparent what gets actually written to /etc/resolv.conf. It seems NM chooses DNS servers based on some priority setting, which we won't set for the migration. So when a single connection is changed I personally don't know what actually happens.

For #75 I chose the global DNS config approach because I personally think it's the better option but changing it to the other approach can be done relatively quickly, so it's no problem if we choose differently in the end.

@cfconrad
Copy link
Collaborator

cfconrad commented Mar 6, 2024

Due to configuration file changes on a running system this requires a NM restart to take effect

It looks like there is a way to reread only the dns-configuration https://gitlab.freedesktop.org/NetworkManager/NetworkManager/blob/main/src/nmcli/general.c#L350

@cfconrad
Copy link
Collaborator

cfconrad commented Mar 6, 2024

This enum somehow explain quite good what NetworkManager does: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/blob/main/src/core/dns/nm-dns-manager.h#L101

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request migration Something needs to be changed/implemented in the wicked migration
Projects
None yet
2 participants