3

I'm trying to configure my orangepi to connect to a wifi hotspot using different wifi adapters.

Configuring a single wifi adapter in my Netplan /etc/netplan/armbian-default.yaml works smoothly. config below:

network:
  version: 2
  ethernets:
    eth0:
      renderer: networkd
      dhcp4: no
      addresses:
        [192.168.1.114/24]
      gateway4: 192.168.1.1
      nameservers:
          addresses: [8.8.8.8, 4.4.4.4]
  wifis:
    wlx00e1b0101341:
      renderer: networkd
      access-points:
        "wifissid":
          password: "wifipass"
      dhcp4: no
      addresses:
        [192.168.43.7/24, 192.168.42.7/24]

My wifi adapters names all start with "wlx" and my goal is to have a wildcard configuration and avoid configuring each one alone. But when I try to add a match parameter to it as below

network:
  version: 2
  ethernets:
    eth0:
      renderer: networkd
      dhcp4: no
      addresses:
        [192.168.1.114/24]
      gateway4: 192.168.1.1
      nameservers:
          addresses: [8.8.8.8, 4.4.4.4]
  wifis:
    match:
      name: wlx*
    renderer: networkd
    access-points:
      "wifissid":
        password: "wifipass"
    dhcp4: no
    addresses:
      [192.168.43.7/24, 192.168.42.7/24]

I get the below error when using netplan --debug apply

Error in network definition //etc/netplan/armbian-default.yaml line 13 column 6: unknown key name

Any ideas?

Salem
  • 311
  • 2
  • 12

2 Answers2

1

This is what i have in my EC2 ubuntu18.04 box to match multiple ethernet interfaces names which are usually assigned dynamically

network:
version: 2
ethernets:
    ens:
        match:
             name: ens*
        dhcp4: true
        dhcp6: false
        nameservers:
                addresses: [8.8.8.8, 8.8.4.4]
                search: [~.]
    eth:
        match:
             name: eth*
        dhcp4: true
        dhcp6: false
        nameservers:
                addresses: [8.8.8.8, 8.8.4.4]
                search: [~.]
thisis2394
  • 11
  • 1
0

I used also a solution to wildcard all predictable and unpredictable network interfaces.

Systemd since the version 197 use predictable name for network Interface

https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/

  • onboard NIC : eno*
  • pcie card : ens*
  • physical/geographical location : enp2s*

this is different from the unpredictable network interface name

classical old way : eth*

to use it do in /etc/netplan/50-wilcard.yaml

network:
    version: 2
    ethernets:
        all-en:
            match:
                name: en*
            dhcp4: true
            dhcp4-overrides:
                use-domains: true
            dhcp6: true
            dhcp6-overrides:
                use-domains: true
        all-eth:
            match:
                name: eth*
            dhcp4: true
            dhcp4-overrides:
                use-domains: true
            dhcp6: true
            dhcp6-overrides:
                use-domains: true

then

netplan generate
netplan apply