1 (edytowany przez bern 2018-05-02 05:52:55)

Temat: problemy z hostapd po upgrade Ubuntu server do 18.04

Cześć,
Mam skonfigurowany Ubuntu server jako firwewall, router, domowy serwer z wieloma usługami.
Ostatnio zrobiłem upgrade Ubuntu z wersji 17.10 do 18.04 i coś się posypało z wifi (które pracuje w trybie AP z hostapd).
Tzn przestał mi się uruchamiać hostapd. Nie wiem czy to zasługa systemd czy czegoś innego.

ela@akacja:~$ sudo systemctl status hostapd
â hostapd.service
   Loaded: masked (/dev/null; bad)
   Active: inactive (dead)

Interfejs dla wifi mam zdefiniowany w /etc/netplan/03-netcfg.yaml jako

network:
  version: 2
  renderer: networkd
  ethernets:
    wlp4s0:
      addresses:
       - 10.10.11.1/24
      dhcp4: no

do tego isc-dhcp-serwer w /etc/dhcp/dhcpd.conf (fragment)

# WLAN
subnet 10.10.11.0 netmask 255.255.255.0 {
    range 10.10.11.10 10.10.11.50;
    option routers 10.10.11.1;
    option broadcast-address 10.10.11.255;
    option domain-name-servers 10.10.11.1;
    option ntp-servers 10.10.11.1;
    option netbios-name-servers 10.10.11.1;
    option netbios-node-type 2;
    default-lease-time 600;
    max-lease-time 7200;
    }

/etc/hostapd/hostapd.conf:

driver=nl80211
######################### basic hostapd configuration ##########################
#
interface=wlp4s0
country_code=PL
ieee80211d=1
ieee80211h=1
channel=2
hw_mode=g
ieee80211n=1
wmm_enabled=1
ht_capab=[LDPC][HT40+][SHORT-GI-20][SHORT-GI-40][TX-STBC][RX-STBC1][DSSS_CCK-40]
logger_syslog=-1
logger_syslog_level=0
logger_stdout=-1
logger_stdout_level=4
#dump_file=/tmp/hostapd.dump
auth_algs=1
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
ssid=IPFire
ignore_broadcast_ssid=0
######################### wpa hostapd configuration ############################
#
wpa=3
wpa_passphrase=******
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

I przed upgradem działało. Teraz jak odpalę hostapd 'z palca' to mam:

ela@akacja:~$ sudo hostapd  /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
wlp4s0: interface state UNINITIALIZED->COUNTRY_UPDATE
wlp4s0: interface state COUNTRY_UPDATE->HT_SCAN
20/40 MHz operation not permitted on channel pri=2 sec=9 based on overlapping BSSes
Using interface wlp4s0 with hwaddr 18:f4:6a:30:ae:50 and ssid "IPFire"
wlp4s0: interface state HT_SCAN->ENABLED
wlp4s0: AP-ENABLED
wlp4s0: AP-STA-CONNECTED 24:92:0e:cc:d8:cc
wlp4s0: AP-STA-DISCONNECTED 24:92:0e:cc:d8:cc
wlp4s0: AP-STA-CONNECTED 34:23:ba:c4:3c:78
wlp4s0: AP-STA-DISCONNECTED 34:23:ba:c4:3c:78
wlp4s0: AP-STA-CONNECTED 34:23:ba:c4:3c:78
wlp4s0: AP-STA-DISCONNECTED 34:23:ba:c4:3c:78
^Cwlp4s0: interface state ENABLED->DISABLED
wlp4s0: AP-DISABLED
nl80211: deinit ifname=wlp4s0 disabled_11b_rates=0

ale nie może połączyć skutecznie żadnego hosta
Co może być nie tak? I jak to zdiagnozować i naprawić?
Dzięki z góry,
b

2

Odp: problemy z hostapd po upgrade Ubuntu server do 18.04

Cześć,
Ciągle walcze z uruchomieniem wifi Access Point.
Odinstalowałem hosapd i zainstalowałem ponownie,  włączyłem usługę.
Dziwne na kliencie (laptopie z WIN7 x64) pokazuje mi połączenie wi-fi ustanowione i jakość sygnału znakomitą ale serwer nie przydzielił mi adresu IP. Spodziewałem się 10.10.11.12 a tu nic
W logu mam:

May  3 15:37:14 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 MLME: MLME-DEAUTHENTICATE.indication(e0:b9:a5:34:57:83, 1)
May  3 15:37:14 akacja kernel: [25125.820702] netlink: 'hostapd': attribute type 213 has an invalid length.
May  3 15:37:15 akacja hostapd[4967]: Configuration file: /etc/hostapd/hostapd.conf
May  3 15:37:15 akacja hostapd[4967]: wlp4s0: interface state UNINITIALIZED->COUNTRY_UPDATE
May  3 15:37:15 akacja hostapd[4967]: wlp4s0: interface state COUNTRY_UPDATE->HT_SCAN
May  3 15:37:16 akacja kernel: [25127.141236] netlink: 'hostapd': attribute type 213 has an invalid length.
May  3 15:37:17 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 IEEE 802.11: authentication OK (open system)
May  3 15:37:17 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 MLME: MLME-AUTHENTICATE.indication(e0:b9:a5:34:57:83, OPEN_SYSTEM)
May  3 15:37:17 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 MLME: MLME-DELETEKEYS.request(e0:b9:a5:34:57:83)
May  3 15:37:17 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 IEEE 802.11: authenticated
May  3 15:37:17 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 IEEE 802.11: association OK (aid 1)
May  3 15:37:17 akacja kernel: [25127.854345] netlink: 'hostapd': attribute type 213 has an invalid length.
May  3 15:37:17 akacja kernel: [25127.854484] netlink: 'hostapd': attribute type 213 has an invalid length.
May  3 15:37:17 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 IEEE 802.11: associated (aid 1)
May  3 15:37:17 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 MLME: MLME-REASSOCIATE.indication(e0:b9:a5:34:57:83)
May  3 15:37:17 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 MLME: MLME-DELETEKEYS.request(e0:b9:a5:34:57:83)
May  3 15:37:17 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 IEEE 802.11: binding station to interface 'wlp4s0'
May  3 15:37:17 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 WPA: event 1 notification
May  3 15:37:17 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 WPA: start authentication
May  3 15:37:17 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 IEEE 802.1X: unauthorizing port
May  3 15:37:17 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 WPA: sending 1/4 msg of 4-Way Handshake
May  3 15:37:17 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 WPA: received EAPOL-Key frame (2/4 Pairwise)
May  3 15:37:17 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 WPA: sending 3/4 msg of 4-Way Handshake
May  3 15:37:17 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 WPA: received EAPOL-Key frame (4/4 Pairwise)
May  3 15:37:17 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 IEEE 802.1X: authorizing port
May  3 15:37:17 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 RADIUS: starting accounting session 6C790EA035AA9B1A
May  3 15:37:17 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 WPA: pairwise key handshake completed (RSN)
May  3 15:47:16 akacja hostapd: wlp4s0: WPA rekeying GTK
May  3 15:47:16 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 WPA: sending 1/2 msg of Group Key Handshake
May  3 15:47:16 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 WPA: received EAPOL-Key frame (2/2 Group)
May  3 15:47:16 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 WPA: group key handshake completed (RSN)
May  3 15:57:16 akacja hostapd: wlp4s0: WPA rekeying GTK
May  3 15:57:16 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 WPA: sending 1/2 msg of Group Key Handshake
May  3 15:57:16 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 WPA: EAPOL-Key timeout
May  3 15:57:16 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 WPA: sending 1/2 msg of Group Key Handshake
May  3 15:57:17 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 WPA: received EAPOL-Key frame (2/2 Group)
May  3 15:57:17 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 WPA: group key handshake completed (RSN)
May  3 15:57:17 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 WPA: received EAPOL-Key 2/2 Group with unexpected replay counter
May  3 16:07:16 akacja hostapd: wlp4s0: WPA rekeying GTK
May  3 16:07:16 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 WPA: sending 1/2 msg of Group Key Handshake
May  3 16:07:16 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 WPA: EAPOL-Key timeout
May  3 16:07:16 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 WPA: sending 1/2 msg of Group Key Handshake
May  3 16:07:17 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 WPA: received EAPOL-Key frame (2/2 Group)
May  3 16:07:17 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 WPA: group key handshake completed (RSN)
May  3 16:07:17 akacja hostapd: wlp4s0: STA e0:b9:a5:34:57:83 WPA: received EAPOL-Key 2/2 Group with unexpected replay counter

Co to jest

netlink: 'hostapd': attribute type 213 has an invalid length.

może to blokuje AP?. Może problem leży gdzie indziej niż hosapd?
Pozdrawiam,

3 (edytowany przez bern 2018-05-07 18:03:38)

Odp: problemy z hostapd po upgrade Ubuntu server do 18.04

Sprawa wyjaśniona po upgradzie zła jest kolejność ładowania usług.
Bezpośrednią przyczyną nie uruchamiania się WIFI AP była blokująca się usługa isc-dhcp-server.

Muszę tak ustawić kolejność uruchamiania usług w systemd by hosapd, isc-dhcp-server, unbound i shorewall nie blokowały się...
Pozdrawiam, B


EDIT:
Ustawiłem usługi. Teraz Ubuntu server uruchamia się normalnie.
W pliku /lib/systemd/system/isc-dhcp-server.service w sekcji [Service] dodałem:

Restart=on-failure
RestartSec=5

W Shorewall w pliku /etc/shorewall/interfaces w wierszu odpowiedzialnym za interfejs WIFI w opcjach dodałem 'wait=10'
Cały wiersz wygląda teraz tak:

?FORMAT 1
###############################################################################
#ZONE    INTERFACE    BROADCAST    OPTIONS
loc    wlp4s0        detect    dhcp,maclist,wait=10