xref: /freebsd/share/man/man7/networking.7 (revision c5f3a7f62217f20f0c7b2c4fc3fb2646336b0802)
1.\"-
2.\" SPDX-License-Identifier: BSD-2-Clause
3.\"
4.\" Copyright (c) 2024 Alexander Ziaee. Ohio.
5.\"
6.Dd April 17, 2024
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 we are connecting to Ethernet
15with the first interface found by the
16.Xr em 4
17driver, and Wi-Fi with the first interface found by the
18.Xr iwn 4
19driver, though your hardware will vary.
20.Sh EXAMPLES
21.Bl -tag -width 0n
22.It Sy Connecting to an Ethernet network with DHCP:
23.Bd -literal -offset 2n
24.Ic # dhclient em0
25.Ed
26.It Sy Connecting to a cellular network with USB tethering:
27.Pp
28Load the USB tethering driver,
29.Xr urndis 4 :
30.Bd -literal -offset 2n
31.Ic # kldload urndis
32.Ed
33.Pp
34Ask for a DHCP lease on the USB tethering interface:
35.Bd -literal -offset 2n
36.Ic # dhclient ue0
37.Ed
38.It Sy Connecting to a Wi-Fi network:
39.Pp
40Identify your Wi-Fi hardware:
41.Bd -literal -offset 2n
42.Ic % sysctl net.wlan.devices
43.Ed
44.Pp
45Configure your Wi-Fi hardware as wlan0 interface:
46.Bd -literal -offset 2n
47.Ic # sysrc wlans_iwn0="wlan0"
48.Ed
49.Pp
50Set that interface to negotiate a DHCP lease with
51.Xr wpa_supplicant 8 :
52.Bd -literal -offset 2n
53.Ic # sysrc ifconfig_wlan0="WPA SYNCDHCP"
54.Ed
55.Pp
56Enter the details of the Wi-Fi network:
57.Bd -literal -offset 2n
58.Ic # wpa_passphrase \(dqmyssid\(dq \(dqmypassphrase\(dq >> wpa_supplicant.conf
59.Ed
60.Pp
61Restart the network interface daemon:
62.Bd -literal -offset 2n
63.Ic # service netif restart
64.Ed
65.Pp
66.It Sy Scanning for Wi-Fi networks:
67.Bd -literal -offset 2n
68.Ic % ifconfig wlan0 scan
69.Ed
70.It Sy Airplane mode:
71.Bd -literal -offset 2n
72.Ic # service netif stop
73.Ed
74.El
75.Sh SEE ALSO
76.Xr bsdconfig 8 ,
77.Xr dhclient 8 ,
78.Xr ifconfig 8 ,
79.Xr wpa_passphrase 8
80.Pp
81The Advanced Networking chapter of the
82.Fx
83Handbook.
84.Sh CAVEATS
85Shell Special Characters in the
86.Ar SSID
87or
88.Ar passphrase
89will need to be escaped for
90.Xr wpa_passphrase 8 ,
91commonly using
92.Ql \e ,
93see the manual page for your shell for more details.
94