Как установить nmtui debian

Обновлено: 30.06.2024

NetworkManager attempts to keep an active network connection available at all times.

The point of NetworkManager is to make networking configuration and setup as painless and automatic as possible. If using DHCP, NetworkManager is intended to replace default routes, obtain IP addresses from a DHCP server and change nameservers whenever it sees fit. In effect, the goal of NetworkManager is to make networking Just Work .

Additionally, there are various plugins available that enable NetworkManager to handle other, special connections like different types of VPN connections.

NetworkManager will only handle interfaces not declared in /etc/network/interfaces (see README file).

NetworkManager keeps connection information on known individual networks in configuration files called profiles. Those are stored at /etc/NetworkManager/system-connections/. For options in these files refer to the manpage on nm-settings: man nm-settings or online. They can be edited (as root) using a text editor or the nm-connection-editor (enclosed in network-manager-gnome).

For changes in configuration to become effective, you may have to restart the NetworkManager daemon:

Starting with Debian 11 (bullseye), use:

Features

The features of NetworkManager are described on its homepage.

Documentation

Wired Networks are Unmanaged

As of Debian 6.0 "Squeeze", NetworkManager does not manage any interface defined in /etc/network/interfaces by default.

Enabling Interface Management

Starting with Debian 11 (bullseye), use:

"Auto Ethernet" and "Auto eth0"

Q. How do I configure a static IP address (for a server, etc) ?

A) Use nm-connection-editor or configure /etc/network/interfaces as described in NetworkConfiguration. Q. How can I configure DNS for NetworkManager?

A) The short answer is to use nm-connection-editor. For the long answer see the corresponding entry in NetworkConfiguration. Q. Why can't I see NetworkManager with my new user account ?

A) Make sure human users are in the netdev group (see /usr/share/doc/network-manager-gnome/README.Debian). Q. How to setup a connection sharing ("hotspot") for a wired interface ?

A) First make sure to install dnsmasq-base (but not dnsmasq unless you disable the system daemon in /etc/default/dnsmasq). Then use nm-connection-editor and setup a new profile using "shared to other computer" as the method for IPv4 (not possible from Gnome3's gnome-control-center). This hides all the complexity (dnsmasq, iptables, sysctl). Finally, use that profile for the network interface connected to the shared network. For Wi-Fi interfaces, a hotspot functionality is provided which uses the same functionality besides setting up an ad-hoc WiFi network.

This page describes how to configure a WiFi interface on a Debian system, for use on a network.

Once your wireless device has an interface available (verifiable by running "ip link show"), it is required to be configured to access a network. If you do not have a wireless interface present, please refer to WiFi for information on obtaining a driver, or the necessary firmware for your device.

Wireless network interface configuration requires a backend, generally wpa_supplicant (often in conjunction with ifupdown and other utilities) or IWD. These can be used with connection managers that provide advanced functionality, and an easier way to configure them. Examples of these would generally be NetworkManager,ConnMan, systemd-networkd, and Wicd.

The WEP algorithm is insecure and deprecated by WPA. Use of WEP is not recommended and is not covered within this document.

  1. How to use a WiFi interface
  2. Automatic
    1. NetworkManager
      1. NetworkManager Frontends
      2. Troubleshooting & Tips for NetworkManager
      1. Network Configuration
      2. Configuring iwd Via iwctl
      3. Setting up DNS resolution for IWD (Simple)
      4. Debugging and Testing
      5. Further reading
      1. Using IWD
      2. Using ifupdown
        1. WPS
        1. WPA-PSK and WPA2-PSK
        2. WPA-EAP

        NetworkManager

        For the average desktop user, the easiest way to configure your network is to install the GUI frontend for NetworkManager that corresponds to your desktop. NetworkManager itself is a frontend for different network backends (wpa_supplicant by default) that abstracts away the configuration and simplifies it. Your wireless interface should not be referenced within Debian's /etc/network/interfaces file.

        NetworkManager Frontends

        NetworkManager on GNOME

        As of GNOME 3, integration with NetworkManager is baked into GNOME Shell, and will appear in the settings and as an icon in the top-right of your screen as long as it's running.

        Open the "Networks" section of your settings, select your network in the list, enter the password as prompted, and you should be ready to surf the web.

        The network-manager-gnome package still exists and provides a systray applet for other desktops, but will not make any difference with GNOME 3.

        See the NetworkManager page for frequently asked questions, documentation and support references.

        NetworkManager on KDE Plasma

        • Click on the desired network's name.
        • If the network uses WPA encryption with a password (aka passphrase/pre-shared key), you will be prompted to enter it. After providing, click the "Connect" button.
        • The wireless network connection will be activated.
        • Click "Connect to Other Wireless Network. ".
        • Enter the network's name in "Name (ESSID)".
        • Tick "Use Encryption" if in use on the network.
          • Select the encryption method used (usually "WPA Personal").
          • Enter the passphrase/pre-shared key at "Password".
          • Select "WPA 1" or "WPA 2" for the protocol version, as used by the network.

          See the NetworkManager page for frequently asked questions, documentation and support references.

          NetworkManager on a generic desktop/headless session

          If there is no GUI frontend available, the "nmcli" and "nmtui" commands are available as CLI and TUI frontends respectively for NetworkManager.

          Troubleshooting & Tips for NetworkManager

          WiFi can scan, but not connect using NetworkManager (Debian 9 Stretch)

          If you find that your wireless network device can scan, but will not complete connecting, try turning off MAC address randomization.

          Write inside /etc/NetworkManager/NetworkManager.conf:

          After doing this, restart NetworkManager with service NetworkManager restart

          Setting up a WiFi hotspot

          In recent years, NetworkManager is sophisticated enough to set up a WiFi hotspot that "just works" (i.e. sets up a local private net, with DHCP and IP forwarding). In some desktops, such as KDE Plasma, a button to create a hotspot is visible in the network applet if two separate wireless network interfaces are present. Alternatively, it can be created manually with a command similar to:

          Changing the backend

          It's possible to replace wpa_supplicant with IWD in NetworkManager in Debian 10 and newer, though Debian 11 is recommended for the best experience as there are known issues with the old version of IWD present in Debian 10. For more information on how to switch, see NetworkManager/iwd.

          IWCtl

          While also available as backend for ConnMan, NetworkManager, and systemd-networkd, it's also possible to nearly base your entire networking stack on one codebase with IWD alone. It's an all-in-one wireless client, wireless daemon, and even a DHCP client optionally! At its best, your entire networking stack can be as minimal as IWD + systemd-resolved, and this works wonderfully for many scenarios. It has virtually zero dependencies and uses modern kernel features as often as possible. Anecdotal reports suggest that it's much faster to connect to networks than wpa_supplicant, and has better roaming support, among other perceived improvements.

          First, install the iwd package. If you've installed wpasupplicant, either uninstall the package, or stop and disable the wpa_supplicant service with:

          Then, ensure that the newly-installed IWD service is enabled and running with with:

          Network Configuration

          If you plan to go the route of using IWD standalone, you should first enable some essential features in IWD's configuration file, which can be found at /etc/iwd/main.conf. Edit this file with root permissions using your favorite editor.

          iwd can be configured to configure the network on its own, without requiring external tools or systems to do so. To enable network configuration, add this section to the configuration file:

          To enable IPv6 support, add this section to the configuration file:

          Note: IPv6 is still somewhat broken as of version 1.19.

          Enabling IPv6 can cause segmentation faults upon connection. Upstream believes that this has been fixed by commit d0f00698245a ("dhcp6: Switch to BOUND before LEASE_OBTAINED"), but acknowledges that "IPv6 support in iwd is still somewhat experimental since we still lack support for SLAAC," although "DHCPv6 should be mostly functional."

          After making changes to iwd's configuration file, restart the service with "service iwd restart" to have them take effect.

          Configuring iwd Via iwctl

          Start the IWCtl client by running iwctl as your standard user (not root!), which will start an interactive prompt. You can run help to get a full list of commands here. (If you actually want to prevent non-root users from configuring iwd, see the directions here.)

          To connect to a Wi-Fi network in the most typical scenario, first type device list to find the name of your wireless device. We will use wlan0 in this example, but your name may be different, and potentially much longer if your system renames interfaces to a unique name.

          After you have the device name, run something like station wlan0 scan to have the device scan for networks. You can then list these networks by running station wlan0 get-networks. After you've found the network you intend to connect to, run station wlan0 connect Router123, replacing Router123 with the name of the network. Put the name of the network in double-quotes if it contains a space. (Note that you can use tab completion to enter the network name, and iwd will even help with the quoting.)

          IWCtl will then prompt you for the passphrase. After entering this, IWD will connect to the network, and store it permanently in the /var/lib/iwd directory. After being added in this way, IWD will attempt to auto-connect to the network in the future.

          Setting up DNS resolution for IWD (Simple)

          If "EnableNetworkConfiguration=true" is set, you'll also need to configure IWD's name resolving service. It supports systemd-resolved and resolvconf. If unspecified, it uses systemd-resolved. Refer to the IWD.CONFIG(5) page if you care about using resolvconf instead.

          If DNS is nonfunctional, you likely need to configure systemd-resolved for use with IWD. Enable and start the systemd-resolved service, if it isn't already, by running:

          Then, symlink /etc/resolv.conf to /run/systemd/resolve/stub-resolv.conf by running:

          That should be enough to get you online. If you want to make changes to your DNS configuration, refer to the /etc/systemd/resolved.conf file, and the associated manpage at RESOLVED.CONF(5)

          Debugging and Testing

          To help diagnose problems, run iwd manually (as opposed to via systemd) with the debug switch: iwd -d.

          Further reading

          The official iwd documentation is here.

          As usual, ?ArchWiki has excellent documentation of iwd usage and configuration.

          Wicd is not available in Debian 11/Bullseye or newer, due to the deprecation of Python 2.

          You must remove network-manager to get wicd to work. Check to see if network-manager is installed and see if, after you installed the driver, your wireless is already working in the notification area of your desktop manager. You may already be good to go.

          wicd (Wireless Interface Connection Daemon) is a lightweight alternative to NetworkManager, using wpa_supplicant as a backend. It is environment-independent, making it suitable for all desktop environments, including GNOME, Xfce, LXDE, and Fluxbox. Like NetworkManager, wicd is configured via a graphical interface. Your wireless interface should not be referenced within Debian's /etc/network/interfaces file.

          Amend /etc/network/interfaces to contain only the following:

          ConnMan

          ConnMan is another network frontend designed for embedded devices. Example usage:

          After the configuration, connman remembers your SSID selections and reusees them automatically. Don't worry about long HEXes - in client mode TAB auto-completion works both for commands and data.

          Using IWD

          Using ifupdown

          Find your wireless interface and bring it up: (NOTE: wlp2s0 is an example, you will need to make sure to use the correct device name for your system)

          Scan for available networks and get network details (If you already know your wifi network id/ESSID, you can skip this step):

          Now edit /etc/network/interfaces. The required configuration is much dependent on your particular setup. The following example will work for most commonly found WPA/WPA2 networks:

          Bring up your interface and verify the connection:

          You can manually bring your interface up and down with the ifup and ifdown commands. If you added allow-hotplug wlp2s0 as in the example above, the interface will be brought up automatically at boot.

          For further information on available configuration options, see man interfaces, man iw, man wireless and /usr/share/doc/wireless-tools/README.Debian.

          WPS-PBC

          Find your WiFi network where WPS is enabled.

          Use wpa_cli to connect to the MAC address provided by the scan.

          Then press the WPS button on your access point to start the PBC mode.

          Once connected, start dhclient to obtain a dynamic IP address.

          wpa_supplicant

          wpa_supplicant is a WPA client and IEEE 802.1X supplicant.

          Before continuing, install the wpasupplicant package.

          WPA-PSK and WPA2-PSK

          If you don't put the passphrase on the command line, it will be prompted for. The above command gives the following output and pipe(write) it to "/etc/wpa_supplicant/wpa_supplicant.conf":

          Since wpa_supplicant v2.6, you need to add following in your /etc/wpa_supplicant/wpa_supplicant.conf in order to function sudo wpa_cli:

          you'll need to copy from "psk=" to the end of the line, to put in your /etc/network/interfaces file.

          Quick connect to the configured network (doesn't require ifupdown):

          Additional wpa-* options are described within /usr/share/doc/wpasupplicant/README.modes.gz. This should also be read if connecting to a network not broadcasting its SSID.

          For general /etc/network/interfaces information, see the interfaces(5) man page.

          WPA-EAP

          For networks using EAP-TLS, you are required to establish a wpa_supplicant configuration file and provide the client-side certificate. An example WPA2-EAP configuration file can be found at /usr/share/doc/wpasupplicant/examples/wpa2-eap-ccmp.conf.

          Once available, reference your configuration file in /etc/network/interfaces. For example:

          3 способа подключения к Wi-Fi из командной строки в Debian

          Советы и хитрости

          В этом руководстве кратко объясняется, как подключиться к Wi-Fi из командной строки в дистрибутивах Linux на основе Debian и Debian 3 различными способами: с помощью nmcli, nmtui и wpa_supplicant. В дополнение к nmcli, nmtui и wpa_supplicant используются команды iwconfig, iwlist и dhclient, которые кратко объясняются в этом руководстве.

          Обнаружение сетей с помощью Iwconfig

          Перед тем как начать, нам нужно знать essid или имя сети, к которой мы хотим подключиться.

          В этом руководстве показано, как использовать команду Iwconfig для сканирования доступных сетей. Iwconfig похож на команду ifconfig, но для управления беспроводными интерфейсами. Эта команда позволяет пользователю редактировать частоту или канал, изменять режим сетевого устройства (Ad-hoc, Managed, Master, Repeater, Monitor, Secondary), устанавливать ESSID и т. Д.

          ПРИМЕЧАНИЕ. SSID / ESSID — это имена или идентификаторы сети или маршрутизатора.

          Чтобы проверить, правильно ли обнаружена карта Wi-Fi, сначала выполните команду iwconfig, как показано на следующем снимке экрана:

          Чтобы проверить, правильно ли обнаружена карта Wi-Fi

          Как вы можете видеть, выходные данные показывают интерфейс loopback (lo), карту Ethernet (enp2s0) и карту Wi-Fi wlp3s0, которые мы будем использовать для сканирования доступных сетей с помощью команды Iwlist.

          Первая строка показывает поддержку стандартов 802.11 и показывает, что устройство не подключено. Вторая строка показывает, что карта Wi-Fi находится в управляемом режиме и не связана с точкой доступа.

          Третья строка включает Retry Short Limit, который определяет количество попыток после неудачной передачи, и RTS Threshold, определяющий количество подтверждений до соединения, Fragment Thr показывает максимальный размер пакета, который отправит ваша карта.

          Последние две строки показывают, что аутентификация отсутствует и управление питанием выключено.

          Команда Iwlist предоставляет дополнительную информацию о беспроводных устройствах, в том числе о тех, которые не являются частью нашего компьютера. В этом случае мы просканируем доступные сети, добавив сканирование аргументов. На выходе будет отображен список точек доступа с некоторой информацией, такой как ESSID, качество сигнала, канал, режим и т.д.

          Выполните следующую команду, чтобы распечатать список доступных сетей:

          ПРИМЕЧАНИЕ. Замените wlp3s0 вашей беспроводной картой, отображаемой при выполнении команды iwconfig.

          Как видите, в выходных данных показано несколько сетей

          Как видите, в выходных данных показано несколько сетей, включая точку доступа LinuxHint, но формат неудобен для пользователя. Если вы хотите распечатать только ESSID или имена доступных сетей, опуская остальные, запустите:

          Как вы можете видеть, вывод понятен и ограничен именами точек доступа

          Как вы можете видеть, вывод понятен и ограничен именами точек доступа (essid).

          Подключение к Wi-Fi из командной строки с помощью nmcli

          NMCLI — это интерфейс командной строки для NetworkManager, который можно использовать как альтернативу графическим менеджерам. NMCLI позволяет пользователю создавать, редактировать и удалять или включать и отключать соединения, а также отображать состояние устройства.

          Следующий синтаксис показывает, как подключиться к сети LinuxHint (обнаруженной с помощью ранее использованной команды Iwlist) путем выполнения nmcli со следующими аргументами:

          Следующий синтаксис показывает, как подключиться к сети LinuxHint

          Где d wifi указывает беспроводное устройство, подключение LinuxHint указывает ессид и пароль морочита пароль.

          ПРИМЕЧАНИЕ. Замените LinuxHint на ssid вашего маршрутизатора и morochita на ваш фактический пароль.

          Подключение к wifi с консоли с помощью nmtui

          Nmtui — это интерактивная альтернатива nmcli и Network Manager на основе curses при запуске консоли:

          Nmtui — это интерактивная альтернатива nmcli и Network Manager

          Первый экран позволяет нам редактировать существующее соединение, активировать новое соединение и редактировать наше имя хоста. Выберите второй вариант Активировать соединение и нажмите ENTER.

          Первый экран позволяет нам редактировать существующее соединение

          Nmtui покажет как проводные, так и беспроводные доступные сети. Выберите свою точку доступа и нажмите ENTER.

          Примечание: для этого примера ESSID был изменен с LinuxHint на LinuxH1nt, чтобы показать шаг запроса пароля.

          Nmtui покажет как проводные, так и беспроводные доступные сети

          На следующем экране будет запрошен пароль, введите его и нажмите ENTER, чтобы продолжить.

          На следующем экране будет запрошен пароль, введите его и нажмите ENTER

          И вы будете связаны.

          Вы можете получить дополнительную информацию о Nmtui на странице руководства по адресу

          Подключитесь к Wi-Fi с помощью wpa_supplicant

          Wpa_supplicant — это соискатель, который разрешает согласование в процессе аутентификации. В отличие от nmcli и nmtui, wpa_supplicant по умолчанию не устанавливается в Debian.

          Чтобы установить wpa_supplicant в системах на базе Debian, выполните:

          Чтобы установить wpa_supplicant в системах на базе Debian, выполните

          Вам нужно отредактировать файл /etc/wpa_supplicant.conf, добавив essid и пароль вашей точки доступа, вы можете добиться этого, выполнив следующую команду:

          wpa_passphrase LinuxHint morochita | sudo tee / etc / wpa_supplicant.conf

          ПРИМЕЧАНИЕ. Замените LinuxHint на ваш essid и morochita на ваш фактический пароль. Вы можете использовать кавычки для сетевых имен, содержащих пробелы.

          После редактирования wpa_supplicant.conf вы можете подключиться, выполнив следующую команду

          После редактирования wpa_supplicant.conf вы можете подключиться, выполнив следующую команду, где -c указывает файл конфигурации, а -i указывает сетевой интерфейс:

          sudo wpa_supplicant -c / etc / wpa_supplicant.conf -i wlp3s0

          Как вы можете видеть с помощью iwconfig

          Как вы можете видеть с помощью iwconfig, теперь ваша беспроводная карта связана с точкой доступа.

          Для подключения запустите команду dhclient, как показано на следующем снимке экрана

          Для подключения запустите команду dhclient, как показано на следующем снимке экрана, чтобы получить динамический IP-адрес:

          ПРИМЕЧАНИЕ. Замените wlp3s0 своей беспроводной картой.

          После запуска dhclient вы должны быть подключены к Интернету через соответствующую точку доступа

          После запуска dhclient вы должны быть подключены к Интернету через соответствующую точку доступа.

          Надеюсь, вы нашли это руководство полезным для подключения к Wi-Fi из командной строки в системах на основе Debian. Следите за LinuxHint, чтобы получить больше руководств и советов по Linux.

          Как запустить графический интерфейс Debian в Windows 10 с помощью WSL

          Советы и хитрости

          Microsoft Windows — популярная операционная система. В Windows 10 появилась новая функция под названием WSL (подсистема Windows для Linux). Это дополнительная функция, которая позволяет разработчикам и опытным пользователям запускать среду GNU / Linux непосредственно в Windows без необходимости в традиционной виртуализации или конфигурации двойной загрузки.

          В этом руководстве вы узнаете, как запустить графический интерфейс Debian в Windows 10 с помощью WSL.

          Debian на WSL

          Инструмент WSL изначально был разработан Microsoft в сотрудничестве с Canonical, создателем Ubuntu. По сути, это уровень совместимости с ядром, основанный на Ubuntu.

          В 2020 году Microsoft выпустила WSL 2. Он предлагает несколько важных улучшений по сравнению с WSL 1. Он предлагает лучшую совместимость системы, лучшее управление виртуальными машинами, полную поддержку ядра Linux и многое другое. Посмотрите разницу между WSL 1 и WSL 2. Обратите внимание, что WSL 2 доступен только для Windows 10 версии 2004, сборка 19041 или выше. Выполните следующую команду, чтобы проверить версию Windows 10, которую вы используете.

          Поскольку WSL изначально был основан на Ubuntu

          Поскольку WSL изначально был основан на Ubuntu, он по умолчанию поддерживает Debian. Debian для WSL доступен в Microsoft Store. Однако мы продемонстрируем, как установить Debian даже без учетной записи Microsoft.

          В случае Windows все команды будут выполняться в Windows PowerShell с правами администратора. Это Linux-эквивалент запуска оболочки sudo. Чтобы запустить PowerShell с правами администратора, нажмите «Win + X» и выберите «Windows PowerShell (Admin)».

          В случае Windows все команды будут выполняться в Windows PowerShell

          Включение WSL

          Дополнительные функции, такие как WSL, по умолчанию не включены. К счастью, включить WSL очень просто. Выполните следующую команду в PowerShell.

          Читайте также: