-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
DHCP in initrd #63941
Comments
Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly:
|
still important to me |
still important to me |
If all you want from networkmanager is turning interfaces on or off, you can do this with nixpkgs/nixos/modules/system/boot/initrd-network.nix Lines 123 to 135 in 236eb73
and implement this yourself using |
I marked this as stale due to inactivity. → More info |
still important to me |
Just ran across this as well. It seems like NetworkManager sees the already-existing connection left over from the initrd and creates a "Manual" entry for it that loses its DNS configuration. |
I used these options (without
Then |
Issue description
I'm having issues to get dhcp address into the initrd and still have network manager work properly. The reason is I have a native root encrypted zfs notebook that I'd like to reboot remotely. So since the notebook is sometimes at home, sometimes at the office (with different subnets) I need to use dhcp in the initrd, otherwise I can't login remotely.
Steps to reproduce
Add:
networking.useDHCP
to your configuration.nix and enable it. It will provide you with dynamic ip address in the initrd. However, useDHCP and
networking.networkmanager.enable = true;
don't mix so networkmanager has to be disabled. The problem with this approach is that once the system is fully booted (into KDE), there's no network manager available to easily turn on/off eth0, wifi0 etc......Another option I tried is to add
boot.kernelParams = [ "ip=dhcp" ];
to the configuration.nix. This works with some caveats: Suddenly my resolv.conf only had as single entry
options edns0
and wasn't able to resolve anything. I had to manually add nameserver x.x.x.x. A little solution was to use SystemD Resolved:That worked with some minor caveats. However the main problem with using
boot.kernelParams = [ "ip=dhcp" ];
was that I just stopped the initrd bootup process waiting to obtain an ip address.So, how can I get simple dhcp obtained ip in the initrd while still being able to use network manager later on?
Technical details
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste theresults.
The text was updated successfully, but these errors were encountered: