--- title: Declare NIC addresses in networking.interfaces, and use dladm and ipadm for the rest area: net impact: HIGH tags: [networking, dladm, ipadm, flowadm, crossbow, vnic, etherstub, dhcp] verified: 2026-11-04 --- # Declare NIC addresses in networking.interfaces, and use dladm and ipadm for the rest illumos splits networking into layers: `dladm` for datalinks, `ipadm` for addresses and `flowadm` for flows. On Solnix, the addresses of named NICs, the default route and DNS are Nix options. VNICs, etherstubs and flows have no option, so you make them with the commands. Use the illumos `dladm`/`ipadm`; the installer media carry a read-only `ip` wrapper for habit, not for configuring. A hand-made address on a NIC the config also names is not in your configuration, so a fresh install from it will not have it. **Antipattern** ```sh ip link show # Linux. illumos: dladm show-link / dladm show-phys ip addr add 192.0.2.10/24 dev eth0 # Linux. illumos: ipadm create-addr -T static ... ip link add veth0 type veth; brctl addbr # Linux. illumos: dladm create-vnic / create-etherstub tc qdisc add dev eth0 ... # Linux. illumos: flowadm, or dladm set-linkprop -p maxbw pfexec ipadm create-addr -T dhcp e1000g0/dhcp # on Solnix, by hand, for a NIC the config should own ``` **The Solnix way** ```nix # key = datalink name from `dladm show-phys`. A config that imports base.nix also inherits ena0.dhcp (EC2): # turn it off on other hardware, as configurations/arnold.nix does. networking.interfaces = { ena0.dhcp = false; e1000g0.dhcp = true; }; # or a static address (DHCP wins if both are set): # networking.interfaces.e1000g0.ipv4.addresses = [ { address = "192.0.2.10"; prefixLength = 24; } ]; # networking.defaultGateway = "192.0.2.1"; # route -p add default + /etc/defaultrouter # base.nix sets nameservers 169.254.169.253 and 8.8.8.8; arnold.nix replaces them with mkForce, as here: networking.nameservers = lib.mkForce [ "192.0.2.53" ]; # -> /etc/resolv.conf # networking.useDHCP = true; # DHCP on every wired link the config does not name, run by solnix-netd (see below) # apply (check `beadm list` first: switch destroys a hand-made BE named like the next solnix-N; ask the user): # pfexec solnix-rebuild switch --flake #, then reboot into the new BE: the live switch # reconciles SMF (and relinks /run-current-system), and install-be writes /etc/resolv.conf and /etc/defaultrouter into the new BE ``` The module renders the SMF service `site/solnix-net`. It runs `ipadm create-if` and `ipadm create-addr`; if ipadm fails it falls back to `ifconfig` (`ifconfig dhcp start wait 60` for DHCP, `ifconfig / up` for a static address), the only path that works on the gate's EC2 `ena` driver. With `useDHCP` (or wifi) on, `solnix-netd` runs the DHCP links instead, without that ena fallback, and `site/solnix-net` keeps the static ones. Read the log of the one that owns the link: `svcs -L site/solnix-net` or `svcs -L site/solnix-netd`. Make VNICs, etherstubs and flows with the commands below. **The illumos way** (OpenIndiana, OmniOS, SmartOS) ```sh dladm show-link; dladm show-phys # all datalinks; physical NICs only pfexec dladm create-etherstub stub0 # a virtual switch with no uplink pfexec dladm create-vnic -l stub0 vnic0 # -l: a physical link, an etherstub or an overlay pfexec ipadm create-if vnic0 # create-ip is the same subcommand pfexec ipadm create-addr -T static -a 192.0.2.10/24 vnic0/v4 pfexec ipadm create-if e1000g0; pfexec ipadm create-addr -T dhcp e1000g0/dhcp ipadm show-addr pfexec flowadm add-flow -l vnic0 -a transport=tcp,local_port=443 https-flow pfexec flowadm set-flowprop -p maxbw=50M https-flow # K, M or G; no suffix means Mbps ``` These changes persist across reboots unless you pass `-t`. On OpenIndiana, NWAM may manage the NICs, so you disable `physical:nwam` and enable `physical:default` before you configure them by hand (confirm with the user first: nwamd(8) warns that switching brings every interface down and back up, which "might" disrupt sessions). **The difference.** The commands are the gate's own and behave as on illumos. Solnix adds declared addresses, a default route and DNS. The handbook (site 307b67f) still says no declarative networking exists. The OS repo at 5a8e5ce has the `networking.*` options above, but none for VNICs, etherstubs or flows. Hand-made persistent link and address state is written under `/etc/dladm` and `/etc/ipadm`. A boot environment carries its own `/etc`, so rolling back to a BE made before the change drops it. **Check.** `ipadm show-addr` lists an address object for each declared interface with STATE `ok` (for a link brought up by the `ifconfig` fallback, check `ifconfig ` instead: see Unverified). If one is missing, `svcs -L site/solnix-net` (or `site/solnix-netd` for DHCP links when useDHCP or wifi is on) names the bringup log. **Unverified** - How `ipadm show-addr` shows an address that the `ifconfig` fallback made. The module's own log prints `ipadm show-addr` after bringup, but no source shows its output for that case. **Sources** - [dladm(8)](https://solnix.io/docs/man/dladm.8) (illumos, CDDL), show-link, show-phys, create-vnic (-t, -l), create-etherstub, maxbw; Example 16 - [ipadm(8)](https://solnix.io/docs/man/ipadm.8) (illumos, CDDL), create-if/create-ip, create-addr -T static / -T dhcp (-t), show-addr - [flowadm(8)](https://solnix.io/docs/man/flowadm.8) (illumos, CDDL), add-flow, set-flowprop, Flow Properties maxbw, Examples 1 and 2 - [compare: dladm(8)](https://solnix.io/docs/man/compare/dladm.8), [compare: ipadm(8)](https://solnix.io/docs/man/compare/ipadm.8), [compare: flowadm(8)](https://solnix.io/docs/man/compare/flowadm.8): Linux counterparts ip-link(8), ip-address(8), tc(8) - [Handbook: Networking (Crossbow)](https://solnix.io/docs/handbook/networking#solnix-status-honestly) (site 307b67f), For the Linux admin, The three command families, Solnix status, honestly - [configurations/base.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/configurations/base.nix) (solnix 5a8e5ce), `networking.interfaces.ena0.dhcp = lib.mkDefault true`, `networking.nameservers` - [modules/config/solnix-netd.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/solnix-netd.nix) (solnix 5a8e5ce), enabled by useDHCP; no ena fallback - [modules/system/activation/default.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/system/activation/default.nix) (solnix 5a8e5ce), `solnix-rebuild switch|boot|test [--flake [#]]`; `switch)` runs `do_activate` (the SMF activate script: svccfg apply/import, svcadm) then `do_boot` (install-be into a new BE) - [docs/nixos-iso-tool-parity.md](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/docs/nixos-iso-tool-parity.md) (solnix 5a8e5ce), `ip` read-only wrapper on the media - [modules/config/networking.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/networking.nix) (solnix 5a8e5ce), `networking.generatedEtc` (resolv.conf and defaultrouter go into the /etc overlay of the generation); options `interfaces..dhcp`, `ipv4.addresses`, `nameservers`, `useDHCP`, `defaultGateway`; `ifBringup`; `smf.services.solnix-net` - [configurations/arnold.nix](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/configurations/arnold.nix) (solnix 5a8e5ce), `networking.interfaces` - [modules/config/community/zone-install.sh](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/modules/config/community/zone-install.sh) (solnix 5a8e5ce), etc/ipadm and etc/dladm written by ipmgmtd and dlmgmtd - [docs/nixos-parity-audit.md](https://codeberg.org/solnix/solnix/src/commit/5a8e5ce75a33086d7be4410149847bdf7501b8fc/docs/nixos-parity-audit.md) (solnix 5a8e5ce), row 5 (a BE "also snapshots /etc and /var") - [nwamd(8)](https://solnix.io/docs/man/nwamd.8) (illumos, CDDL), switching to or from NWAM (interfaces brought down then back up; sessions might be disrupted) - [OpenIndiana handbook: System Administration](https://docs.openindiana.org/handbook/systems-administration/#changing-from-nwam-to-manual-configuration) (PDL), Changing from NWAM to Manual Configuration