about summary refs log tree commit diff
path: root/nixos/modules/tasks/network-interfaces-scripted.nix
Commit message (Collapse)AuthorAge
* nixos/scripted-networking: use udev to configure link MACAddress and MTUBytesFlorian Klink2020-05-22
| | | | | | | | | | | | | | | | | | | | | | | | | The `network-link-${i.name}` units raced with other things trying to configure the interface, or ran before the interface was available. Instead of running our own set of shell scripts on boot, and hoping they're executed at the right time, we can make use of udev to configure the interface *while they appear*, by providing `.link` files in /etc/systemd/network/*.link to set MACAddress and MTUBytes. This doesn't require networkd to be enabled, and is populated properly on non-networkd systems since https://github.com/NixOS/nixpkgs/pull/82941. This continues clean-up work done in https://github.com/NixOS/nixpkgs/pull/85170 for the scripted networking stack. The only leftover part of the `network-link-${i.name}` unit (bringing the interface up) is moved to the beginning of the `network-addresses-${i.name}` unit. Fixes: https://github.com/NixOS/nixpkgs/issues/74471 Closes: https://github.com/NixOS/nixpkgs/pull/87116
* nixos/network-interfaces-scripted: always run systemctl of the currently ↵Florian Klink2020-05-21
| | | | running systemd
* nixos/networking: move network-link-${i.name} to scripted networkingFlorian Klink2020-04-13
| | | | | The unit sets MTU and MAC Address even with networkd enabled, which isn't necessary anymore, as networkd handles this by itself.
* nixos/scripted-networking: fix bridge setup when libvirtd uses socket activationvolth2020-03-15
|
* openvswitch: better integration with systemdNetix (Espinet François)2019-12-15
| | | | | | | | | | | | | | | | | | | | | | Systemd dependencies for scripted mode were refactored according to analysis in #34586. networking.vswitches can now be used with systemd-networkd, although they are not supported by the daemon, a nixos receipe creates the switch and attached required interfaces (just like the scripted version). Vlans and internal interfaces are implemented following the template format i.e. each interface is described using an attributeSet (vlan and type at the moment). If vlan is present, then interface is added to the vswitch with given tag (access mode). Type internal enabled vswitch to create interfaces (see openvswitch docs). Added configuration for configuring supported openFlow version on the vswitch This commit is a split from the original PR #35127.
* treewide: remove redundant quotesvolth2019-08-26
|
* resolvconf service: initNikolay Amiantov2019-07-15
| | | | | | | | | | | | | This is a refactor of how resolvconf is managed on NixOS. We split it into a separate service which is enabled internally depending on whether we want /etc/resolv.conf to be managed by it. Various services now take advantage of those configuration options. We also now use systemd instead of activation scripts to update resolv.conf. NetworkManager now uses the right option for rc-manager DNS automatically, so the configuration option shouldn't be exposed.
* network-scripting: do not run resolvconf if /etc/resolv.conf is managed ↵volth2019-03-09
| | | | | manually (#56682) The second invocation of resolvconf, missed in https://github.com/NixOS/nixpkgs/pull/32308
* nixos/network-interfaces-scripted: fix container networking bugUli Baum2018-09-23
| | | | | | | | | | | | | When a bridge interface was reconfigured, running containers using this bridge lost connectivity: restarting network-addresses-brN.service triggered a restart of network-setup.service via a "partOf" relationship introduced in 07e0c0e0a2f237639600f2a0d62f6eac748b1e6e. This in turn restarted brN-netdev.service. The bridge was thus destroyed and recreated with the same name but a new interface id, causing attached veth interfaces to lose their connection. This change removes the "partOf" relationship between network-setup.service and network-addresses-brN.service for all bridges.
* fix commentFranz Pletz2018-08-13
|
* add comment for issue #28620Youfu Zhang2018-08-10
|
* fix vlan interface bring up on bootYoufu Zhang2018-08-02
| | | | | when the parent interface of a vlan interface is not up (yet), ip link cannot bring the vlan interface up the vlan interface will be automatically brought up when the parent interface is up later fix NixOS/nixpkgs#28620
* [bot]: remove unreferenced codevolth2018-07-20
|
* networking.routes: static routes are proto staticRobin Gloster2018-05-22
|
* Merge pull request #38094 from volth/patch-120Matthew Justin Bauer2018-04-08
|\ | | | | nixos/network-scripted: print error details
| * nixos/network-scripted: print error detailsvolth2018-03-30
| |
* | network-interfaces-scripted: wlanInterfaces have .device, no ↵volth2018-04-03
|/ | | | "${dev}-netdev.service"
* Merge pull request #27678 from ↵Frederik Rietdijk2018-03-05
|\ | | | | | | | | volth/restore-bridge-slaves-dynamically-added-by-libvirt nixos/networking-scripted: restore bridge slaves dynamically added by…
| * add separator in case if a VM connected to more than 1 bridgeVolth2017-08-21
| |
| * support lxc:/// and ignore weird bridges (like openvswitch)Volth2017-08-01
| |
| * nixos/networking-scripted: restore bridge slaves dynamically added by libvirtVolth2017-07-27
| |
* | Merge pull request #35141 from abbradar/dhcpcd-orderFranz Pletz2018-02-20
|\ \ | | | | | | dhcpcd service: fix service dependencies when default gateways are set
| * | network-interfaces-scripted service: delay setup if IPv6 is disabledNikolay Amiantov2018-02-19
| | | | | | | | | | | | Even if IPv6 gateway is set, there's no need to set it early if IPv6 is disabled.
* | | nixos/networking-interfaces: rename IP addresses/routes optionsrnhmjoj2018-02-17
| | |
* | | nixos/tests: add test for static routesrnhmjoj2018-02-17
| | |
* | | nixos/networking-interfaces: make static routes configurablernhmjoj2018-02-17
|/ /
* | nixos/networking-interfaces: set default value for virtualTypernhmjoj2018-01-31
| |
* | network-interfaces-scripted: fix NixOS/nixops#640Bas van Dijk2017-10-30
| | | | | | | | | | | | | | Reverse the PartOf dependency between network-setup and network-addresses-* This was joint work of: @nh2, @domenkozar, @fpletz, @aszlig and @basvandijk at the NixCon 2017 hackathon.
* | network-interfaces: device routes for default gatewayFranz Pletz2017-09-28
| | | | | | | | Iff interface is set, it makes sense to add device route by default.
* | nixos/network-interfaces: ensure slave interfaces are upFranz Pletz2017-09-25
| | | | | | | | Fixes #28620.
* | nixos/network-interfaces: cannot delay device unitsFranz Pletz2017-09-25
| | | | | | | | | | | | | | Systemd is complaining that it can't delay the startup of device units. We have a before dependency on the respective device unit for every netdev service, which doesn't make any sense because we create the actual interface in this service.
* | nixos/network-interfaces: IPs must always be setFranz Pletz2017-09-25
| | | | | | | | | | | | | | | | | | | | | | | | Previously, depending on the environment and the type of interface that was created, the configured IPs of an interface wouldn't be applied on a nixos-rebuild switch. It works after a reboot. This patch ensures that the network-addresses service is started either via the network-link service or if the networking target is activated (i.e. on system activation). Fixes #28474 #16230.
* | Revert "nixos: add option for bind to not resolve local queries (#29503)"Peter Simons2017-09-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 670b4e29adc16e0a29aa5b4c126703dcca56aeb6. The change added in this commit was controversial when it was originally suggested in https://github.com/NixOS/nixpkgs/pull/29205. Then that PR was closed and a new one opened, https://github.com/NixOS/nixpkgs/pull/29503, effectively circumventing the review process. I don't agree with this modification. Adding an option 'resolveLocalQueries' to tell the locally running name server that it should resolve local DNS queries feels outright nuts. I agree that the current state is unsatisfactory and that it should be improved, but this is not the right way. (cherry picked from commit 23a021d12e8f939cd0bfddb1c7adeb125028c1e3)
* | nixos: add option for bind to not resolve local queries (#29503)gwitmond2017-09-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the user specifies the networking.nameservers setting in the configuration file, it must take precedence over automatically derived settings. The culprit was services.bind that made the resolver set to 127.0.0.1 and ignore the nameserver setting. This patch adds a flag to services.bind to override the nameserver to localhost. It defaults to true. Setting this to false prevents the service.bind and dnsmasq.resolveLocalQueries settings from overriding the users' settings. Also, when the user specifies a domain to search, it must be set in the resolver configuration, even if the user does not specify any nameservers. (cherry picked from commit 670b4e29adc16e0a29aa5b4c126703dcca56aeb6) This commit was accidentally merged to 17.09 but was intended for master. This is the cherry-pick to master.
* | nixos/networking: network is online if default gw setFranz Pletz2017-09-18
| | | | | | | | | | | | | | | | | | | | Previously services depending on network-online.target would wait until dhcpcd times out if it was enabled and a static network address configuration was used. Setting the default gateway statically is enough for the networking to be considered online. This also adjusts the relevant networking tests to wait for network-online.target instead of just network.target.
* | network-interfaces-scripted: don't add 'lo' as device dependencyJörg Thalheim2017-08-30
|/ | | | | systemd does not create device units for loopback devices, since they are not physical.
* network-interfaces-scripted: Add static parameter for default gatewayMarkus Mueller2017-04-16
|
* network-link-*.service: Set stopIfChanged = falseEelco Dolstra2017-04-04
| | | | | | | | | | | | This reduces the time window during which IP addresses are gone during switch-to-configuration. A complication is that with stopIfChanged = true, preStop would try to delete the *new* IP addresses rather than the old one (since the preStop script now runs after the switch to the new configuration). So we now record the actually configured addresses in /run/nixos/network/addresses/<interface>. This is more robust in any case. Issue https://github.com/NixOS/nixops/issues/640.
* network-interfaces: reload bridges on conf changesArnold Krille2017-03-26
| | | | | | | | | | | And adopt the tests to add an interface and remove it again. It should work when deactivating rstp, it will not work when activating rstp for the first bridge as then the userspace daemon is not yet available. But once one bridge is active with stp, it should work with the reload for any further bridge. Fixes #21745. Also see #22547.
* nixos: network-interfaces-scripted: don't require mstpd when rstp is offJan Malakhovski2017-03-05
|
* Merge pull request #22727 from mayflower/fix/netdev-master-bindstoFranz Pletz2017-02-18
|\ | | | | network-interfaces service: fix bindsTo deps for masters
| * network-interface service: tuntap ifs have netdev servicesFranz Pletz2017-02-18
| |
| * network-interfaces service: fix bindsTo deps for mastersFranz Pletz2017-02-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, netdev units for network interfaces defined in the nixos configurations would bindTo the systemd device unit of the interface if not in a container. In situations where you switch to a new nixos configration with changes to network-setup.service (like nameservers) and have stacked interfaces like vlans on a bond, it would fail to propagate restarts to the netdevs correctly resulting with broken networking. The bond would be present but no vlan interfaces rendering the machine unreachable. My fear is that the udev events fail to propagate correctly while a systemd transaction that is also restarting the triggered netdev service is running. This commit changes this behaviour so netdev services bindTo other netdev services if present and otherwise fall back to the previous behaviour. We also noticed that stacked interfaces would sometimes seemingly be stopped in the wrong order. For instance in the above example, the bond interface would be deleted before the vlan interfaces resulting in the vlan interfaces not being present when their service is being stopped. This would cause the systemd transaction to fail and thus break networking. Their postStop hooks are now allowed to fail as we have reached the desired state.
* | networking.bonds: add support for arbitrary driverOptionsProfpatsch2017-02-16
|/ | | | | | | | | Until now the four attributes available very selectively provided a small subset, while copying upstream documentation. We make driver options an arbitrary key-value set and point to kernel documentation, which is always up-to-date. This way every option can be set. The four already existing options are deprecated with a warning.
* network-interfaces service: add metric option for defaultGatewaysFranz Pletz2017-02-11
|
* network-interfaces service: add defaultGateway{,6}.interfaceNikolay Amiantov2017-02-02
|
* sit interfaces: fix dependency trackingArnold Krille2016-10-12
|
* nixos network: fix evaluation after #19128Jörg Thalheim2016-10-12
|
* containers: Improve device dependency trackingArnold Krille2016-10-08
| | | | | | | Now the tracking works with aggregated devices on aggregated devices. So container with physical device where the device is put in a bond which is the basis for a bridge is now handled correctly.
* containers: Do not wait for udev for network devicesArnold Krille2016-10-08
| | | | | | | | | | | | | | | Test that adding physical devices to containers works, find that network setup then doesn't work because there is no udev in the container to tell systemd that the device is present. Fixed by not depending on the device in the container. Activate the new container test for release Bonds, bridges and other network devices need the underlying not as dependency when used inside the container. Because the device is already there. But the address configuration needs the aggregated device itself.