Red hat enterprise linux wifi
Рассмотрим конфигурирование сети в операционных системах по управлением Red Hat Enterprise Linux (RHEL) / CentOS / Fedora.
Коротко о дистрибутивах:
Red Hat Enterprise Linux (RHEL) — Операционная система на снове Linux выпускаемая компанией Red Hat для корпоративного использования и распространяется по годовой платной подписке. Состоит из хорошо провереных и отлаженных компонентов.
Fedora — Операционная система выпускаемая также компанией Red Hat, но в отличие от RHEL проект Fedora распространяется свободно, на Fedore тестируются новых разработки компании Red Hat, которые в дальнейшем уже испольуются для корпоративно дистрибутива RHEL.
CentOS — Операционная система основанная на исходном коде RHEL и по сути является ее клоном. Проект был создан и поддерживается интернациональной командой энтузиастов.
Основные конфигурационные файлы.
Сетевые настройка осуществляется методом правки конфигурационных файлов, т.к. Fedora и CentOS основаны на RHEL, то и сами файлы настроек и их расположение однинаковое, поэтому дальнейшие примеры настроек будут подходить ко всем трем дистрибутивам.
Файл настройки общей интформации /etc/sysconfig/network
В этом файле задается сетевое имя компьютера (HOSTNAME), дефолтный маршрут (GATEWAY), DNS-домен (DOMAINNAME).
Пример конфигурации в файле network для Red Hat / CentOS / Fedora.
Скрипты настройки сетевых интерфейсов /etc/sysconfig/network-scripts/ifcfg-*
В этих файлах настраиваются основные данные для сетевых интерфейсов такие как ip адрес (IPADDR), сетевая маска (NETMASK), адрес сети (NETWORK), braodcast адрес (BROADCAST). Под звездочкой понимается имя сетевого интерфейса, например eth0, eth1, eth2, lo и т.п., зависит от количества установленных сетевых карт в системе.
Приведу пример файла cо статической настройкой сетевых параметров интерфейса eth0 для Red Hat / CentOS / Fedora.
Пример файла с настройкой интерфейса eth1 на получаение сетевых адресов по протоколу DHCP для Red Hat / CentOS / Fedora.
Также во всех система присуствует файл с настройками loopback интерфеса (lo).
Файл настройки статических маршрутов /etc/sysconfig/static-routes
Все записи о статических маршрутах содержащемся в этом файле будут автоматически добавлены при загрузке системы в таблицу маршрутизации. В формае записи маршрута сначала идет интерфейс, можно указать any, что будет означать любой интерфейс, потом идет тип маршрута (host — адрес хоста или net — адрес сети) , сеть, маска данной сети, и шлюз.
Скрипт для настройки статических маршрутов для конкретного интерфейса /etc/sysconfig/network-scripts/route-eth0
Если данного файла вы ненайдете в системе неотчаивайтеь просто создайте его и пропишити нужный вам маршрут.
Файл /etc/hosts
Впоследнее время неактуален раньше использовался для соответствия списока ip-адресов и символьных имен.
Файл настроек DNS серверов /etc/resolv.conf
В этом файле перечисляется список ip адресов DNS серверов.
Управление сетевыми интерфейсами.
Для просмотра состояния и конфигурации интерфейса существуют специальные команды.
Посмотреть таблицу маршрутизации модно используя команду:
В Red Hat Enterprise Linux (RHEL) / CentOS / Fedora существуют специальные сценарии для управления сетевыми интерфейсами.
Сценарии ifup и ifdown позволяют включить или отключить сетевой интерфейс. В качестве аргумента эти сценарии принемают имя интерфейса.
Сценарий service network или /etc/init.d/network позволяют включить (start), отключить (stop) или перезапустить (restart) все интерфейсы разом.
И на последок, функция маршрутизации между интерфейсами по умолчанию отключена, однако ее можно включить для этого надо добавить в файл /ete/sysctl.conf запись net.ipv4.ip_forward=1 и перезапустить систему.
На этом рассмотрение настройки сети в операционных системах Red Hat Enterprise Linux (RHEL) / CentOS / Fedora завершено.
1″ :pagination=»pagination» :callback=»loadData» :options=»paginationOptions»>
Red Hat Customer Portal
Log in to Your Red Hat Account
Your Red Hat account gives you access to your profile, preferences, and services, depending on your status.
If you are a new customer, register now for access to product evaluations and purchasing capabilities.
Need access to an account?
If your company has an existing Red Hat account, your organization administrator can grant you access.
Red Hat Account
Customer Portal
For your security, if you’re on a public computer and have finished using your Red Hat services, please be sure to log out.
Select Your Language
Chapter 12. Managing Wi-Fi connections
This section describes how to configure and manage Wi-Fi connections.
12.1. Setting the wireless regulatory domain
In Red Hat Enterprise Linux, the crda package contains the Central Regulatory Domain Agent that provides the kernel with the wireless regulatory rules for a given jurisdiction. It is used by certain udev scripts and should not be run manually unless debugging udev scripts. The kernel runs crda by sending a udev event upon a new regulatory domain change. Regulatory domain changes are triggered by the Linux wireless subsystem (IEEE-802.11). This subsystem uses the regulatory.bin file to keep its regulatory database information.
The setregdomain utility sets the regulatory domain for your system. Setregdomain takes no arguments and is usually called through system script such as udev rather than manually by the administrator. If a country code look-up fails, the system administrator can define the COUNTRY environment variable in the /etc/sysconfig/regdomain file.
Additional resources
See the following man pages for more information about the regulatory domain:
- setregdomain(1) man page — Sets regulatory domain based on country code.
- crda(8) man page — Sends to the kernel a wireless regulatory domain for a given ISO or IEC 3166 alpha2.
- regulatory.bin(5) man page — Shows the Linux wireless regulatory database.
- iw(8) man page — Shows or manipulates wireless devices and their configuration.
12.2. Configuring a Wi-Fi connection using nmcli
This procedure describes how to configure a Wi-fi connection profile using nmcli.
Prerequisites
- The nmcli utility to be installed.
Make sure that the WiFi radio is on (default):
Procedure
To create a Wi-Fi connection profile with static IP configuration:
Set a DNS server. For example, to set 192.160.100.1 as the DNS server:
Optionally, set a DNS search domain. For example, to set the search domain to example.com :
To check a specific property, for example mtu :
To change the property of a setting:
To verify the change:
Verification steps
Use the ping utility to verify that this host can send packets to other hosts.
Ping an IP address in the same subnet. For example:
If the command fails, verify the IP and subnet settings.
Ping an IP address in a remote subnet. For example:
If the command fails, ping the default gateway to verify settings.
Use the host utility to verify that name resolution works. For example:
If the command returns any error, such as connection timed out or no servers could be reached , verify your DNS settings.
Additional resources
- See the nm-settings(5) man page for more information on properties and their settings.
- If the configuration on the disk does not match the configuration on the device, starting or restarting NetworkManager creates an in-memory connection that reflects the configuration of the device. For further details and how to avoid this problem, see NetworkManager duplicates a connection after restart of NetworkManager service.
12.3. Configuring a Wi-Fi connection using control-center
When you connect to a Wi-Fi , the network settings are prefilled depending on the current network connection. This means that the settings will be detected automatically when the interface connects to a network.
This procedure describes how to use control-center to manually configure the Wi-Fi settings.
Procedure
- Press the Super key to enter the Activities Overview , type Wi-Fi and press Enter . In the left-hand-side menu entry you see the list of available networks.
Select the gear wheel icon to the right of the Wi-Fi connection name that you want to edit, and the editing connection dialog appears. The Details menu window shows the connection details where you can make further configuration.
Options
- If you select Connect automatically , NetworkManager auto-connects to this connection whenever NetworkManager detects that it is available. If you do not want NetworkManager to connect automatically, clear the check box. Note that when the check box is clear, you have to select that connection manually in the network connection icon’s menu to cause it to connect.
- To make a connection available to other users, select the Make available to other users check box.
You can also control the background data usage. If you leave Restrict background data usage unspecified (default), then NetworkManager tries to download data that you are actively using. Otherwise, select the check box and NetworkManager sets the connection as metered, and applies restriction on the background data usage.
To delete a Wi-Fi connection, click the Forget Connection red box.
Select the Identity menu entry to see the basic configuration options.
SSID — The Service Set Identifier (SSID) of the access point (AP).
BSSID — The Basic Service Set Identifier (BSSID) is the MAC address, also known as a hardware address , of the specific wireless access point you are connecting to when in Infrastructure mode. This field is blank by default, and you are able to connect to a wireless access point by SSID without having to specify its BSSID . If the BSSID is specified, it will force the system to associate to a specific access point only. For ad-hoc networks, the BSSID is generated randomly by the mac80211 subsystem when the ad-hoc network is created. It is not displayed by NetworkManager .
MAC address — The MAC address allows you to associate a specific wireless adapter with a specific connection (or connections).
Cloned Address — A cloned MAC address to use in place of the real hardware address. Leave blank unless required.
For further IP address configuration , select the IPv4 and IPv6 menu entries.
By default, both IPv4 and IPv6 are set to automatic configuration depending on current network settings. This means that addresses such as the local IP address, DNS address, and other settings will be detected automatically when the interface connects to a network. If a DHCP server assigns the IP configuration in this network, this is sufficient, but you can also provide static configuration in the IPv4 and IPv6 Settings. In the IPv4 and IPv6 menu entries, you can see the following settings:
- Automatic (DHCP) — Choose this option if the network you are connecting to uses Router Advertisements (RA) or a DHCP server to assign dynamic IP addresses. You can see the assigned IP address in the Details menu entry.
- Link-Local Only — Choose this option if the network you are connecting to does not have a DHCP server and you do not want to assign IP addresses manually. Random addresses will be assigned as per RFC 3927 with prefix 169.254/16 .
- Manual — Choose this option if you want to assign IP addresses manually.
- Disable — IPv4 is disabled for this connection.
If Automatic is ON , and no DHCP server is available that assigns DNS servers to this connection, switch it to OFF to enter the IP address of a DNS server separating the IPs by comma.
Note that in the Routes section, when Automatic is ON , routes from Router Advertisements (RA) or DHCP are used, but you can also add additional static routes. When OFF , only static routes are used.
- Address — Enter the IP address of a remote network, sub-net, or host.
- Netmask — The netmask or prefix length of the IP address entered above.
- Gateway — The IP address of the gateway leading to the remote network, sub-net, or host entered above.
- Metric — A network cost, a preference value to give to this route. Lower values will be preferred over higher values.
Use this connection only for resources on its network
Select this check box to prevent the connection from becoming the default route.
Alternatively, to configure IPv6 settings in a Wi-Fi connection, select the IPv6 menu entry:
- Automatic — Choose this option to use IPv6 Stateless Address AutoConfiguration (SLAAC) to create an automatic, stateless configuration based on the hardware address and Router Advertisements (RA).
- Automatic, DHCP only — Choose this option to not use RA, but request information from DHCPv6 directly to create a stateful configuration.
- Link-Local Only — Choose this option if the network you are connecting to does not have a DHCP server and you do not want to assign IP addresses manually. Random addresses will be assigned as per RFC 4862 with prefix FE80::0 .
- Manual — Choose this option if you want to assign IP addresses manually.
- Disable — IPv6 is disabled for this connection.
To configure Security settings in a Wi-Fi connection, select the Security menu entry. The following configuration options are available:
Security
- None — Do not encrypt the Wi-Fi connection.
- WEP 40/128-bit Key — Wired Equivalent Privacy (WEP), from the IEEE 802.11 standard. Uses a single pre-shared key (PSK).
WEP 128-bit Passphrase — An MD5 hash of the passphrase to derive a WEP key.
If the Wi-Fi use no encryption, WEP , or WPA , do not use the network because it is insecure and everyone can read the data you send over this network.
When you add a new connection by clicking the plus button, NetworkManager creates a new configuration file for that connection and then opens the same dialog that is used for editing an existing connection. The difference between these dialogs is that an existing connection profile has a Details menu entry.
12.4. Connecting to a Wi-Fi network with nmcli
This procedure describes how to connect to a wireless connection using the nmcli utility.
Prerequisites
- The nmcli utility to be installed.
Make sure that the WiFi radio is on (default):
Procedure
To refresh the available Wi-Fi connection list:
To view the available Wi-Fi access points:
To connect to a Wi-Fi connection using nmcli :
Note that if you want to disable the Wi-Fi state:
12.5. Connecting to a hidden Wi-Fi network using nmcli
All access points have a Service Set Identifier (SSID) to identify them. However, an access point may be configured not to broadcast its SSID, in which case it is hidden, and will not show up in NetworkManager’s list of Available networks.
This procedure shows how you can connect to a hidden network using the nmcli tool.
Prerequisites
- The nmcli utility to be installed. *
- To know the SSID, and password of the Wi-Fi connection.
- Make sure that the WiFi radio is on (default):
Procedure
Connect to the SSID that is hidden:
12.6. Connecting to a Wi-Fi network using the GNOME GUI
This procedure describes how you can connect to a wireless network to get access to the Internet.
Procedure
- Open the GNOME Shell network connection icon menu from the top right-hand corner of the screen.
- Select Wi-Fi Not Connected .
- Click the Select Network option.
Click the name of the network to which you want to connect, and then click Connect .
Note that if you do not see the network, the network might be hidden.
If the network is protected by a password or encryption keys are required, enter the password and click Connect .
Note that if you do not know the password, contact the administrator of the Wi-Fi network.