It is important that you get the indenting right for this work correctlyįor example, if you were planning to give the pi the address 192.168.1.23 in the 192.168.1.0/24 subnet with a default gateway of 192.168.1.1 and a DNS server of 192.168.1.53 then the following text would work. You can do this for either the eth0 or wlan0 interface (or both). Line in the network-config file with lines that specify the intended IP address as well as its default gateway and DNS server.
To set a static IP you need to replace the Simply reboot sudo reboot and it will work. Note ⓘ: During the first boot, your Raspberry Pi will try to connect to this network. Save the file and extract the card from your laptop.
Note: network name must be enclosed in quotation marks. To do so, uncomment (remove the “#” at the beginning) and edit the following lines: wifis: An example is already included in the file, you can simply adapt it.
Note: Screenshots have been made on an Ubuntu desktop but it can be done on Windows and MacOS tooĮdit the network-config file to add your Wi-Fi credentials.