Home Explore Blog CI



nixpkgs

nixos/doc/manual/configuration/ad-hoc-network-config.section.md
69fa158e1ea5d1d9e6a6ac86a6fb0c991b0c9ebd6377f08d00000003000001aa
# Ad-Hoc Configuration {#ad-hoc-network-config}

You can use [](#opt-networking.localCommands) to
specify shell commands to be run at the end of `network-setup.service`. This
is useful for doing network configuration not covered by the existing NixOS
modules. For instance, to statically configure an IPv6 address:

```nix
{
  networking.localCommands =
    ''
      ip -6 addr add 2001:610:685:1::1/64 dev eth0
    '';
}
```

Chunks
a6bb3ba7 (1st chunk of `nixos/doc/manual/configuration/ad-hoc-network-config.section.md`)
Title: Ad-Hoc Network Configuration using networking.localCommands
Summary
The `networking.localCommands` option in NixOS allows users to specify shell commands to be executed at the end of the `network-setup.service`. This is useful for custom network configurations that are not covered by existing NixOS modules, such as statically configuring an IPv6 address.