Score:0

Setting up a static IP for my wireless interface on Ubuntu Server

ve flag

I am trying to configure my wireless interface to use a static IPv4 address and I suddenly lost connection to the internet.

This is my configuration file content:

# This is the network config written by 'subiquity'
network:
  version: 2
  renderer: networkd
  wifis:
    wlp2s0:
      dhcp4: false
      dhcp6: false
      access-points:
        "bssid": "mybssid"
         password: "mypassword"
      addresses:
        - 192.168.1.100/24
      routes:
        - to: default
          via: 192.168.1.254
      nameservers:
        addresses: [8.8.8.8, 8.8.8.0]

And then when I run "sudo netplan apply"

I get this:

/etc/netplan/00-installer-config-wifi.yaml:11:10: Invalid YAML: inconsistent indentation:
         password: "mypassword"
         ^

In the fields bssid and password, I entered my Wi-Fi's SSID and Password, and replaced them on this post only for mybssid and mypassword, I don't know if that's correct.

Thank you for your help and time.

Raffa avatar
jp flag
You have multiple mistakes ... See example: https://netplan.readthedocs.io/en/latest/examples/#how-to-connect-to-a-wpa-personal-wireless-network-without-dhcp
chili555 avatar
cn flag
Also see: `cat /usr/share/doc/netplan/examples/wireless.yaml` Welcome to Ask Ubuntu.
Gas-Andrew Chedid avatar
ve flag
Alright thank you guys I solved it. <3
Score:2
ve flag

Fixed 00-installer-config-wifi.yaml file:

# This is the network config written by 'subiquity'
network:
  version: 2
  renderer: networkd
  wifis:
    wlp2s0:
      dhcp4: no
      dhcp6: no
      access-points:
        "my-bssid":
         password: "my-pass"
      addresses: [192.168.1.100/24]
      routes:
        - to: default
          via: 192.168.1.254
      nameservers:
        addresses: [192.168.1.254, 8.8.8.8]

If anyone is reading this, just replace "my-bssid" with your Wi-Fi SSID and "my-pass" with your Wi-Fi password, and 192.168.1.254 with your default gateway address.

Thank you all.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.