In an attempt to prepare a (closed) wireless LAN for testing, I prepared a general wireless LAN access point and kept the WiFi SSID private. I prepared a DHCP server for Linux and assigned an IP address only to the hardware address (MAC address) registered in advance.
I tried to connect to it via DHCP on a Linux (CentOS) machine via WiFi.
or ʻip addr
on the Linux machine you want to connect to.However, in step 3, the DHCP server did not assign an IP address, etc., and the connection failed.
The cause was that ** MAC address randomization ** was enabled by default in NetworkManager
. Since the DHCP client queries the DHCP server using an appropriate MAC address, the DHCP server considers it an invalid request and completely ignores it.
Since this environment is a test network and never goes out to the outside world, there is little risk of collecting MAC addresses, so we disabled MAC address randomization.
An execution example including the connection method to the stealth SSID in Reference article is as follows. [[Connection name]], [[Interface name]] , [[Destination SSID]], [[WPA2 Passphrase]] must actually be matched.
Execution example
# nmcli c add type wifi con-name [[wlan0a]] ifname [[wlan0]] ssid [[ACTUAL-SSID-NAME]]
# nmcli con modify [[wlan0a]] wifi-sec.key-mgmt wpa-psk
# nmcli con modify [[wlan0a]] wifi-sec.psk [[ACTUAL-WPA2-PASSPHASE]]
# nmcli con modify [[wlan0a]] wifi.mac-address-randomization never
# nmcli con up [[wlan0a]]
# nmcli con show [[wlan0a]]
Recommended Posts