-
Notifications
You must be signed in to change notification settings - Fork 57
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
netmasks are interpreted wrongly #3
Comments
Unfortunately, you've removed some useful information from your snippet. The The script, here, mentions this example data:
Will you share the relevant prefix length in your |
@jeaye That prefix length is for the anchor address, not for the main address. The anchor address is only for floating IPs, not for the primary address. The netmask listed with the address is (surprise!) the actual netmask of the address. |
It seems |
@nathan7 Would you mind sharing your solution? I'm open to improving this and it seems like you have more experience in this area than me. |
@jeaye https://code.nathan7.eu/nathan7/systemd-digitalocean This is my solution, which currently runs on several of my servers (I converted them to pure NixOS after using nixos-in-place — so many thanks for that!) |
@nathan7 We're already using a small Go program for the
What sort of hardware configuration are you referring to here? |
@cstrahan Cool, though I'm not sure sticking Go source in the nixpkgs tree like with
https://code.nathan7.eu/nathan7/colossus.nathan7.eu/src/f22d35d7458cf088ed25ee08c30611c19f783b32/digitalocean/default.nix, analogous to |
I installed NixOS on a Digital Ocean droplet. I started with a Debian 64-bit base. After installing, I couldn't get my machine to see the internet. It looks to me like my static IPv4 address isn't getting set correctly. As a note, I enabled IPv6 on this droplet. Is this the same issue? Here's what I have running the same commands: |
The issue here is that the existing setup-network script is simply not robust enough to handle anything but the most trivial cases. It doesn't handle ipv6 currently either. The primary reason for this is my lack of knowledge in this area; it'd be nice to get some more eyes on it and develop some improvements. Ideally, we stick to bash and not Go, Rust, C, or anything of the sort. |
Thank you. I'm not very familiar with this area either, but I think a bash solution would be ideal here as well. |
Is there a reason why we're not converting the network settings to a nix expression in the NixOS configuration? Maybe we could generate something like the following when we build {
networking = {
usePredictableInterfaceNames = false; # Use eth0, eth1, etc
interfaces = {
eth0.ip4 = [{
address = "162.243.123.70";
prefixLength = 24;
}];
defaultGateway = "162.243.123.1";
};
};
} The snippet is missing Ipv6 settings, but this is just to give you an idea. |
@jeaye If you're hoping to do netmask manipulation from bash, I applaud your bravery, but that's probably where I split off and aim for the practical instead. |
@nathan7 How did you convert to pure NixOS? |
@KibaFox Deleted everything belonging to the original OS, rebuilt without the nixos-in-place extras, copied the Nix store from /nixos/nix to /nix (with rsync), and rebooted. Some care required. |
@nathan7 Thanks! Do you know if there is anything wrong with setting the networking configuration as part of the NixOS configuration (in Is there a reason we're parsing |
@KibaFox DO used to write to it as the primary way of configuring the network, but none of the current images make use of that — you're expected to get this information from the link-local metadata service. |
I see. Thank you for explaining that for me, @nathan7. |
@nathan7 Are you still working on (I don't appear to be able to open issues at code.nathan7.eu, sorry for hijacking this issue a bit) |
@rimmington I'm still using it, and intend to keep doing so — I don't really expect upstreaming it into NixOS to be all that much fun to bikeshed over, so I've been holding off on that. |
When
/etc/network/interfaces
specifies a /18, the network setup script interprets it as being a /16:The text was updated successfully, but these errors were encountered: