Ubuntu 20.04 of rockpi4: where're the config files of the network?

I get confused…
Neither in /etc/network/interfaces nor interfaces.d…
No /etc/netplay…
It seems not in the /etc/NetworkManager neither…

https://netplan.io/examples/

I mean I cannot find any directory called “netplay” in the /etc.
My system is the official img of 20.04 for rockpi4.
In the version of official img of 18.04 for rockpi4, there’s netplay directory in the /etc indeed, but nothing was there, no any *.yaml file.

I have forgot to be honest as no longer have the rockpi4 but initially it was /etc/netplan/ netplan.
I think the debian image used network manager.

Maybe the images have changed and not running that specific image I am blind but have a read of the official documentation as it was that way.

Prob one of these will tell you what you are running

sudo service systemd-networkd status
sudo service network-manager  status
$ sudo service systemd-networkd status_ systemd-networkd.service - Network Service
     Loaded: loaded (/lib/systemd/system/systemd-networkd.service; disabled; vendor preset: enabled)
     Active: inactive (dead)
       Docs: man:systemd-networkd.service(8)
rock@rockpi4b:~/share/hostapd
$ sudo service network-manager  status
_ NetworkManager.service - Network Manager
     Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2021-07-20 14:09:21 CST; 55min ago
       Docs: man:NetworkManager(8)
   Main PID: 439 (NetworkManager)
      Tasks: 4 (limit: 2301)
     Memory: 18.5M
     CGroup: /system.slice/NetworkManager.service
             __439 /usr/sbin/NetworkManager --no-daemon

Jul 20 14:09:59 rockpi4b NetworkManager[439]: <info>  [1626761399.2931] dhcp4 (eth0): option subnet_mask          => '255.255.25>
Jul 20 14:09:59 rockpi4b NetworkManager[439]: <info>  [1626761399.2932] dhcp4 (eth0): state changed unknown -> bound
Jul 20 14:09:59 rockpi4b NetworkManager[439]: <info>  [1626761399.3057] device (eth0): state change: ip-config -> ip-check (reas>
Jul 20 14:09:59 rockpi4b NetworkManager[439]: <info>  [1626761399.3726] device (eth0): state change: ip-check -> secondaries (re>
Jul 20 14:09:59 rockpi4b NetworkManager[439]: <info>  [1626761399.3749] device (eth0): state change: secondaries -> activated (r>
Jul 20 14:09:59 rockpi4b NetworkManager[439]: <info>  [1626761399.3795] manager: NetworkManager state is now CONNECTED_LOCAL
Jul 20 14:09:59 rockpi4b NetworkManager[439]: <info>  [1626761399.3881] manager: NetworkManager state is now CONNECTED_SITE
Jul 20 14:09:59 rockpi4b NetworkManager[439]: <info>  [1626761399.3892] policy: set 'Wired connection 1' (eth0) as default for I>
Jul 20 14:09:59 rockpi4b NetworkManager[439]: <info>  [1626761399.3994] device (eth0): Activation: successful, device activated.
Jul 20 14:09:59 rockpi4b NetworkManager[439]: <info>  [1626761399.4052] manager: NetworkManager state is now CONNECTED_GLOBAL

Above is the output of the status of the two services.
I seems network-manager is being used.
So, I still cannot understand where’re the configure files of the network?

There’s no netplan directory in the /etc:

rock@rockpi4b:~/share/hostapd
$ ls /etc/netplan
ls: cannot access '/etc/netplan': No such file or directory

If network-manager is running guess use nmcli help that should get you going

Why the conf folder is missing but guess add and chmod as root

https://linuxhint.com/ubuntu_20-04_network_configuration/

Create your own and presume it will override whatever default it is picking up prob just a simple dhcp for eth0

sudo netplan try should give you a stdout if it worked or not

My memory is bad at times but pretty sure netplan was there in earlier images dunno why its missing the conf file dir and examples
I think it was the RockPi4 with 20.04 that first caused my confusion of no /etc/networking and whats netplan.io

So no /etc/NetworkManager either ?

/etc/NetworkManager exists indeed.
But Still I cannot find any network config infomation I want there.

$ tree /etc/NetworkManager/
/etc/NetworkManager/
|-- NetworkManager.conf
|-- conf.d
|   |-- 10-globally-managed-devices.conf
|   `-- default-wifi-powersave-on.conf
|-- dispatcher.d
|   |-- 01-ifupdown
|   |-- no-wait.d
|   |-- ntp
|   |-- pre-down.d
|   `-- pre-up.d
|-- dnsmasq-shared.d
|-- dnsmasq.d
`-- system-connections

8 directories, 5 files

Just use nmtui or nmcli.

I know nmcli works.
But what I really want to know is where the “informations” of the configs are stored, how nmcli reads or writes them.

sudo NetworkManager --print-config at a guess

At another guess prob /usr/lib/NetworkManager or /var/lib/NetworkManager and for some reason /etc/NetworkManager or /etc/netplan has not been created.

You have one simple way to discover it. Use fatrace, then nmcli, create/change configuration and check fatrace

I had the same problem
The configuration file was not found
Currently, su root uses ip addr or nm-connection-editor to modify the specific configuration
You can install Netplan later for better management configuration