summary refs log tree commit diff
path: root/nixos/doc/manual/configuration/ipv4-config.xml
diff options
context:
space:
mode:
authorMikey Ariel <mariel@redhat.com>2014-08-24 19:18:18 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-08-26 19:03:49 +0200
commita099ca45054940b63b1615920de158ebafb25ea8 (patch)
tree52907df9dc996cbab14885c8eab72b473086126a /nixos/doc/manual/configuration/ipv4-config.xml
parent8707a070baca84d881a7e03e04a44374d8cc05e1 (diff)
downloadnixpkgs-a099ca45054940b63b1615920de158ebafb25ea8.tar
nixpkgs-a099ca45054940b63b1615920de158ebafb25ea8.tar.gz
nixpkgs-a099ca45054940b63b1615920de158ebafb25ea8.tar.bz2
nixpkgs-a099ca45054940b63b1615920de158ebafb25ea8.tar.lz
nixpkgs-a099ca45054940b63b1615920de158ebafb25ea8.tar.xz
nixpkgs-a099ca45054940b63b1615920de158ebafb25ea8.tar.zst
nixpkgs-a099ca45054940b63b1615920de158ebafb25ea8.zip
Chunk NixOS manual
[Squashed commits to make git blame etc. more likely to work. -ED]
Diffstat (limited to 'nixos/doc/manual/configuration/ipv4-config.xml')
-rw-r--r--nixos/doc/manual/configuration/ipv4-config.xml47
1 files changed, 47 insertions, 0 deletions
diff --git a/nixos/doc/manual/configuration/ipv4-config.xml b/nixos/doc/manual/configuration/ipv4-config.xml
new file mode 100644
index 00000000000..e2c51518349
--- /dev/null
+++ b/nixos/doc/manual/configuration/ipv4-config.xml
@@ -0,0 +1,47 @@
+<section xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         xmlns:xi="http://www.w3.org/2001/XInclude"
+         version="5.0"
+         xml:id="sec-ipv4">
+
+<title>IPv4 Configuration</title>
+
+<para>By default, NixOS uses DHCP (specifically,
+<command>dhcpcd</command>) to automatically configure network
+interfaces.  However, you can configure an interface manually as
+follows:
+
+<programlisting>
+networking.interfaces.eth0 = { ipAddress = "192.168.1.2"; prefixLength = 24; };
+</programlisting>
+
+(The network prefix can also be specified using the option
+<literal>subnetMask</literal>,
+e.g. <literal>"255.255.255.0"</literal>, but this is deprecated.)
+Typically you’ll also want to set a default gateway and set of name
+servers:
+
+<programlisting>
+networking.defaultGateway = "192.168.1.1";
+networking.nameservers = [ "8.8.8.8" ];
+</programlisting>
+
+</para>
+
+<note><para>Statically configured interfaces are set up by the systemd
+service
+<replaceable>interface-name</replaceable><literal>-cfg.service</literal>.
+The default gateway and name server configuration is performed by
+<literal>network-setup.service</literal>.</para></note>
+
+<para>The host name is set using <option>networking.hostName</option>:
+
+<programlisting>
+networking.hostName = "cartman";
+</programlisting>
+
+The default host name is <literal>nixos</literal>.  Set it to the
+empty string (<literal>""</literal>) to allow the DHCP server to
+provide the host name.</para>
+
+</section>