From 739ecbe4a6ccbb46cb58eeb9ab9221c5293d8278 Mon Sep 17 00:00:00 2001 From: MCamp859 Date: Mon, 19 Nov 2018 15:48:51 -0500 Subject: [PATCH 1/3] Add Assign static IP address to maint guide section. Signed-off-by: MCamp859 --- .../guides/maintenance/assign-static-ip.rst | 70 +++++++++++++++++++ .../guides/maintenance/maintenance.rst | 1 + 2 files changed, 71 insertions(+) create mode 100644 source/clear-linux/guides/maintenance/assign-static-ip.rst diff --git a/source/clear-linux/guides/maintenance/assign-static-ip.rst b/source/clear-linux/guides/maintenance/assign-static-ip.rst new file mode 100644 index 00000000..e198deec --- /dev/null +++ b/source/clear-linux/guides/maintenance/assign-static-ip.rst @@ -0,0 +1,70 @@ +.. _assign-static-ip: + +Assign a static IP address to a network interface +################################################# + +Introduction +************ + +*<< Need input: why you need to do this and/or how it relates to other +tasks. Prerequisites? Any issues that are solved by doing this? >>* + +Process +******* + +#. Make this directory: + + .. code-block:: bash + + $ sudo mkdir -p /etc/systemd/network + +#. Identify the interface to be assigned the static IP address: + + .. code-block:: bash + + $ ip addr + + The system returns the following: + + .. code-block:: console + + 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 + link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 + inet 127.0.0.1/8 scope host lo + valid_lft forever preferred_lft forever + inet6 ::1/128 scope host + valid_lft forever preferred_lft forever + + 2: wlp1s0: mtu 1500 qdisc mq state DOWN group default qlen 1000 + link/ether 4a:98:8d:e5:43:15 brd ff:ff:ff:ff:ff:ff + + 3: eno1: mtu 1500 qdisc fq state UP group default qlen 1000 + link/ether f4:4d:30:68:96:20 brd ff:ff:ff:ff:ff:ff + inet 10.0.1.2/24 brd 10.54.74.255 scope global dynamic eno1 + valid_lft 6766sec preferred_lft 6766sec + inet6 fe80::f64d:30ff:fe68:9620/64 scope link + valid_lft forever preferred_lft forever + + In this example, we will use the `eno1` interface. + +#. Create the :file:`70-static.network` file and add the following: + + .. code-block:: bash + + $ sudo vi /etc/systemd/network/70-static.network + + [Match] + Name=[interface name] + [Network] + Address=[IP address]/24 + DHCP=yes # to get DNS info, etc. + + Replace [interface-name] and [IP-address] with your specific settings. + +#. Restart the networkd service: + + .. code-block:: bash + + # sudo systemctl restart systemd-networkd + +**Congratulations!** You have successfully assigned a static IP address. \ No newline at end of file diff --git a/source/clear-linux/guides/maintenance/maintenance.rst b/source/clear-linux/guides/maintenance/maintenance.rst index 0751cd2b..b5657d9d 100644 --- a/source/clear-linux/guides/maintenance/maintenance.rst +++ b/source/clear-linux/guides/maintenance/maintenance.rst @@ -25,3 +25,4 @@ completed. download-verify-decompress-mac download-verify-decompress-windows autospec + assign-static-ip From bbefa05d099fa23b1afcbd3a67932aaba5a3eea5 Mon Sep 17 00:00:00 2001 From: MCamp859 Date: Thu, 29 Nov 2018 12:23:46 -0500 Subject: [PATCH 2/3] Incorporated review feedback. Signed-off-by: MCamp859 --- .../guides/maintenance/assign-static-ip.rst | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/source/clear-linux/guides/maintenance/assign-static-ip.rst b/source/clear-linux/guides/maintenance/assign-static-ip.rst index e198deec..3333c476 100644 --- a/source/clear-linux/guides/maintenance/assign-static-ip.rst +++ b/source/clear-linux/guides/maintenance/assign-static-ip.rst @@ -6,23 +6,24 @@ Assign a static IP address to a network interface Introduction ************ -*<< Need input: why you need to do this and/or how it relates to other -tasks. Prerequisites? Any issues that are solved by doing this? >>* +By default, your |CL-ATTR| system automatically gets an IP address from your +network via DHCP. If you do not have a DHCP server on your network, assign a +static IP address using the steps in this guide. Process ******* -#. Make this directory: +#. Create this directory structure: .. code-block:: bash - $ sudo mkdir -p /etc/systemd/network + sudo mkdir -p /etc/systemd/network #. Identify the interface to be assigned the static IP address: .. code-block:: bash - $ ip addr + ip addr The system returns the following: @@ -51,7 +52,7 @@ Process .. code-block:: bash - $ sudo vi /etc/systemd/network/70-static.network + sudo vi /etc/systemd/network/70-static.network [Match] Name=[interface name] @@ -59,12 +60,12 @@ Process Address=[IP address]/24 DHCP=yes # to get DNS info, etc. - Replace [interface-name] and [IP-address] with your specific settings. + Replace [interface name] and [IP address] with your specific settings. #. Restart the networkd service: .. code-block:: bash - # sudo systemctl restart systemd-networkd + sudo systemctl restart systemd-networkd -**Congratulations!** You have successfully assigned a static IP address. \ No newline at end of file +**Congratulations!** You have successfully assigned a static IP address. From f5b036fb9e4e22c2325c280eb78e2e8aae04e0ba Mon Sep 17 00:00:00 2001 From: MCamp859 Date: Thu, 29 Nov 2018 13:08:48 -0500 Subject: [PATCH 3/3] Completed final edits. Signed-off-by: MCamp859 --- source/clear-linux/guides/maintenance/assign-static-ip.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/clear-linux/guides/maintenance/assign-static-ip.rst b/source/clear-linux/guides/maintenance/assign-static-ip.rst index 3333c476..444fbf21 100644 --- a/source/clear-linux/guides/maintenance/assign-static-ip.rst +++ b/source/clear-linux/guides/maintenance/assign-static-ip.rst @@ -7,8 +7,8 @@ Introduction ************ By default, your |CL-ATTR| system automatically gets an IP address from your -network via DHCP. If you do not have a DHCP server on your network, assign a -static IP address using the steps in this guide. +network via DHCP. If you do not have a DHCP server on your network or simply +want to use a static IP address, follow the steps in this guide. Process ******* @@ -52,7 +52,7 @@ Process .. code-block:: bash - sudo vi /etc/systemd/network/70-static.network + sudo $EDITOR /etc/systemd/network/70-static.network [Match] Name=[interface name]