From nobody Tue May 21 20:09:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VkQWP1kNwz5M9F2; Tue, 21 May 2024 20:09:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VkQWP07rmz4DkQ; Tue, 21 May 2024 20:09:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716322161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SYaYT/tdIP8028DDS/UpfbYmpwLVi/VLpDe0YuANaAE=; b=fuTYuazN5XYVDqnSchDw0+9dT8UW6JLOdyWTkmbcgCK6vQe5PikDAP9zCxUizlL0wtI1Sf e5l9whlT7kYSrlBcwtX01HMYURB45onoA+8oxONMo8MwdmNHtVyxAEEk+KiCv1gNeBlVjw mtAkXrJtZxCi4EERAH2SWuYi6XPKAzJ6aGVhgQnSU3BVVLvGhll48pdYf51E6/HAbLkuMp VWca3iVhXbM+u/8JaUfeWbJNgRAEd5JH3o8fPUbuU3iJ3lwxsTyTFhQgx6iSWx35BieN08 AmG2BTRsbfw+C9AtEEWAq/njS+F/r4BJWUOUqhh5m03AshWc145/hYX40ELaHA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716322161; a=rsa-sha256; cv=none; b=GDT7tybjSnjGd5vcgayYU/Zaw9jyWZnS+tkK4SYri5gMR8/OyJO23Z2DNGAYkHBfaC2bkN 4UjMH1E4GAsIbqCLJ6CgxK40uZ/cDPSMgaPqCZGEPPSg7eIkCipSkVycBG4cu9qkubIk7+ M+dEfz7sVFRKNOIk0/g2+SwLNtnnbLZ9QTNFINmUiBqHbcA+7s2JdBolB0r8YivA/4XSy/ hn6J3V2wRcwLmK7P9eO+B6LuBai8XPMhlyCPTLjZNJvTnoerQgV7m3mnblqdQ6/Jnmi2cv rkNXzh0vd0EIrlAe51ESn4kSGPVk4rsIN4+Dv/SeRfrkxsK8a6ly05dS5KroMw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716322161; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SYaYT/tdIP8028DDS/UpfbYmpwLVi/VLpDe0YuANaAE=; b=c+r9xICSLZfUOIYf74cu8Y9UPQYeEZC4xsYUOhafT9guT7ZCOfNQCpLwKYKu+KCPnp0ddn EeSlHr1jHbPKrvZfBAfxnU+lsBVXGnGKFpGYwYU+jxXm+uhc2orfQyNIw0dbqSzaw359mZ DSuQohjcEqxap3PowhmLcWkH+PIgEVRL41SVfaS+rrjVpg1uTCVZWadB8Cd8e7kZaLegR0 yuR0A4Kc9OxeEUCjTO+iZBz/v36rWBQH3maKWpOwwrTvuuSSWgDxEu5ofV+s85vrzaLxNy 6jsoPNADjhKyzGCmz1vdlwBPbZCl+KxA8bSgSKXqyg8+DdgEHj8VK8uAPMLhQg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VkQWN6sqFzbs0; Tue, 21 May 2024 20:09:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44LK9KM3043942; Tue, 21 May 2024 20:09:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44LK9KYv043939; Tue, 21 May 2024 20:09:20 GMT (envelope-from git) Date: Tue, 21 May 2024 20:09:20 GMT Message-Id: <202405212009.44LK9KYv043939@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 39f92a4c4c49 - releng/14.1 - networking.7 : create network quickstart guide List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 39f92a4c4c49490e8a3a4549fae054c0e59f6459 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=39f92a4c4c49490e8a3a4549fae054c0e59f6459 commit 39f92a4c4c49490e8a3a4549fae054c0e59f6459 Author: Alexander Ziaee AuthorDate: 2024-04-17 15:51:35 +0000 Commit: Warner Losh CommitDate: 2024-05-21 20:09:04 +0000 networking.7 : create network quickstart guide Now that the handbook has been moved to ports, I think it's very nice to have a network quickstart guide in-band, in base, in the system manual. If the user uses any of the following terms "man -k {network,networking,wifi,quickstart}" this page will come up, which is I think a very common use case for new users. Currently, this document explains connecting to a basic Ethernet network, a basic wifi network, scanning for wifi networks, and airplane mode, as well as linking to other sections, including the handbook Co-authored-by: Graham Perrin Reviewed by: imp, bcr, freebsd@igalic.co Pull Request: https://github.com/freebsd/freebsd-src/pull/833 (cherry picked from commit 75eda0096bf83b9b88996d9903b5d4e504047eba) (cherry picked from commit 5dced41439109368a8f3c9a818fe518542d7063e) Approved-by: re (cperciva) --- share/man/man7/Makefile | 5 +++ share/man/man7/networking.7 | 101 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+) diff --git a/share/man/man7/Makefile b/share/man/man7/Makefile index 11246195201c..7f506c1dfc5f 100644 --- a/share/man/man7/Makefile +++ b/share/man/man7/Makefile @@ -47,6 +47,11 @@ MLINKS+= c.7 c11.7 MLINKS+= c.7 c17.7 MLINKS+= c.7 c2x.7 +.if ${MK_INET} != "no" +MAN+= networking.7 +MLINKS+= networking.7 wifi.7 +.endif + .if ${MK_TESTS} != "no" ATF= ${SRCTOP}/contrib/atf .PATH: ${ATF}/doc diff --git a/share/man/man7/networking.7 b/share/man/man7/networking.7 new file mode 100644 index 000000000000..869812c05a9b --- /dev/null +++ b/share/man/man7/networking.7 @@ -0,0 +1,101 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2024 Alexander Ziaee +.\" +.Dd April 17, 2024 +.Dt "NETWORKING" 7 +.Os +.Sh NAME +.Nm networking , +.Nm wifi +.Nd quickstart guide to connecting to a network +.Sh DESCRIPTION +In the following examples, it is assumed that we are connecting to Ethernet +with the first interface found by the +.Xr em 4 +driver, and Wi-Fi with the first interface found by the +.Xr iwn 4 +driver, though your hardware will vary. +.Sh EXAMPLES +.Bl -tag -width 0n +.It Sy Connecting to an Ethernet network with DHCP: +.Bd -literal -offset 2n +.Ic # dhclient em0 +.Ed +.It Sy Connecting to a cellular network with USB tethering: +.Pp +Load the USB tethering driver, +.Xr urndis 4 : +.Bd -literal -offset 2n +.Ic # kldload urndis +.Ed +.Pp +Ask for a DHCP lease on the USB tethering interface: +.Bd -literal -offset 2n +.Ic # dhclient ue0 +.Ed +.It Sy Connecting to a Wi-Fi network: +.Pp +Identify your Wi-Fi hardware: +.Bd -literal -offset 2n +.Ic % sysctl net.wlan.devices +.Ed +.Pp +Configure your Wi-Fi hardware as wlan0 interface: +.Ed +.Bd -literal -offset 2n +.Ic # sysrc wlans_iwn0="wlan0" +.Ed +.Pp +Set that interface to negotiate a DHCP lease with +.Xr wpa_supplicant 8 : +.Bd -literal -offset 2n +.Ic # sysrc ifconfig_wlan0="WPA SYNCDHCP" +.Ed +.Pp +Enter the details of the Wi-Fi network: +.Bd -literal -offset 2n +.Ic # wpa_passphrase \(dqmyssid\(dq \(dqmypassphrase\(dq >> wpa_supplicant.conf +.Ed +.Pp +Restart the network interface daemon: +.Bd -literal -offset 2n +.Ic # service netif restart +.Ed +.Pp +.It Sy Scanning for Wi-Fi networks: +.Bd -literal -offset 2n +.Ic % ifconfig wlan0 scan +.Ed +.It Sy Airplane mode: +.Bd -literal -offset 2n +.Ic # service netif stop +.Ed +.El +.Sh SEE ALSO +.Xr bsdconfig 8 , +.Xr dhclient 8 , +.Xr ifconfig 8 , +.Xr wpa_passphrase 8 +.Pp +The Advanced Networking chapter of the +.Fx +Handbook. +.Sh CAVEATS +Shell Special Characters in the +.Ar SSID +or +.Ar passphrase +will need to be escaped for +.Xr wpa_passphrase 8 , +commonly using +.Ql \e , +see the manual page for your shell for more details. +.Pp +Currently +.Ql Ic service netif restart +does not restart routing. +A common workaround is to issue +.Ql Ic service netif restart && service routing restart +instead.