如何在Ubuntu 18.04與Ubuntu 20.04上設定網路

前言

最近需要設定樹莓派4並當成IoT裝置並進行一些資料產生的的操作,同時也需要連進去進行一些套件更新與安裝,因此就需要進行網路設定了。我使用樹莓派4是安裝Ubuntu Server 20.04.3 LTS的版本,沒有圖形化桌面的版本,相關下載網址會放在參考資料中,這種沒有圖形化介面的版本預設會使用Netplan來做網路管理與設定,但是Ubuntu desktop之圖形化桌面環境版本則是以NetworkManager作為網路管理,本文章,則是要在Ubuntu server安裝NetworkManager並交其進行網路管理。

接著設定無線網路進行連線與有線與無線網路的優先權。

NetworkManager安裝

從上述的前言章節可以知道,在Ubuntu server中預設是使用Netplan做網路管理的,這個也可以透過下列的指令來驗證這件事情,底下以樹莓派4為例:

為了要將網路管理的權限交給NetworkManager,因此需要先將此套件安裝起來,相關的指令如下:


ubuntu@iotdevice02:~/hardware-monitor$ sudo apt-get update
Hit:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease
Get:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease [114 kB]
Get:3 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease [108 kB]
Get:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease [114 kB]
Fetched 336 kB in 3s (127 kB/s)
Reading package lists... Done
ubuntu@iotdevice02:~/hardware-monitor$ sudo apt-get install network-manager
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
dns-root-data dnsmasq-base libbluetooth3 libidn11 libjansson4 libmbim-glib4 libmbim-proxy libmm-glib0
libndp0 libnm0 libqmi-glib5 libqmi-proxy libteamdctl0 modemmanager network-manager-pptp ppp pptp-linux
usb-modeswitch usb-modeswitch-data
Suggested packages:
avahi-autoipd libteam-utils comgt wvdial
The following NEW packages will be installed:
dns-root-data dnsmasq-base libbluetooth3 libidn11 libjansson4 libmbim-glib4 libmbim-proxy libmm-glib0
libndp0 libnm0 libqmi-glib5 libqmi-proxy libteamdctl0 modemmanager network-manager network-manager-pptp
ppp pptp-linux usb-modeswitch usb-modeswitch-data
0 upgraded, 20 newly installed, 0 to remove and 0 not upgraded.
Need to get 4549 kB of archives.
After this operation, 20.5 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://ports.ubuntu.com/ubuntu-ports focal/main arm64 dns-root-data all 2019052802 [5300 B]
Get:2 http://ports.ubuntu.com/ubuntu-ports focal/main arm64 libidn11 arm64 1.33-2.2ubuntu2 [45.3 kB]
Get:3 http://ports.ubuntu.com/ubuntu-ports focal-updates/main arm64 dnsmasq-base arm64 2.80-1.1ubuntu1.4 [296 kB]
Get:4 http://ports.ubuntu.com/ubuntu-ports focal-updates/main arm64 libbluetooth3 arm64 5.53-0ubuntu3.4 [59.1 kB]
Get:5 http://ports.ubuntu.com/ubuntu-ports focal/main arm64 libjansson4 arm64 2.12-1build1 [28.5 kB]
Get:6 http://ports.ubuntu.com/ubuntu-ports focal-updates/main arm64 libmbim-glib4 arm64 1.24.8-1~20.04 [96.2 kB]
Get:7 http://ports.ubuntu.com/ubuntu-ports focal-updates/main arm64 libmbim-proxy arm64 1.24.8-1~20.04 [5788 B]
Get:8 http://ports.ubuntu.com/ubuntu-ports focal-updates/main arm64 libmm-glib0 arm64 1.16.6-2~20.04.1 [179 kB]
Get:9 http://ports.ubuntu.com/ubuntu-ports focal/main arm64 libndp0 arm64 1.7-0ubuntu1 [10.6 kB]
Get:10 http://ports.ubuntu.com/ubuntu-ports focal-updates/main arm64 libnm0 arm64 1.22.10-1ubuntu2.2 [342 kB]
Get:11 http://ports.ubuntu.com/ubuntu-ports focal-updates/main arm64 libqmi-glib5 arm64 1.28.6-1~20.04.1 [551 kB]
Get:12 http://ports.ubuntu.com/ubuntu-ports focal-updates/main arm64 libqmi-proxy arm64 1.28.6-1~20.04.1 [5740 B]
Get:13 http://ports.ubuntu.com/ubuntu-ports focal/main arm64 libteamdctl0 arm64 1.30-1 [11.3 kB]
Get:14 http://ports.ubuntu.com/ubuntu-ports focal-updates/main arm64 modemmanager arm64 1.16.6-2~20.04.1 [753 kB]
Get:15 http://ports.ubuntu.com/ubuntu-ports focal-updates/main arm64 network-manager arm64 1.22.10-1ubuntu2.2 [1689 kB]
Get:16 http://ports.ubuntu.com/ubuntu-ports focal-updates/main arm64 ppp arm64 2.4.7-2+4.1ubuntu5.1 [318 kB]
Get:17 http://ports.ubuntu.com/ubuntu-ports focal/main arm64 pptp-linux arm64 1.10.0-1build1 [41.3 kB]
Get:18 http://ports.ubuntu.com/ubuntu-ports focal/main arm64 network-manager-pptp arm64 1.2.8-2 [28.7 kB]
Get:19 http://ports.ubuntu.com/ubuntu-ports focal/main arm64 usb-modeswitch-data all 20191128-3 [32.3 kB]
Get:20 http://ports.ubuntu.com/ubuntu-ports focal/main arm64 usb-modeswitch arm64 2.5.2+repack0-2ubuntu3 [51.0 kB]
Fetched 4549 kB in 3s (1782 kB/s)
Selecting previously unselected package dns-root-data.
(Reading database ... 99716 files and directories currently installed.)
Preparing to unpack .../00-dns-root-data_2019052802_all.deb ...
Unpacking dns-root-data (2019052802) ...
Selecting previously unselected package libidn11:arm64.
Preparing to unpack .../01-libidn11_1.33-2.2ubuntu2_arm64.deb ...
Unpacking libidn11:arm64 (1.33-2.2ubuntu2) ...
Selecting previously unselected package dnsmasq-base.
Preparing to unpack .../02-dnsmasq-base_2.80-1.1ubuntu1.4_arm64.deb ...
Unpacking dnsmasq-base (2.80-1.1ubuntu1.4) ...
Selecting previously unselected package libbluetooth3:arm64.
Preparing to unpack .../03-libbluetooth3_5.53-0ubuntu3.4_arm64.deb ...
Unpacking libbluetooth3:arm64 (5.53-0ubuntu3.4) ...
Selecting previously unselected package libjansson4:arm64.
Preparing to unpack .../04-libjansson4_2.12-1build1_arm64.deb ...
Unpacking libjansson4:arm64 (2.12-1build1) ...
Selecting previously unselected package libmbim-glib4:arm64.
Preparing to unpack .../05-libmbim-glib4_1.24.8-1~20.04_arm64.deb ...
Unpacking libmbim-glib4:arm64 (1.24.8-1~20.04) ...
Selecting previously unselected package libmbim-proxy.
Preparing to unpack .../06-libmbim-proxy_1.24.8-1~20.04_arm64.deb ...
Unpacking libmbim-proxy (1.24.8-1~20.04) ...
Selecting previously unselected package libmm-glib0:arm64.
Preparing to unpack .../07-libmm-glib0_1.16.6-2~20.04.1_arm64.deb ...
Unpacking libmm-glib0:arm64 (1.16.6-2~20.04.1) ...
Selecting previously unselected package libndp0:arm64.
Preparing to unpack .../08-libndp0_1.7-0ubuntu1_arm64.deb ...
Unpacking libndp0:arm64 (1.7-0ubuntu1) ...
Selecting previously unselected package libnm0:arm64.
Preparing to unpack .../09-libnm0_1.22.10-1ubuntu2.2_arm64.deb ...
Unpacking libnm0:arm64 (1.22.10-1ubuntu2.2) ...
Selecting previously unselected package libqmi-glib5:arm64.
Preparing to unpack .../10-libqmi-glib5_1.28.6-1~20.04.1_arm64.deb ...
Unpacking libqmi-glib5:arm64 (1.28.6-1~20.04.1) ...
Selecting previously unselected package libqmi-proxy.
Preparing to unpack .../11-libqmi-proxy_1.28.6-1~20.04.1_arm64.deb ...
Unpacking libqmi-proxy (1.28.6-1~20.04.1) ...
Selecting previously unselected package libteamdctl0:arm64.
Preparing to unpack .../12-libteamdctl0_1.30-1_arm64.deb ...
Unpacking libteamdctl0:arm64 (1.30-1) ...
Selecting previously unselected package modemmanager.
Preparing to unpack .../13-modemmanager_1.16.6-2~20.04.1_arm64.deb ...
Unpacking modemmanager (1.16.6-2~20.04.1) ...
Selecting previously unselected package network-manager.
Preparing to unpack .../14-network-manager_1.22.10-1ubuntu2.2_arm64.deb ...
Unpacking network-manager (1.22.10-1ubuntu2.2) ...
Selecting previously unselected package ppp.
Preparing to unpack .../15-ppp_2.4.7-2+4.1ubuntu5.1_arm64.deb ...
Unpacking ppp (2.4.7-2+4.1ubuntu5.1) ...
Selecting previously unselected package pptp-linux.
Preparing to unpack .../16-pptp-linux_1.10.0-1build1_arm64.deb ...
Unpacking pptp-linux (1.10.0-1build1) ...
Selecting previously unselected package network-manager-pptp.
Preparing to unpack .../17-network-manager-pptp_1.2.8-2_arm64.deb ...
Unpacking network-manager-pptp (1.2.8-2) ...
Selecting previously unselected package usb-modeswitch-data.
Preparing to unpack .../18-usb-modeswitch-data_20191128-3_all.deb ...
Unpacking usb-modeswitch-data (20191128-3) ...
Selecting previously unselected package usb-modeswitch.
Preparing to unpack .../19-usb-modeswitch_2.5.2+repack0-2ubuntu3_arm64.deb ...
Unpacking usb-modeswitch (2.5.2+repack0-2ubuntu3) ...
Setting up libjansson4:arm64 (2.12-1build1) ...
Setting up dns-root-data (2019052802) ...
Setting up libidn11:arm64 (1.33-2.2ubuntu2) ...
Setting up libteamdctl0:arm64 (1.30-1) ...
Setting up usb-modeswitch-data (20191128-3) ...
Setting up libnm0:arm64 (1.22.10-1ubuntu2.2) ...
Setting up ppp (2.4.7-2+4.1ubuntu5.1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/pppd-dns.service → /lib/systemd/system/pppd-dns.service.
Setting up libmm-glib0:arm64 (1.16.6-2~20.04.1) ...
Setting up libbluetooth3:arm64 (5.53-0ubuntu3.4) ...
Setting up usb-modeswitch (2.5.2+repack0-2ubuntu3) ...
Setting up libndp0:arm64 (1.7-0ubuntu1) ...
Setting up libmbim-glib4:arm64 (1.24.8-1~20.04) ...
Setting up pptp-linux (1.10.0-1build1) ...
Setting up network-manager (1.22.10-1ubuntu2.2) ...
Created symlink /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service → /lib/systemd/system/NetworkManager-dispatcher.service.
Created symlink /etc/systemd/system/network-online.target.wants/NetworkManager-wait-online.service → /lib/systemd/system/NetworkManager-wait-online.service.
Created symlink /etc/systemd/system/multi-user.target.wants/NetworkManager.service → /lib/systemd/system/NetworkManager.service.
Setting up libmbim-proxy (1.24.8-1~20.04) ...
Setting up dnsmasq-base (2.80-1.1ubuntu1.4) ...
Setting up network-manager-pptp (1.2.8-2) ...
Setting up libqmi-glib5:arm64 (1.28.6-1~20.04.1) ...
Setting up libqmi-proxy (1.28.6-1~20.04.1) ...
Setting up modemmanager (1.16.6-2~20.04.1) ...
Created symlink /etc/systemd/system/dbus-org.freedesktop.ModemManager1.service → /lib/systemd/system/ModemManager.service.
Created symlink /etc/systemd/system/multi-user.target.wants/ModemManager.service → /lib/systemd/system/ModemManager.service.
Processing triggers for systemd (245.4-4ubuntu3.13) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for dbus (1.12.16-2ubuntu2.1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
ubuntu@iotdevice02:~/hardware-monitor$

接著使用vim指令將上述有提到的50-cloud-init.yaml檔案進行編輯,編輯成下面的檔案內容:

編輯完成之後,接著依序執行下列的指令讓netpln重新產生與載入設定並重新開機,相關執行的指令如下:


ubuntu@iotdevice02:~/hardware-monitor$ sudo netplan generate
ubuntu@iotdevice02:~/hardware-monitor$ sudo netplan apply
ubuntu@iotdevice02:~/hardware-monitor$ sudo systemctl reboot

重新開機完成之後,接著可以使用nmcli等相關指令進行查看,相關執行指令的結果如下:

設定無線網路

從上述的結果來看,目前樹莓派4已經有接上有線網路了,在設定好NetworkManager之網路管理之後,樹莓派4內建已經有無線網卡晶片,所以可以設定無線網路並連上網路,可以先使用ip指令查看目前的網路介面卡:

ubuntu@iotdevice02:~$ ip a show
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: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether e4:5f:01:2b:1d:11 brd ff:ff:ff:ff:ff:ff
inet 140.92.35.43/24 brd 140.92.35.255 scope global dynamic noprefixroute eth0
valid_lft 28296sec preferred_lft 28296sec
inet6 fe80::c108:1a70:6111:3e25/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
link/ether e4:5f:01:2b:1d:12 brd ff:ff:ff:ff:ff:ff

從上面輸出的訊息可以知道,編號為3的網路介面卡為無線網路卡,為了讓無線網卡可以啟用,因此需要使用下列一串的指令進行無線網卡的啟用:

從上面的截圖可以得知,此無線網卡狀態為未連線的,接著需要確定WiFi功能有啟用,因此需要使用下列的指令進行啟用:

ubuntu@iotdevice02:~$ sudo nmcli r wifi on
ubuntu@iotdevice02:~$

接著使用下列的指令將可以連上無線網路的清單列出,就可以看到可以連線的無線網路清單了,相關的指令執行如下:

假設要連線到上面截圖中的「ASUS_20」,則可以使用下列的指令達成,相關的執行指令結果如下:

ubuntu@iotdevice02:~$ sudo nmcli d wifi connect ASUS_20 password <password>
Device 'wlan0' successfully activated with '66648169-56e0-4d24-b173-f0e68258e93c'.
ubuntu@iotdevice02:~$

其中,「ASUS_20」可以隨著要存取的無線網路SSID進行替換,而「<password>」則可以自行換成確切的無線網路密碼。

接著再看目前的連線之網路介面卡資訊,則可以看到多了無線網卡的介面資訊了,相關的訊息如下所示:

ubuntu@iotdevice02:~$ sudo nmcli connection show --active
NAME                 UUID                                   TYPE        DEVICE
Wired connection 1   ca6b66b4-01d1-3f96-989c-19c203028fae   ethernet    eth0
ASUS_20              66648169-56e0-4d24-b173-f0e68258e93c   wifi        wlan0

設定網路連線優先權(永久)

在每個網路連線都有一個ipv4.route-metric設定,因此可以使用下面指令分別看兩個目前的網路連線的metric設定:

ubuntu@iotdevice02:~$ sudo nmcli connection show "Wired connection 1" | grep ipv4.route-metric
ipv4.route-metric: -1
ubuntu@iotdevice02:~$

ubuntu@iotdevice02:~$ sudo nmcli connection show "ASUS_20" | grep ipv4.route-metric
ipv4.route-metric: -1

從上面的網路連線的設定來看,這兩個設定目前都是-1,因此沒有優先順序的問題,為了要有優先順序,並決定讓某一個網路連線優先使用並進行對外的網路連線,可以使用下列的指令來做到:

ubuntu@iotdevice02:~$ sudo nmcli connection modify "Wired connection 1" ipv4.route-metric 100
ubuntu@iotdevice02:~$ sudo nmcli connection modify "ASUS_20" ipv4.route-metric 50
ubuntu@iotdevice02:~$

從上面的指令可以知道,將名為「Wired connection 1」設定成100,而「ASUS_20」設定成50,這樣一來就會使用「ASUS_20」作為優先連線到外部網路的網路連線了。metric之值是數值越小則優先權越高,設定好之後,分別將兩個網路連線進行重新啟動,相關的指令執行如下:

ubuntu@iotdevice02:~$ sudo nmcli connection down "Wired connection 1"
Connection 'Wired connection 1' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/1)
ubuntu@iotdevice03:~$ sudo nmcli connection up "Wired connection 1"
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/4)
ubuntu@iotdevice02:~$ sudo nmcli connection down "ASUS_20"
Connection 'ASUS_20' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/2)
ubuntu@iotdevice02:~$ sudo nmcli connection up "ASUS_20"
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/3)
ubuntu@iotdevice02:~$

到這裡,網路就設定成功了,同時,也可以使用route指令來看目前的網路的routing table相關的網路連線資訊,相關的執行指令的安裝與用法如下:

ubuntu@iotdevice01:~$ sudo apt-get update
Hit:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease
Get:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease [114 kB]
Get:3 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease [108 kB]
Get:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease [114 kB]
Fetched 336 kB in 4s (89.9 kB/s)
Reading package lists... Done
ubuntu@iotdevice02:~$ sudo apt-get install net-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
net-tools
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 194 kB of archives.
After this operation, 827 kB of additional disk space will be used.
Get:1 http://ports.ubuntu.com/ubuntu-ports focal/main arm64 net-tools arm64 1.60+git20180626.aebd88e-1ubuntu1 [194 kB]
Fetched 194 kB in 2s (110 kB/s)
Selecting previously unselected package net-tools.
(Reading database ... 100150 files and directories currently installed.)
Preparing to unpack .../net-tools_1.60+git20180626.aebd88e-1ubuntu1_arm64.deb ...
Unpacking net-tools (1.60+git20180626.aebd88e-1ubuntu1) ...
Setting up net-tools (1.60+git20180626.aebd88e-1ubuntu1) ...
Processing triggers for man-db (2.9.1-1) ...
ubuntu@iotdevice02:~$

從上面的routing table資訊可以知道,無線網路與有線網路的metric分別設定成50與100了。

同時也可以使用curl指令並利用外部查看目前在外部的IP位址來判斷是否目前的metric設定已經完成,若curl套件未安裝則可以先使用「sudo apt-get install curl」進行安裝:

ubuntu@iotdevice02:~$ curl 'https://api.ipify.org?format=json'
{"ip":"180.217.5.93"}
ubuntu@iotdevice02:~$

若要驗證上述的設定是否生效,則可以使用reboot指令將裝置重新開機即可。

設定網路連線優先權(暫時)

若要暫時設定網路連線優先權的話,則可以考慮使用ifmetric指令進行操作,這個指令是可以暫時將指定的網路介面卡的連線設定網路優先權,如此一來也可以達到控制指定的網路連線優先去連外的效果。缺點則是當此機器重新開機之後,則相關的網路連線優先權設定則會失效,若要永久的話,請參考上一章節的設定。

在使用ifmetric指令之前,則先確定此套件的指令是否有安裝完成,可以使用下列的指令得知:


ubuntu@iotdevice02:~$ sudo apt-get update
Hit:1 http://ports.ubuntu.com/ubuntu-ports focal InRelease
Get:2 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease [114 kB]
Get:3 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease [108 kB]
Get:4 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease [114 kB]
Fetched 336 kB in 3s (117 kB/s)
Reading package lists... Done
ubuntu@iotdevice02:~$

ubuntu@iotdevice02:~$ sudo apt-get install ifmetric
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
ifmetric
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 11.0 kB of archives.
After this operation, 37.9 kB of additional disk space will be used.
Get:1 http://ports.ubuntu.com/ubuntu-ports focal/universe arm64 ifmetric arm64 0.3-5 [11.0 kB]
Fetched 11.0 kB in 1s (11.1 kB/s)
Selecting previously unselected package ifmetric.
(Reading database ... 100199 files and directories currently installed.)
Preparing to unpack .../ifmetric_0.3-5_arm64.deb ...
Unpacking ifmetric (0.3-5) ...
Setting up ifmetric (0.3-5) ...
Processing triggers for man-db (2.9.1-1) ...
ubuntu@iotdevice02:~$

接著,可以使用route指令列出目前此台機器網路的routing table,透過路由表則可以知道相關優先權的設定,相關指令執行後的結果如下:

從上面的截圖所示,假設要把網路介面卡名稱為「eth0」之網路優先權metric改成90的話,則可以使用下列的指令做到:


ubuntu@iotdevice02:~$ sudo ifmetric eth0 90

上面的指令完成之後,再次使用route指令則可以看到eth0之網路優先權metric從100變成90了:

因為是暫時修改的,所以當機器重新開機之後,則會變成100了,相關的執行指令之結果如下:


ubuntu@iotdevice02:~$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 50 0 0 wlan0
0.0.0.0 140.92.35.1 0.0.0.0 UG 90 0 0 eth0
140.92.35.0 0.0.0.0 255.255.255.0 U 90 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 50 0 0 wlan0
ubuntu@iotdevice02:~$ sudo systemctl reboot
ubuntu@iotdevice02:~$ Connection to 140.92.35.43 closed by remote host.
Connection to 140.92.35.43 closed.
PS C:\Users\peterli> ssh ubuntu@140.92.35.43
ubuntu@140.92.35.43's password:
Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 5.4.0-1047-raspi aarch64)

* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage

System information as of Thu Dec 23 01:30:14 UTC 2021

System load: 1.46 Processes: 153
Usage of /: 10.6% of 28.38GB Users logged in: 0
Memory usage: 3% IPv4 address for eth0: 140.92.35.43
Swap usage: 0% IPv4 address for wlan0: 192.168.1.28
Temperature: 59.9 C

* Super-optimized for small spaces - read how we shrank the memory
footprint of MicroK8s to make it the smallest full K8s around.

https://ubuntu.com/blog/microk8s-memory-optimisation

0 updates can be applied immediately.

Last login: Thu Dec 23 01:21:38 2021 from 140.92.35.62

參考資料

  • https://newbedev.com/how-can-i-make-changes-to-the-network-routing-metric-permanently
  • https://askubuntu.com/questions/1122757/netplan-vs-networkmanager-on-ubuntu-18-04-and-above
  • https://ubuntu.com/core/docs/networkmanager/configure-wifi-connections