Added 'networking.dhcpcd.denyInterfaces' to extend the list of network
interfaces black-listed for dhcpcd via configuration.nix. I use this option to disable DHCP for "veth*" interfaces, which are created by LXC for use inside of virtual machines. svn path=/nixos/trunk/; revision=34018
This commit is contained in:
parent
1a0c9ce201
commit
7a69733704
|
@ -10,7 +10,8 @@ let
|
||||||
# interfaces that are part of a bridge.
|
# interfaces that are part of a bridge.
|
||||||
ignoredInterfaces =
|
ignoredInterfaces =
|
||||||
map (i: i.name) (filter (i: i ? ipAddress && i.ipAddress != "" ) config.networking.interfaces)
|
map (i: i.name) (filter (i: i ? ipAddress && i.ipAddress != "" ) config.networking.interfaces)
|
||||||
++ concatLists (attrValues (mapAttrs (n: v: v.interfaces) config.networking.bridges));
|
++ concatLists (attrValues (mapAttrs (n: v: v.interfaces) config.networking.bridges))
|
||||||
|
++ config.networking.dhcpcd.denyInterfaces;
|
||||||
|
|
||||||
# Config file adapted from the one that ships with dhcpcd.
|
# Config file adapted from the one that ships with dhcpcd.
|
||||||
dhcpcdConf = pkgs.writeText "dhcpcd.conf"
|
dhcpcdConf = pkgs.writeText "dhcpcd.conf"
|
||||||
|
@ -70,6 +71,23 @@ in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
###### interface
|
||||||
|
|
||||||
|
options = {
|
||||||
|
|
||||||
|
networking.dhcpcd.denyInterfaces = mkOption {
|
||||||
|
default = [];
|
||||||
|
description = ''
|
||||||
|
Disable the DHCP client for any interface which's name matches
|
||||||
|
any of the shell glob patterns in this list. The purpose of
|
||||||
|
this option is blacklist virtual interfaces such as those
|
||||||
|
created by Xen, libvirt, LXC, etc.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
###### implementation
|
###### implementation
|
||||||
|
|
||||||
config = mkIf config.networking.useDHCP {
|
config = mkIf config.networking.useDHCP {
|
||||||
|
|
Loading…
Reference in a new issue