From 58efd598064b8e87006a348f242859eddd40000a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9A=A1=EF=B8=8F2=20FakTor=E2=9A=A1=EF=B8=8F?= Date: Fri, 23 Jun 2023 17:06:52 +0000 Subject: [PATCH] GITBOOK-94: change request with no subject merged in GitBook --- system/operating-system.md | 245 ++++++++++++++++++++++++++++++++++--- 1 file changed, 231 insertions(+), 14 deletions(-) diff --git a/system/operating-system.md b/system/operating-system.md index bb97a52e..97d7491e 100644 --- a/system/operating-system.md +++ b/system/operating-system.md @@ -25,7 +25,7 @@ We configure the PC and install the Linux operating system. We use Ubuntu Server LTS (Long Term Support) OS, without a graphical user interface. This provides the best stability for the PC and makes the initial setup a breeze. -Ubuntu Server is based on the [Debian](https://www.debian.org/) Linux distribution, which is available for most hardware platforms. To make this guide as universal as possible, it uses only standard Debian commands. As a result, it should work smoothly with a personal computer while still being compatible with most other hardware platforms running Debian. +[Ubuntu Server](https://ubuntu.com/server/docs) is based on the [Debian](https://www.debian.org/) Linux distribution, which is available for most hardware platforms. To make this guide as universal as possible, it uses only standard Debian commands. As a result, it should work smoothly with a personal computer while still being compatible with most other hardware platforms running Debian. ### Balena Etcher and Ubuntu Server @@ -73,8 +73,10 @@ Use the **UP**, **Down,** and **ENTER** keys of your keyboard to navigate to the **5.** Select the interface network connection that you choose to use **(Ethernet recommended)** and **take note of your IP** obtained automatically through DHCP. (Normally 192.168.x.xx). Press \[**done]** {% hint style="info" %} -The router reserves the IP address of the device for a time, but If the device goes out soo time, the next time that the device starts, the router could assign a different IP and you could lose access to your node. To avoid this, you need to set a static IP to your node. Go to the [Set Static IP address](operating-system.md#set-a-static-ip-address-and-custom-dns-nameservers-optional) optional section to get more instructions to do this.\ -🚨 Be careful by setting this! If you change the router could be **the new router doesn't work in the same IP address range as the old router**, the MiniBolt won't be registered and will be completely out of the connection. More details on the [Set Static IP address](operating-system.md#set-a-static-ip-address-and-custom-dns-nameservers-optional) section. +The router reserves the IP address of the device for a time, but If the device goes out soo time, the next time that the device starts, the router could assign a different IP and you could lose access to your node. To avoid this, you need to set a static IP to your node. Go to the [Set Static IP address](operating-system.md#set-a-static-ip-address-and-custom-dns-nameservers-optional) optional section to get more instructions to do this. + +\ +🚨 Be careful by setting this! If you change the router could be **the new router doesn't work in the same IP address range as the old router**, the MiniBolt won't be registered and will be completely out of the connection. To avoid this, follow the [Set the DCHP (automatic) configuration](operating-system.md#set-the-automatic-dhcp-mode-configuration) section to ensure that the DHCP server auto assigns an IP to the node in the range you are working on, and if you want after the change of the router, reconfigure the static IP address again following the [Option 2](operating-system.md#option-2-after-ubuntu-server-installation-by-command-line) section. {% endhint %} **6.** Leave the empty next option if you don't want to use an HTTP proxy to access it. Press \[**done]** @@ -134,24 +136,28 @@ This is an IMPORTANT step! The GIF before is only a recreation of a scenario made with a virtual machine, **VBOX\_HARDDISK\_**... is the **example name** for the name of the disk. In your case, this probably will not match exactly {% endhint %} -### Set a static IP address and custom DNS nameservers (optional) +### Set a static IP address and custom DNS nameservers (optional) + +#### Option 1: At the beginning, during the Ubuntu Server installation GUI + +When you arrive at **step 15** of the [Ubuntu Server guided installation](operating-system.md#ubuntu-server-installation), you can want to choose set a static IP address and customize the DNS name server/s. -When you arrive at **step 15** of the Ubuntu Server guided installation, you can want to choose set a static IP address and customize the DNS name server/s. Wait for the router DHCP server to assign the IP address to your MiniBolt node to know in what IP range has the node, you will be able to assign the same IP or a different one in the next step. +Wait for the router's DHCP server to assign the IP address to your MiniBolt node to find out what IP range the node is in, you will be able to assign the same or a different IP in the next step.
-> > **Subnet:** \ +> > **Subnet:** your router subnet, e.g 192.168.1.0/24 > -> > **Address**: \ +> > **Address**: your assigned local IP address, eg. 192.168.1.29 > -> > **Gateway:** \ +> > **Gateway:** you router IP, eg. 192.168.1.1 > -> > **Name servers:** 1.1.1.1,1.0.0.1 +> > **Name servers:** DNS servers choosen, eg. same of gateway (192.168.1.1,192.168.1.1) (your ISP DNS) or Cloudflare DNS server (1.1.1.1,1.0.0.1) <- (recommended) > -> > **Search domains:** \ +> > **Search domains:** \ {% hint style="info" %} -This is only an example if your local network IP range is `192.168.1.0-255` because for this case, the router assigned the IP address **192.168.1.29**, but could be **192.168.0.29** (`192.168.0.0-255)`, then you will need to set this instead: +This is **only** an **example** if your local network IP range is `192.168.1.0-255,` because for this case, the router assigned to the device the IP address **192.168.1.29**, but could be **192.168.0.29** (`192.168.0.0-255)`, then you will need to set this instead: > **Subnet:** 192.168.0.0/24 @@ -159,13 +165,224 @@ This is only an example if your local network IP range is `192.168.1.0-255` beca {% endhint %} {% hint style="danger" %} -**Be careful by setting this!** If you change the router could be the new router doesn't work in the same IP address range as the old router, the device won't be registered on the local network and will be completely out of the connection. +**Be careful by setting this!** If you change the router, could be the new router doesn't work in the same IP address range as the old router, the device won't be registered on the local network and will be completely out of the connection. -💡 To avoid this, you will need to **enable the "Automatic (DHCP)" mode again before changing the router**, to ensure that the DHCP server assigns an IP to the node in the range you are working on, and finally reconfigure again a static IP address. +💡 To avoid this, you will need to **enable the "Automatic (DHCP)" mode again before changing the router**, following the [Set the DCHP (automatic) configuration](operating-system.md#set-the-automatic-dhcp-mode-configuration-by-command-line) to ensure that the DHCP server auto assigns an IP to the node in the range you are working on, and if you want, after router change, reconfigure the static IP address again following the [Option 2](operating-system.md#option-2-after-ubuntu-server-installation-by-command-line). If you don't do this, you will have to attach the monitor screen or television and keyboard again to fix this. {% endhint %} {% hint style="info" %} -In this step, you can set DNS name servers too, for this example, we have configured [Cloudflare DNS name servers](https://www.cloudflare.com/learning/dns/what-is-1.1.1.1/) (1.1.1.1/1.0.0.1) but you could set [others](https://www.quad9.net/) +In this step, you can set DNS name servers too, for this example, we have configured [Cloudflare DNS name servers](https://www.cloudflare.com/learning/dns/what-is-1.1.1.1/) (1.1.1.1/1.0.0.1) but you could set [others](https://www.quad9.net/service/service-addresses-and-features) +{% endhint %} + +#### Option 2: After Ubuntu Server installation (by command line) + +After having done the [1.3 Remote access](remote-access.md) section, you could want set a static IP address to your MiniBolt + +* Check your current data network interface by doing + +```bash +$ ip address +``` + +Check your own configuration, the next output is **only** an **example** of a concrete case, but in your case could be different: + +
1: lo: <LOOPBACK,UP,LOWER_UP> 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: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
+    link/ether 40:a8:f0:ac:6a:37 brd ff:ff:ff:ff:ff:ff
+    altname enp0s25
+    inet 192.168.1.147/24 metric 100 brd 192.168.1.255 scope global dynamic eno1
+       valid_lft 76855sec preferred_lft 76855sec
+    inet6 fe80::42a8:f0ff:feac:6a37/64 scope link
+       valid_lft forever preferred_lft forever
+
+ +Definitions in the case of before: + +> > ``` +> > = eno1 +> > ``` +> +> > ``` +> > = 192.168.1.147 +> > ``` +> +> > ``` +> > = 192.168.1.1 (this case) -> for case 192.168.0.147 choose 192.168.0.1 +> > ``` + +{% hint style="info" %} +Take note of your case data, you will need it later +{% endhint %} + +* Check the current DNS server setted + +```bash +$ resolvectl status +``` + +**Example** of expected output: + +``` +Global + Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported +resolv.conf mode: stub + +Link 2 (eno1) + Current Scopes: DNS + Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported +Current DNS Server: 192.168.1.1 + DNS Servers: 192.168.1.1 + DNS Domain: home +``` + +In the case of before: + +> > ``` +> > = 192.168.1.1 (your router IP) +> > ``` +> +> > ``` +> > = (secondary DNS server not setted in this case) +> > ``` + +* Edit the content of the next file + +
$ sudo nano /etc/netplan/00-installer-config.yaml
+
+ +* Replace the content to match this template + +``` +# This is the network config written by 'subiquity' +network: + ethernets: + : + addresses: + - /24 + nameservers: + addresses: + - + - + search: [] + routes: + - to: default + via: + version: 2 +``` + +{% hint style="info" %} +Replace **\**, **\**, **\**, **\** (optional but recommended)**,** and **\** to your own data. \ +\ +You can choose the DNS server (**\ +** **\**) whatever you want, including the default one set in the DNS server of your router (normally of the ISP), in that case, you should type the **\** address in **\** and the same in **\**. For this example, we have configured [Cloudflare DNS name servers](https://www.cloudflare.com/learning/dns/what-is-1.1.1.1/) (1.1.1.1/1.0.0.1) <-- (recommended), but you could set [others](https://www.quad9.net/service/service-addresses-and-features) {% endhint %} + +
+ +Example ⬇️ + +``` +# This is the network config written by 'subiquity' +network: + ethernets: + eno1: + addresses: + - 192.168.1.87/24 + nameservers: + addresses: + - 1.1.1.1 + - 1.0.0.1 + search: [] + routes: + - to: default + via: 192.168.1.1 + version: 2 +``` + +
+ +* Finally, type this command to apply the changes + +```bash +$ sudo netplan apply +``` + +{% hint style="info" %} +If you chose a different IP address than the router assigned you, this step could break the current SSH connection, reconnect using the chosen IP address +{% endhint %} + +#### **Check changes are applied:** + +* For the IP address change, type the next command + +```bash +$ ip address +``` + +{% hint style="info" %} +The output of this command **may not change**, depending on whether you chose the same IP that the router originally assigned you at first, or whether you chose to change to another +{% endhint %} + +* For the DNS servers change, type the next command + +```bash +$ resolvectl status +``` + +
+ +Example ⬇️ + +``` +Global + Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported +resolv.conf mode: stub + +Link 2 (eno1) + Current Scopes: DNS + Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported +Current DNS Server: 1.1.1.1 + DNS Servers: 1.1.1.1 1.0.0.1 +[...] +``` + +
+ +### Set the A**utomatic (DHCP) mode** configuration (by command line) + +If you go to change the router you could want to enable or check if you have enabled the a**utomatic (DHCP) mode** configuration to avoid problems + +* Edit the content of the next file + +
$ sudo nano /etc/netplan/00-installer-config.yaml
+
+ +* Replace the content to match this template + +
# This is the network config written by 'subiquity'
+network:
+  ethernets:
+    <interface>:
+      dhcp4: true
+  version: 2
+
+ +* Finally, type this command to apply the changes + +```bash +$ sudo netplan apply +``` + +{% hint style="info" %} +#### Check changes are applied following [the same step as before](operating-system.md#check-changes-are-applied-following-the-same-step-before) +{% endhint %} + +[^1]: \ + +[^2]: \