0

After I stuck for 1,5 weeks trying install wifi card and setup an access point on CentOS 8 I found out accidentially, that the driver for the card is only supported by minimum kernel 5.1

So I tried first to install new kernel, but still with no success with the wifi card.

Then, finally, I switched to CentOS stream 9 (kernel 5.15).

How do I make an access point?

1 Answer 1

0

Googling around I found NetworkManager-wifi to be a nessecary package to be installed, among with others.

This is a short tutorial to setup the access point, the quick'n NOT dirty way. I needed exactly 25 minutes from finished fresh installation of a server without GUI, with no extra packages, until the 1st successful wifi connection with the iPad and the Mac Air.

I will not do a lot of efforts with comments for every step, you will know what does it mean, if you deal with CentOS :-) Most parts are only for checking and monitoring of the state at the actual point, two parts (NetworkManager.conf and dhcpd.conf) are ready for copy and paste, and minor adaptions.

This tutorial is tested twice on the following hardware:

  • Gigabyte mini PC BRIX BACE-3000, 8GB DDR3, 120GB SSD, Intel wifi 6E ax210ngf vPro
  • Gigabyte mini PC BRIX BACE-3160, 8GB DDR3, 120GB SSD, Intel wifi 3160ngf

This tutorial is based on the following howtos, with minor changes and adaptions:

For the access point without hostapd (in German). For dhcpd.conf (in English, skip the hostapd part and scroll down)


Let's start

sudo yum -y update
sudo yum -y install NetworkManager-wifi wpa_supplicant dhcp-server
[admin@ddpos-server ~]$ iw list | less
Supported interface modes:
                 * IBSS
                 * managed
                 * AP       <--- IMPORTANT
                 * AP/VLAN
                 * monitor
                 * P2P-client
                 * P2P-GO
                 * P2P-device
             
[admin@ddpos-server ~]$ nmcli device status
DEVICE  TYPE      STATE            CONNECTION 
enp3s0  ethernet  verbunden        enp3s0     
lo      loopback  nicht verwaltet  --         
wlp2s0  wifi      nicht verwaltet  --
     

[admin@ddpos-server ~]$ nmcli connection show
NAME    UUID                                  TYPE      DEVICE 
enp3s0  3c78a4d1-4497-3582-91cc-5de458039174  ethernet  enp3s0 


[admin@ddpos-server ~]$ nmcli device show wlp2s0
GENERAL.DEVICE:                         wlp2s0
GENERAL.TYPE:                           wifi
GENERAL.HWADDR:                         E4:02:9B:F0:84:35
GENERAL.MTU:                            1500
GENERAL.STATE:                          10 (nicht verwaltet)
GENERAL.CONNECTION:                     --
GENERAL.CON-PATH:                       --
IP4.GATEWAY:                            --
IP6.GATEWAY:                            --

[admin@ddpos-server ~]$ nmcli -f GENERAL device show wlp2s0
GENERAL.DEVICE:                         wlp2s0
GENERAL.TYPE:                           wifi
GENERAL.NM-TYPE:                        NMDeviceGeneric
GENERAL.DBUS-PATH:                      /org/freedesktop/NetworkManager/Devices/3
GENERAL.VENDOR:                         Intel Corporation
GENERAL.PRODUCT:                        Wireless 3160 (Dual Band Wireless AC 3160)
GENERAL.DRIVER:                         iwlwifi
GENERAL.DRIVER-VERSION:                 5.14.0-17.el9.x86_64
GENERAL.FIRMWARE-VERSION:               17.3216344376.0 3160-17.ucode
GENERAL.HWADDR:                         E4:02:9B:F0:84:35
GENERAL.MTU:                            1500
GENERAL.STATE:                          10 (nicht verwaltet)
GENERAL.REASON:                         0 (Kein Grund angegeben)
GENERAL.IP4-CONNECTIVITY:               0 (unbekannt)
GENERAL.IP6-CONNECTIVITY:               0 (unbekannt)
GENERAL.UDI:                            /sys/devices/pci0000:00/0000:00:1c.1/0000:02:00.0/ne>
GENERAL.PATH:                           pci-0000:02:00.0
GENERAL.IP-IFACE:                       wlp2s0
GENERAL.IS-SOFTWARE:                    nein
GENERAL.NM-MANAGED:                     nein
GENERAL.AUTOCONNECT:                    ja
GENERAL.FIRMWARE-MISSING:               nein
GENERAL.NM-PLUGIN-MISSING:              ja
GENERAL.PHYS-PORT-ID:                   --
GENERAL.CONNECTION:                     --
GENERAL.CON-UUID:                       --
GENERAL.CON-PATH:                       --
GENERAL.METERED:                        unbekannt

Edit Network Manager configuration: sudo nano /etc/NetworkManager/NetworkManager.conf and copy and paste:

[device]
wifi.scan-rand-mac-address=no
# Fehlermeldung "CTRL-EVENT-SCAN-FAILED ret=-95 retry=1" beheben
# match-device=driver:iwlwifi    # <-- UNCOMMENT "# match-dev..." IF NECESSARY

[ifupdown]
managed=false

[main]
plugins=ifupdown,keyfile

Then restart Network Manager:

sudo systemctl restart NetworkManager
[admin@ddpos-server ~]$ sudo systemctl status NetworkManager

● NetworkManager.service - Network Manager
     Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset:>
     Active: active (running) since Fri 2021-12-03 15:31:57 CET; 11s ago
       Docs: man:NetworkManager(8)
   Main PID: 41085 (NetworkManager)
      Tasks: 4 (limit: 47936)
     Memory: 3.1M
        CPU: 214ms
     CGroup: /system.slice/NetworkManager.service
             └─41085 /usr/sbin/NetworkManager --no-daemon

Dez 03 15:31:57 ddpos-server-3160.ddpos NetworkManager[41085]: <info>  [1638541917.8406] man>
Dez 03 15:31:57 ddpos-server-3160.ddpos NetworkManager[41085]: <info>  [1638541917.8494] dev>
Dez 03 15:31:57 ddpos-server-3160.ddpos NetworkManager[41085]: <info>  [1638541917.8497] Wi->
Dez 03 15:31:57 ddpos-server-3160.ddpos NetworkManager[41085]: <info>  [1638541917.8504] man>
Dez 03 15:31:57 ddpos-server-3160.ddpos NetworkManager[41085]: <info>  [1638541917.8516] dev>
Dez 03 15:31:57 ddpos-server-3160.ddpos NetworkManager[41085]: <info>  [1638541917.8532] dev>
Dez 03 15:31:57 ddpos-server-3160.ddpos NetworkManager[41085]: <info>  [1638541917.8590] dev>
Dez 03 15:31:57 ddpos-server-3160.ddpos NetworkManager[41085]: <info>  [1638541917.9982] dhc>
Dez 03 15:31:58 ddpos-server-3160.ddpos NetworkManager[41085]: <info>  [1638541918.0068] dhc>
Dez 03 15:32:01 ddpos-server-3160.ddpos NetworkManager[41085]: <info>  [1638541921.2296] man>
sudo systemctl restart wpa_supplicant
[admin@ddpos-server ~]$ sudo nmcli connection show
NAME     UUID                                  TYPE      DEVICE 
enp3s0   3c78a4d1-4497-3582-91cc-5de458039174  ethernet  enp3s0 

This is not really needed but it provides a visual feedback of what you're doing:

sudo nmtui
[admin@ddpos-server ~]$ nmcli device wifi list
IN-USE  BSSID              SSID            MODE   CHAN  RATE        SIGNAL  BARS  SECURITY 
        34:81:C4:0C:F1:7E  FRITZ!Box 7490  Infra  11    195 Mbit/s  69      ▂▄▆_  WPA2     
        34:81:C4:0C:F1:80  FRITZ!Box 7490  Infra  44    405 Mbit/s  55      ▂▄__  WPA2     
        74:DA:88:F2:7C:33  WLAN-DW2CFD940  Infra  10    540 Mbit/s  32      ▂▄__  WPA2   

In the following parts replace ifname wlp2s0 with yours, and change MyHotspot / MyNewSSID / MyNewPassword at your choice.

sudo nmcli device wifi hotspot ifname wlp2s0 con-name MyHotspot ssid MyNewSSID band bg channel 3 password 'MyNewPassword'

Here appears an error message, which I do ignore because setup is not yet finished at this point.

Fehler: Aktivierung der Verbindung ist gescheitert: (5) IP-Konfiguration konnte nicht reserviert werden (keine verfügbare Adresse, Zeitüberschreitung usw.).
sudo nmcli connection modify MyHotspot ipv4.method manual ipv4.addresses 192.168.99.1/24 ipv4.gateway 192.168.99.1
sudo nmcli connection modify myHotspot connection.autoconnect yes
sudo nmcli connection up MyHotspot
sudo nmcli connection show --active
[admin@ddpos-server ~]$ iw wlp2s0 info
Interface wlp2s0
    ifindex 3
    wdev 0x1
    addr e4:02:9b:f0:84:35
    ssid ddpos
    type AP
    wiphy 0
    channel 3 (2422 MHz), width: 20 MHz, center1: 2422 MHz
    txpower 22.00 dBm
    multicast TXQ:
        qsz-byt qsz-pkt flows   drops   marks   overlmt hashcol tx-bytes    tx-packets
        0           0           0       0       0       0           0           0           0

Edit dhcpd settings with sudo nano /etc/dhcp/dhcpd.conf, copy and paste, and change subnet 99 to your needs:

default-lease-time 600;
max-lease-time 7200;
authoritative;
subnet 192.168.99.0 netmask 255.255.255.0 {
       range dynamic-bootp 192.168.99.200 192.168.99.220;
       option broadcast-address 192.168.99.255;
       option domain-name-servers 8.8.8.8, 8.8.4.4, 4.2.2.4;
       option routers 192.168.99.1;
       }
sudo systemctl daemon-reload
sudo systemctl enable dhcpd.service
sudo systemctl restart dhcpd.service
[admin@ddpos-server ~]$ sudo systemctl status dhcpd.service

● dhcpd.service - DHCPv4 Server Daemon
     Loaded: loaded (/usr/lib/systemd/system/dhcpd.service; enabled; vendor preset: disabled)
     Active: active (running) since Fri 2021-12-03 15:45:56 CET; 10s ago
       Docs: man:dhcpd(8)
             man:dhcpd.conf(5)
   Main PID: 41327 (dhcpd)
     Status: "Dispatching packets..."
      Tasks: 1 (limit: 47936)
     Memory: 5.2M
        CPU: 33ms
     CGroup: /system.slice/dhcpd.service
             └─41327 /usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -group dhcpd --no-pid

Dez 03 15:45:56 ddpos-server-3160.ddpos dhcpd[41327]: 
Dez 03 15:45:56 ddpos-server-3160.ddpos dhcpd[41327]: No subnet declaration for enp3s0 (192.168.178.29).
Dez 03 15:45:56 ddpos-server-3160.ddpos dhcpd[41327]: ** Ignoring requests on enp3s0.  If this is not what
Dez 03 15:45:56 ddpos-server-3160.ddpos dhcpd[41327]:    you want, please write a subnet declaration
Dez 03 15:45:56 ddpos-server-3160.ddpos dhcpd[41327]:    in your dhcpd.conf file for the network segment
Dez 03 15:45:56 ddpos-server-3160.ddpos dhcpd[41327]:    to which interface enp3s0 is attached. **
Dez 03 15:45:56 ddpos-server-3160.ddpos dhcpd[41327]: 
Dez 03 15:45:56 ddpos-server-3160.ddpos dhcpd[41327]: Sending on   Socket/fallback/fallback-net
Dez 03 15:45:56 ddpos-server-3160.ddpos dhcpd[41327]: Server starting service.
Dez 03 15:45:56 ddpos-server-3160.ddpos systemd[1]: Started DHCPv4 Server Daemon.
sudo firewall-cmd --zone=public --add-service=dns --permanent
sudo firewall-cmd --zone=public --add-masquerade --permanent
sudo firewall-cmd --zone=public --add-port=80/tcp --permanent
sudo firewall-cmd --zone=public --add-port=443/tcp --permanent
sudo reboot

and you should be ready to go, with your new access point. Hope this may help somebody.

2
  • May I ask why do you start Hotspot before DHCP exactly and not vice-versa?
    – Artfaith
    Jun 12, 2022 at 6:20
  • @Faither Indeed, this was my guess, that DHCP cannot work without a running hotspot. Probably the opposit order will work the same, did not try. I am not an expert at all, I was happy to get it run like this :-)
    – ddlab
    Jun 15, 2022 at 8:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .