Linux,Unix,BSD

[ROCK5b] 핫스팟(Hotspot) 활성화 실패 해결 기록

채윤아빠 2023. 12. 26. 19:10
728x90
반응형

문제점 및 증상

CLI에서 다음 명령을 직접 실행하여 핫스팟(Hotspot)을 활성화하려고 시도하였는데, 다음과 같은 오류가 발생하였습니다.

$ sudo nmcli con add type wifi ifname wlx60fb0062749e mode ap con-name Hotspot ssid HBESTHEE
Connection 'Hotspot' (182e21fe-cdaa-4674-8e75-cba9d1707d0c) successfully added.
$ sudo nmcli con modify Hotspot 802-11-wireless.band bg \
; sudo nmcli con modify Hotspot 802-11-wireless.channel 1 \
; sudo nmcli con modify Hotspot 802-11-wireless-security.key-mgmt wpa-psk \
; sudo nmcli con modify Hotspot 802-11-wireless-security.psk HunatureVas2 \
; sudo nmcli con modify Hotspot ipv4.method shared \
; sudo nmcli con modify Hotspot ipv4.addr 192.168.77.1/24

$ sudo nmcli con up Hotspot
Error: Connection activation failed: IP configuration could not be reserved (no available address, timeout, etc.)
Hint: use 'journalctl -xe NM_CONNECTION=182e21fe-cdaa-4674-8e75-cba9d1707d0c + NM_DEVICE=wlx60fb0062749e' to get more details.

해결 과정

위 오류 메시지의 힌트와 같이 "journalctl" 명령으로 실패 로그를 확인해 보니, 다음과 같은 메시지가 있었습니다.

hbesthee@rock-5b:~$ journalctl -xe NM_CONNECTION=182e21fe-cdaa-4674-8e75-cba9d1707d0c + NM_DEVICE=wlx60fb0062749e
.
.
.
12월 26 21:08:23 rock-5b NetworkManager[933]:   [1703592503.0795] device (wlx60fb0062749e): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
12월 26 21:08:23 rock-5b NetworkManager[933]:   [1703592503.2404] device (wlx60fb0062749e): ip:shared4: could not start dnsmasq: Could not find "dnsmasq" binary
12월 26 21:08:54 rock-5b NetworkManager[933]:   [1703592534.7070] device (wlx60fb0062749e): state change: ip-config -> failed (reason 'ip-config-unavailable', sys-iface-state: 'managed')
12월 26 21:08:54 rock-5b NetworkManager[933]:   [1703592534.7121] device (wlx60fb0062749e): Activation: failed for connection 'Hotspot'
.
.
.

로그 메시지를 실마리로 'dnsmasq' 패키지가 설치되어 있나 확인해 보니, 설치되어 있지 않았습니다. 다음과 같이 'dnsmasq' 패키지를 설치하려고 했더니 또 다른 오류가 발생하였습니다.

hbesthee@rock-5b:~$ sudo apt install dnsmasq
.
.
.
dnsmasq (2.86-1.1ubuntu0.3) 설정하는 중입니다 ...
Created symlink /etc/systemd/system/multi-user.target.wants/dnsmasq.service → /lib/systemd/system/dnsmasq.service.
Job for dnsmasq.service failed because the control process exited with error code.
See "systemctl status dnsmasq.service" and "journalctl -xeu dnsmasq.service" for details.
invoke-rc.d: initscript dnsmasq, action "start" failed.
× dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
     Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2023-12-26 21:09:58 KST; 31ms ago
    Process: 13231 ExecStartPre=/etc/init.d/dnsmasq checkconfig (code=exited, status=0/SUCCESS)
    Process: 13236 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=2)
        CPU: 50ms

12월 26 21:09:58 rock-5b systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
12월 26 21:09:58 rock-5b dnsmasq[13236]: dnsmasq: failed to create listening socket for port 53: Address already in use
12월 26 21:09:58 rock-5b dnsmasq[13236]: failed to create listening socket for port 53: Address already in use
12월 26 21:09:58 rock-5b dnsmasq[13236]: FAILED to start up
12월 26 21:09:58 rock-5b systemd[1]: dnsmasq.service: Control process exited, code=exited, status=2/INVALIDARGUMENT
12월 26 21:09:58 rock-5b systemd[1]: dnsmasq.service: Failed with result 'exit-code'.
12월 26 21:09:58 rock-5b systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for dbus (1.12.20-2ubuntu4.1) ...


53번 포트를 이용하는 서비스를 확인해 보니, "systemd-resolve" 서비스였습니다.

hbesthee@rock-5b:~$ sudo netstat -nltpagrep 53
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      865/systemd-resolve


"systemd-resolve" 서비스를 사용하지 않도록 중지 시킨 후에...

hbesthee@rock-5b:~$ sudo systemctl stop systemd-resolved
hbesthee@rock-5b:~$ sudo systemctl disable systemd-resolved
Removed /etc/systemd/system/dbus-org.freedesktop.resolve1.service.
Removed /etc/systemd/system/multi-user.target.wants/systemd-resolved.service.


다시 "Hotspot"을 활성화시키니 SSID가 "HBESTHEE"라는 무선 네트워크가 검색이 되고, 이를 연결하여 활용할 수 있게 되었습니다.

hbesthee@rock-5b:~$ sudo nmcli con up Hotspot
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/11)

hbesthee@rock-5b:~$ iwconfig
lo        no wireless extensions.

enP4p65s0  no wireless extensions.

wlx60fb0062749e  IEEE 802.11bgn  ESSID:"HBESTHEE"  Nickname:"<WIFI@REALTEK>"
          Mode:Master  Frequency:2.412 GHz  Access Point: 60:FB:00:62:74:9E
          Bit Rate:72.2 Mb/s   Sensitivity:0/0
          Retry:off   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

참고자료