0

I'm trying to force a wifi connection thru a specific 5GHz network using the bssid on netplan configuration but it always report an error when I ran netplan apply command.

Here is my current configuration that fails:

wlan0:
  dhcp4: true
  dhcp6: false
  link-local: []
  access-points:
    "wifissid":
      password: "wifipassword"
    bssid: "3c:28:6d:95:76:00"

The error is the following:

sudo netplan apply
/etc/netplan/30-wlan0.yaml:10:16: Error in network definition: expected mapping (check indentation)
        bssid: "3c:28:6d:95:76:00"
               ^

Tried many different combinations but it always fail. Could you help me providing an example that works?

Thank you in advance. Ederson Santos

  • Thanks for the reply! Added the information requested to the post. – Ederson Santos Feb 22 '21 at 21:27
  • Indent bssid so that it matches the password line above. Both are sub-items of the same access point. – user535733 Feb 22 '21 at 21:44
  • Yes, It's the MAC address assigned to SSID called Basic Service Set Identification (BSSID). The problem is that the documentation from https://netplan.io/reference/ is not clear how can we configure it. I know that it's a yaml, but with my experience with yaml configuration was not sufficient to set it correctly. – Ederson Santos Feb 22 '21 at 21:51
  • @user535733, I tried all the combinations without success. Do you have any example how it could be? – Ederson Santos Feb 22 '21 at 21:53
  • Make sure you are not mixing tabs and spaces on your indentation to match the 'password' line. That's a common stumble. – user535733 Feb 22 '21 at 21:58
  • Sure. Just reviewed that point but it still failing. – Ederson Santos Feb 22 '21 at 22:04

2 Answers2

1

In your question, you have the bssid indented such that it is listed directly under the access-points mapping as if it were an SSID. It must be indented so that it's under the SSID it's associated with (in the above example, indented so that it's under wifissid).

slangasek
  • 5,562
0

"You can find many templates in /usr/share/doc/netplan/examples/" according to the posting I just read in the link below. It is near the bottom where they give the address to the netplan.io site.

How to configure wpa_supplicant in Ubuntu server 20.04