Skip to content

Interfaces

networking.interfaces.<name>.ipv4.addresses

List of IPv4 addresses that will be statically assigned to the interface.

Type: list of (submodule)

Default

[ ]

Example

[{address = "10.0.0.1";prefixLength = 16;}{address = "192.168.1.1";prefixLength = 24;}]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix

networking.interfaces.<name>.ipv4.addresses.*.address

IPv4 address of the interface. Leave empty to configure the interface using DHCP.

Type: string

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix

networking.interfaces.<name>.ipv4.addresses.*.prefixLength

Subnet mask of the interface, specified as the number of bits in the prefix (24).

Type: signed integer

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix

networking.interfaces.<name>.ipv4.routes

List of extra IPv4 static routes that will be assigned to the interface.

::: {.warning} If the route type is the default unicast, then the scope is set differently depending on the value of {option}networking.useNetworkd: the script-based backend sets it to link, while networkd sets it to global. :::

If you want consistency between the two implementations, set the scope of the route manually with networking.interfaces.eth0.ipv4.routes = [{ options.scope = "global"; }] for example.

Type: list of (submodule)

Default

[ ]

Example

[{address = "10.0.0.0";prefixLength = 16;}{address = "192.168.2.0";prefixLength = 24;via = "192.168.1.1";}]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix

networking.interfaces.<name>.ipv4.routes.*.address

IPv4 address of the network. Type: string

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix

networking.interfaces.<name>.ipv4.routes.*.options

Other route options. See the symbol OPTIONS in the ip-route(8) manual page for the details. You may also specify metric, src, protocol, scope, from and table, which are technically not route options, in the sense used in the manual.

Type: attribute set of string

Default

{ }

Example

{mtu = "1492";window = "524288";}

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix

networking.interfaces.<name>.ipv4.routes.*.prefixLength

Subnet mask of the network, specified as the number of bits in the prefix (24).

Type: signed integer

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix

networking.interfaces.<name>.ipv4.routes.*.type

Type of the route. See the Route types section in the ip-route(8) manual page for the details.

Note that prohibit, blackhole, unreachable, and throw cannot be configured per device, so they are not available here. Similarly, nat hasn't been supported since kernel 2.6.

Type: null or one of "unicast", "local", "broadcast", "multicast"

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix

networking.interfaces.<name>.ipv4.routes.*.via

IPv4 address of the next hop. Type: null or string

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix

networking.interfaces.<name>.ipv6.addresses

List of IPv6 addresses that will be statically assigned to the interface.

Type: list of (submodule)

Default

[ ]

Example

[{address = "fdfd:b3f0:482::1";prefixLength = 48;}{address = "2001:1470:fffd:2098::e006";prefixLength = 64;}]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix

networking.interfaces.<name>.ipv6.addresses.*.address

IPv6 address of the interface. Leave empty to configure the interface using DHCP.

Type: string

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix

networking.interfaces.<name>.ipv6.addresses.*.prefixLength

Subnet mask of the interface, specified as the number of bits in the prefix (64).

Type: signed integer

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix

networking.interfaces.<name>.ipv6.routes

List of extra IPv6 static routes that will be assigned to the interface.

Type: list of (submodule)

Default

[ ]

Example

[{address = "fdfd:b3f0::";prefixLength = 48;}{address = "2001:1470:fffd:2098::";prefixLength = 64;via = "fdfd:b3f0::1";}]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix

networking.interfaces.<name>.ipv6.routes.*.address

IPv6 address of the network. Type: string

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix

networking.interfaces.<name>.ipv6.routes.*.options

Other route options. See the symbol OPTIONS in the ip-route(8) manual page for the details. You may also specify metric, src, protocol, scope, from and table, which are technically not route options, in the sense used in the manual.

Type: attribute set of string

Default

{ }

Example

{mtu = "1492";window = "524288";}

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix

networking.interfaces.<name>.ipv6.routes.*.prefixLength

Subnet mask of the network, specified as the number of bits in the prefix (64).

Type: signed integer

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix

networking.interfaces.<name>.ipv6.routes.*.type

Type of the route. See the Route types section in the ip-route(8) manual page for the details.

Note that prohibit, blackhole, unreachable, and throw cannot be configured per device, so they are not available here. Similarly, nat hasn't been supported since kernel 2.6.

Type: null or one of "unicast", "local", "broadcast", "multicast"

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix

networking.interfaces.<name>.ipv6.routes.*.via

IPv6 address of the next hop. Type: null or string

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix

networking.interfaces.<name>.macAddress

MAC address of the interface. Leave empty to use the default.

Type: null or string

Default

null

Example

"00:11:22:33:44:55"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix

networking.interfaces.<name>.mtu

MTU size for packets leaving the interface. Leave empty to use the default.

Type: null or signed integer

Default

null

Example

9000

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix

networking.interfaces.<name>.name

Name of the interface. Type: string

Example

"eth0"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix

networking.interfaces.<name>.proxyARP

Turn on proxy_arp for this device. This is mainly useful for creating pseudo-bridges between a real interface and a virtual network such as VPN or a virtual machine for interfaces that don't support real bridging (most wlan interfaces). As ARP proxying acts slightly above the link-layer, below-ip traffic isn't bridged, so things like DHCP won't work. The advantage above using NAT lies in the fact that no IP addresses are shared, so all hosts are reachable/routeable.

WARNING: turns on ip-routing, so if you have multiple interfaces, you should think of the consequence and setup firewall rules to limit this.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix

networking.interfaces.<name>.tempAddress

When IPv6 is enabled with SLAAC, this option controls the use of temporary address (aka privacy extensions) on this interface. This is used to reduce tracking.

See also the global option , which applies to all interfaces where this is not set.

Possible values are: - "default" to generate IPv6 temporary addresses and use these as source addresses in routing; - "disabled" to completely disable IPv6 temporary addresses; - "enabled" to generate IPv6 temporary addresses but still use EUI-64 addresses as source addresses;

Type: one of "default", "disabled", "enabled"

Default

config.networking.tempAddresses

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix

networking.interfaces.<name>.useDHCP

Whether this interface should be configured with DHCP. Overrides the default set by {option}networking.useDHCP. If null (the default), DHCP is enabled if the interface has no IPv4 addresses configured with {option}networking.interfaces.<name>.ipv4.addresses, and disabled otherwise.

Type: null or boolean

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix

networking.interfaces.<name>.virtual

Whether this interface is virtual and should be created by tunctl. This is mainly useful for creating bridges between a host and a virtual network such as VPN or a virtual machine.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix

networking.interfaces.<name>.virtualOwner

In case of a virtual device, the user who owns it.

Type: string

Default

"root"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix

networking.interfaces.<name>.virtualType

The type of interface to create. The default is TUN for an interface name starting with "tun", otherwise TAP.

Type: one of "tun", "tap"

Default

if hasPrefix "tun" name then "tun" else "tap"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix

networking.interfaces.<name>.wakeOnLan.enable

Whether to enable wol on this interface. Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix

networking.interfaces.<name>.wakeOnLan.policy

The Wake-on-LAN policy to set for the device.

The options are - phy: Wake on PHY activity - unicast: Wake on unicast messages - multicast: Wake on multicast messages - broadcast: Wake on broadcast messages - arp: Wake on ARP - magic: Wake on receipt of a magic packet

Type: list of (one of "phy", "unicast", "multicast", "broadcast", "arp", "magic", "secureon")

Default

["magic"]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/tasks/network-interfaces.nix