Raspberry Pi OS

Configure Wireless and Wired connections

Create a wpa_supplicant.conf file in /boot, which will be later copied on the root partition at /etc/wpa_supplicant/wpa_supplicant.conf, with these contents:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=<Insert 2 letter ISO 3166-1 country code here>

network={
	ssid="<Name of your wireless LAN>"
	psk="<Password for your wireless LAN>"
}

More info here.

For a wired connection, it should connect automatically. Just make sure that the router the RaspberryPi is attached to is accepting connections from new devices and not rejecting them by default.

Set a static IP address

There are more than a couple of methods but probably the easiest is to use the NetworkManager tui interface, nmtui. Launch it as root and it will guide you to set up manually both the IP addresses, default gateways, and DNS servers of each connection, both wired and wireless.