1.\" 2.\" Copyright (c) 2024 Alexander Ziaee. Ohio. 3.\" 4.\" SPDX-License-Identifier: BSD-2-Clause 5.\" 6.Dd March 21, 2025 7.Dt NETWORKING 7 8.Os 9.Sh NAME 10.Nm networking , 11.Nm wifi 12.Nd quickstart guide to connecting to a network 13.Sh DESCRIPTION 14In the following examples, it is assumed that 15we are connecting to Ethernet with the first interface found by the 16.Xr ix 4 17driver, and Wi-Fi with the first interface found by the 18.Xr iwlwifi 4 19driver, though your hardware will vary. 20.Sh EXAMPLES 21.Bl -tag -width 0n 22.It Sy Example 1: Connecting to an Ethernet network with DHCP 23.Pp 24Ask for a DHCP lease on the first Intel 10Gb Ethernet interface: 25.Bd -literal -offset 2n 26.Ic # dhclient ix0 27.Ed 28.It Sy Example 2: Connecting to a cellular network with USB tethering 29.Pp 30Ask for a DHCP lease on the first USB tethering interface: 31.Bd -literal -offset 2n 32.Ic # dhclient ue0 33.Ed 34.It Sy Example 3: Connecting to a Wi-Fi network 35.Pp 36Identify your Wi-Fi hardware: 37.Bd -literal -offset 2n 38.Ic % sysctl net.wlan.devices 39.Ed 40.Pp 41Create the 42.Sy wlan0 43interface with the first Intel Wi-Fi adapter: 44.Bd -literal -offset 2n 45.Ic # sysrc wlans_iwlwifi0="wlan0" 46.Ed 47.Pp 48Set that interface to ask for a DHCP lease with 49.Xr wpa_supplicant 8 : 50.Bd -literal -offset 2n 51.Ic # sysrc ifconfig_wlan0="WPA SYNCDHCP" 52.Ed 53.Pp 54Enter the details of the Wi-Fi network: 55.Bd -literal -offset 2n 56.Ic # cd /etc/ 57.Ic # wpa_passphrase \(dqmyssid\(dq \(dqmypassphrase\(dq >> wpa_supplicant.conf 58.Ed 59.Pp 60Restart the network interface daemon: 61.Bd -literal -offset 2n 62.Ic # service netif restart 63.Ed 64.It Sy Example 4: Scanning for Wi-Fi networks 65.Bd -literal -offset 2n 66.Ic % ifconfig wlan0 scan 67.Ed 68.It Sy Example 5: Airplane mode 69.Bd -literal -offset 2n 70.Ic # service netif stop 71.Ed 72.El 73.Sh SEE ALSO 74.Xr bsdconfig 8 , 75.Xr dhclient 8 , 76.Xr ifconfig 8 , 77.Xr wpa_passphrase 8 78.Pp 79The Advanced Networking chapter of the 80.Fx 81Handbook. 82.Sh CAVEATS 83Shell Special Characters in the 84.Ar SSID 85or 86.Ar passphrase 87will need to be escaped for 88.Xr wpa_passphrase 8 , 89commonly using 90.Ql \e , 91see the manual page for your shell for more details. 92.Pp 93Stopping the network interface service also stops internal networking. 94