2024-10-13 11:36:13 +02:00
## Networking
2024-06-20 20:01:40 +02:00
2024-07-06 21:49:29 +02:00
Armbian uses [**Netplan.io** ](https://netplan.io/ ) to describe networking configurations. Netplan is a utility to easily configure Linux networking, using a declarative approach.
If you want to configure your network manually, it is as simple as editing and creating Netplan yaml files (see the yaml configuration reference at the [Netplan docs ](https://netplan.readthedocs.io/en/stable/netplan-yaml/ )).
2024-06-20 20:01:40 +02:00
2024-10-14 11:17:40 +02:00
_Netplan_ is used to configure networks on **all ** Armbian images since Release 24.05, no matter if minimal, CLI or desktop, Debian or Ubuntu. However, the networking backends are different based on if you choose a _ minimal _ image or not.
2024-06-20 20:01:40 +02:00
2024-10-13 11:36:13 +02:00
## Minimal images
!!! tip "Netplan renderer: networkd"
2024-07-06 21:49:29 +02:00
2024-10-14 11:17:40 +02:00
_Minimal_ images are using the `systemd-networkd` backend, which has a **smaller footprint ** compared to `Network-Manager` which is used in all non-minimal images. `systemd-networkd` is a system daemon that manages network configurations. It detects and configures network devices as they appear; it can also create virtual network devices. This service is great for simple connections, but can also be useful to set up complex network configurations.
2024-06-20 20:01:40 +02:00
2024-10-13 11:36:13 +02:00
### Armbian defaults
2024-06-20 20:01:40 +02:00
2024-10-14 11:17:40 +02:00
All ethernet interfaces are configured for DHCP and will automatically receive an IP address from your router.
2024-06-20 20:01:40 +02:00
2024-07-06 21:49:29 +02:00
[`/etc/netplan/10-dhcp-all-interfaces.yaml` ](https://github.com/armbian/build/blob/main/extensions/network/config-networkd/netplan/10-dhcp-all-interfaces.yaml ):
2024-06-20 20:01:40 +02:00
2024-07-06 21:49:29 +02:00
```yaml
network:
version: 2
renderer: networkd
ethernets:
all-eth-interfaces:
match:
2024-08-06 07:24:39 +02:00
name: "e*"
2024-07-06 21:49:29 +02:00
dhcp4: yes
dhcp6: yes
ipv6-privacy: yes
```
2024-06-20 20:01:40 +02:00
2024-10-13 11:36:13 +02:00
### Configuration examples
2024-06-20 20:01:40 +02:00
2024-10-13 11:36:13 +02:00
#### Setting a fixed IP address
2024-07-06 21:49:29 +02:00
2025-02-25 10:12:10 -08:00
When creating an additional .yaml file be sure to remove the default file (/etc/netplan/10-dhcp-all-interfaces.yaml) as the default will overide.
2024-10-14 11:17:40 +02:00
The following example configures a static IP `192.168.1.199` for the `eth0` interface. Please adjust as necessary.
2024-07-06 21:49:29 +02:00
2024-10-13 11:36:13 +02:00
!!! question "How to find your device's Ethernet interface?"
Use command:
```sh
ip addr
```
It is usually something like `eth0` , `enp4s3` or `lan` .
2024-07-06 21:49:29 +02:00
`/etc/netplan/20-static-ip.yaml` :
```yaml
network:
version: 2
renderer: networkd
ethernets:
eth0: # Change this to your ethernet interface
addresses:
- 192.168.1.199/24
routes:
- to: default
via: 192.168.1.1
nameservers:
addresses:
- 9.9.9.9
- 1.1.1.1
```
See also the [Netplan docs ](https://netplan.readthedocs.io/en/latest/using-static-ip-addresses/ ) for reference.
2024-10-13 11:36:13 +02:00
#### Connecting to WiFI network
2024-06-20 20:01:40 +02:00
2024-10-13 11:36:13 +02:00
!!! tip "It is recommended to make a separate config file for wireless network."
2024-06-20 20:01:40 +02:00
2024-07-06 21:49:29 +02:00
Create the following file:
2024-06-20 20:01:40 +02:00
2024-07-06 21:49:29 +02:00
`sudo nano /etc/netplan/30-wifis-dhcp.yaml` :
2024-06-20 20:01:40 +02:00
2024-07-06 21:49:29 +02:00
```yaml
network:
version: 2
renderer: networkd
wifis:
wlan0:
dhcp4: true
dhcp6: true
access-points:
"Your-SSID":
password: "your-password"
```
2024-06-20 20:01:40 +02:00
2024-07-06 21:49:29 +02:00
Replace `SSID` with the name of the network you want to connect to and `wlan0` with the wifi interface used on your system.
2024-06-20 20:01:40 +02:00
2024-10-13 11:36:13 +02:00
!!! question "How to find your device's WiFi interface?"
Use command:
```sh
2024-11-29 12:11:36 +01:00
iw dev | awk '$1=="Interface"{print $2}'
2024-10-13 11:36:13 +02:00
```
2024-11-29 12:11:36 +01:00
It is usually something like `wlan0` , `wlo1` or `wlx12334c47dec3` . If you get blank response, it means your WiFi device / dongle is not supported by the kernel.
2024-10-13 11:36:13 +02:00
2024-06-20 20:01:40 +02:00
2024-07-06 21:49:29 +02:00
See also the [Netplan docs ](https://netplan.readthedocs.io/en/latest/examples/#how-to-configure-your-computer-to-connect-to-your-home-wi-fi-network ) for reference.
2024-06-20 20:01:40 +02:00
2024-10-13 11:36:13 +02:00
### Applying your configuration
2024-06-20 20:01:40 +02:00
2024-07-07 09:05:03 +02:00
Once you are done configuring your network, it is time to test syntax and apply it.
2024-06-20 20:01:40 +02:00
2024-10-13 11:36:13 +02:00
#### Fix file permissions
2024-06-20 20:01:40 +02:00
2024-10-14 11:17:40 +02:00
According to the [Netplan docs ](https://netplan.readthedocs.io/en/stable/security/ ), the permissions must be restricted to the `root` user.
2024-06-20 20:01:40 +02:00
2024-07-06 21:49:29 +02:00
```bash
sudo chmod 600 /etc/netplan/*.yaml
```
2024-06-20 20:01:40 +02:00
2024-10-13 11:36:13 +02:00
#### Test syntax
This will verify the syntax and test if your device can connect
2024-07-06 21:49:29 +02:00
```bash
sudo netplan try
```
2025-02-25 10:12:10 -08:00
If there are no warmings or errors and you hit ENTER as suggested the changes will be made and the next, nextplan apply, step can be skipped.
2024-06-20 20:01:40 +02:00
2024-10-13 11:36:13 +02:00
#### Apply the configuration
2024-06-20 20:01:40 +02:00
2024-07-06 21:49:29 +02:00
```bash
sudo netplan apply
```
2024-06-20 20:01:40 +02:00
2024-10-13 11:36:13 +02:00
# CLI and desktop images
!!! tip "Netplan renderer: Network Manager"
2024-06-20 20:01:40 +02:00
2024-07-06 21:49:29 +02:00
Server CLI and desktop images are using the `Network-Manager` backend. You can use similar methods for configuring your network as with the `networkd` backend used on minimal images.
2024-06-20 20:01:40 +02:00
2024-07-06 21:49:29 +02:00
### Setting a fixed IP address
2024-06-20 20:01:40 +02:00
2024-07-06 21:49:29 +02:00
The following example configures a static IP `192.168.1.199` for the `eth0` interface. Please adjust the example to your likings.
2024-06-20 20:01:40 +02:00
2024-10-13 11:36:13 +02:00
!!! question "How to find your device's Ethernet interface?"
Use command:
```sh
ip addr
```
It is usually something like `eth0` , `enp4s3` or `lan` .
2024-06-20 20:01:40 +02:00
2024-07-06 21:49:29 +02:00
`/etc/netplan/20-static-ip.yaml` :
2024-06-20 20:01:40 +02:00
2024-07-06 21:49:29 +02:00
```yaml
network:
version: 2
renderer: NetworkManager # Different than 'networkd'
ethernets:
eth0: # Change this to your ethernet interface
addresses:
- 192.168.1.199/24
routes:
- to: default
via: 192.168.1.1
nameservers:
addresses:
- 9.9.9.9
- 1.1.1.1
```
2024-06-20 20:01:40 +02:00
2024-07-06 21:49:29 +02:00
See also the [Netplan docs ](https://netplan.readthedocs.io/en/latest/using-static-ip-addresses/ ) for reference.
2024-06-20 20:01:40 +02:00
2024-07-06 21:49:29 +02:00
Alternatively, you can also use Network-Manager directly via the command line or GUI tools on your desktop:
```bash
nmtui-edit eth0
```
2024-10-13 11:36:13 +02:00
??? note "Display screenshot"

2024-06-20 20:01:40 +02:00
2024-07-06 21:49:29 +02:00
Replace `eth0` with the name of your Ethernet Interface.
2024-10-13 11:36:13 +02:00
### Connecting to WiFI network
2024-07-06 21:49:29 +02:00
2024-10-13 11:36:13 +02:00
For connecting to a wireless network, you can use the same method as mention above for use with `networkd` [on minimal images ](#minimal-images ). Just make sure to replace `renderer: networkd` with `renderer: NetworkManager` .
2024-07-06 21:49:29 +02:00
Alternatively, you can also use Network-Manager directly via the command line or GUI tools on your desktop:
```bash
nmtui-connect SSID
```
2024-10-13 11:36:13 +02:00
??? note "Display screenshot"

2024-07-06 21:49:29 +02:00
2024-11-29 12:11:36 +01:00
Replace `SSID` with the name of your wireless network.