diff options
author | Bobby Rong <rjl931189261@126.com> | 2021-07-01 23:11:54 +0800 |
---|---|---|
committer | Bobby Rong <rjl931189261@126.com> | 2021-07-01 23:11:54 +0800 |
commit | 3d423e2b1563ef4d38d0bb190935a26b58409b67 (patch) | |
tree | 250ec2cd274e37bedd07a1b1d6deeeba35f1d7cb /nixos/doc/manual/from_md/configuration | |
parent | 83fc29ffb90742fb341a24aa27d2ad344b97a754 (diff) | |
download | nixpkgs-3d423e2b1563ef4d38d0bb190935a26b58409b67.tar nixpkgs-3d423e2b1563ef4d38d0bb190935a26b58409b67.tar.gz nixpkgs-3d423e2b1563ef4d38d0bb190935a26b58409b67.tar.bz2 nixpkgs-3d423e2b1563ef4d38d0bb190935a26b58409b67.tar.lz nixpkgs-3d423e2b1563ef4d38d0bb190935a26b58409b67.tar.xz nixpkgs-3d423e2b1563ef4d38d0bb190935a26b58409b67.tar.zst nixpkgs-3d423e2b1563ef4d38d0bb190935a26b58409b67.zip |
nixos: nixos/doc/manual/configuration/ipv4-config.xml to CommonMark
Diffstat (limited to 'nixos/doc/manual/from_md/configuration')
-rw-r--r-- | nixos/doc/manual/from_md/configuration/ipv4-config.section.xml | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/nixos/doc/manual/from_md/configuration/ipv4-config.section.xml b/nixos/doc/manual/from_md/configuration/ipv4-config.section.xml new file mode 100644 index 00000000000..06a70b65cfb --- /dev/null +++ b/nixos/doc/manual/from_md/configuration/ipv4-config.section.xml @@ -0,0 +1,43 @@ +<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-ipv4"> + <title>IPv4 Configuration</title> + <para> + By default, NixOS uses DHCP (specifically, + <literal>dhcpcd</literal>) to automatically configure network + interfaces. However, you can configure an interface manually as + follows: + </para> + <programlisting language="bash"> +networking.interfaces.eth0.ipv4.addresses = [ { + address = "192.168.1.2"; + prefixLength = 24; +} ]; +</programlisting> + <para> + Typically you’ll also want to set a default gateway and set of name + servers: + </para> + <programlisting language="bash"> +networking.defaultGateway = "192.168.1.1"; +networking.nameservers = [ "8.8.8.8" ]; +</programlisting> + <note> + <para> + Statically configured interfaces are set up by the systemd service + <literal>interface-name-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 + <link xlink:href="options.html#opt-networking.hostName"><literal>networking.hostName</literal></link>: + </para> + <programlisting language="bash"> +networking.hostName = "cartman"; +</programlisting> + <para> + 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> |