如果我在 Wifi 上启用“克隆 MAC 地址”会出现连接问题

如果我在 Wifi 上启用“克隆 MAC 地址”会出现连接问题

我的 wlan0“设备 MAC 地址”是:OO:OO:OO:OO:OO:OO,“编辑连接”窗口中的“克隆 MAC 地址”为空。我在此字段中输入了一个新的 MAC 地址:XX:XX:XX:XX:XX:XX。并保存了它。之后我无法连接到 myssid!我检查了我的调制解调器设置(使用 LAN 电缆)。我的调制解调器中的 MAC 过滤已禁用。

sudo tail -f /var/log/syslog这是尝试连接 myssid(使用克隆的 MAC 地址)后的输出。

Feb  1 23:30:05 my-laptop NetworkManager[3800]: <info> Activation (wlan0) starting connection 'myssid'
Feb  1 23:30:05 my-laptop NetworkManager[3800]: <info> (wlan0): device state change: disconnected -> prepare (reason 'none') [30 40 0]
Feb  1 23:30:05 my-laptop NetworkManager[3800]: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare) scheduled...
Feb  1 23:30:05 my-laptop NetworkManager[3800]: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare) started...
Feb  1 23:30:05 my-laptop NetworkManager[3800]: <info> (wlan0): taking down device.
Feb  1 23:30:05 my-laptop NetworkManager[3800]: <info> (wlan0): set MAC address to XX:XX:XX:XX:XX:XX
Feb  1 23:30:06 my-laptop NetworkManager[3800]: <info> Activation (wlan0) Stage 2 of 5 (Device Configure) scheduled...
Feb  1 23:30:06 my-laptop NetworkManager[3800]: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare) complete.
Feb  1 23:30:06 my-laptop kernel: [262160.604817] brcmsmac bcma0:0: brcms_ops_bss_info_changed: qos enabled: false (implement)
Feb  1 23:30:06 my-laptop kernel: [262160.604834] brcmsmac bcma0:0: brcms_ops_config: change power-save mode: false (implement)
Feb  1 23:30:06 my-laptop kernel: [262160.605022] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
Feb  1 23:30:06 my-laptop NetworkManager[3800]: <info> (wlan0): supplicant interface state: inactive -> disabled
Feb  1 23:30:06 my-laptop NetworkManager[3800]: <info> Activation (wlan0) Stage 2 of 5 (Device Configure) starting...
Feb  1 23:30:06 my-laptop NetworkManager[3800]: <info> (wlan0): device state change: prepare -> config (reason 'none') [40 50 0]
Feb  1 23:30:06 my-laptop NetworkManager[3800]: <info> Activation (wlan0/wireless): access point 'myssid' has security, but secrets are required.
Feb  1 23:30:06 my-laptop NetworkManager[3800]: <info> (wlan0): device state change: config -> need-auth (reason 'none') [50 60 0]
Feb  1 23:30:06 my-laptop NetworkManager[3800]: <info> Activation (wlan0) Stage 2 of 5 (Device Configure) complete.
Feb  1 23:30:06 my-laptop NetworkManager[3800]: <info> (wlan0): supplicant interface state: disabled -> inactive
Feb  1 23:30:06 my-laptop NetworkManager[3800]: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare) scheduled...
Feb  1 23:30:06 my-laptop NetworkManager[3800]: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare) started...
Feb  1 23:30:06 my-laptop NetworkManager[3800]: <info> (wlan0): device state change: need-auth -> prepare (reason 'none') [60 40 0]
Feb  1 23:30:06 my-laptop NetworkManager[3800]: <info> Activation (wlan0) Stage 2 of 5 (Device Configure) scheduled...
Feb  1 23:30:06 my-laptop NetworkManager[3800]: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare) complete.
Feb  1 23:30:06 my-laptop NetworkManager[3800]: <info> Activation (wlan0) Stage 2 of 5 (Device Configure) starting...
Feb  1 23:30:06 my-laptop NetworkManager[3800]: <info> (wlan0): device state change: prepare -> config (reason 'none') [40 50 0]
Feb  1 23:30:06 my-laptop NetworkManager[3800]: <info> Activation (wlan0/wireless): connection 'myssid' has security, and secrets exist.  No new secrets needed.
Feb  1 23:30:06 my-laptop NetworkManager[3800]: <info> Config: added 'ssid' value 'myssid'
Feb  1 23:30:06 my-laptop NetworkManager[3800]: <info> Config: added 'scan_ssid' value '1'
Feb  1 23:30:06 my-laptop NetworkManager[3800]: <info> Config: added 'key_mgmt' value 'WPA-PSK'
Feb  1 23:30:06 my-laptop NetworkManager[3800]: <info> Config: added 'psk' value '<omitted>'
Feb  1 23:30:06 my-laptop NetworkManager[3800]: <info> Activation (wlan0) Stage 2 of 5 (Device Configure) complete.
Feb  1 23:30:06 my-laptop NetworkManager[3800]: <info> Config: set interface ap_scan to 1
Feb  1 23:30:06 my-laptop NetworkManager[3800]: <info> (wlan0): supplicant interface state: inactive -> scanning
Feb  1 23:30:06 my-laptop wpa_supplicant[1383]: message repeated 3 times: [ wlan0: CTRL-EVENT-SCAN-STARTED ]
Feb  1 23:30:06 my-laptop wpa_supplicant[1383]: wlan0: SME: Trying to authenticate with mm:mm:mm:mm:mm:mm (SSID='myssid' freq=2412 MHz)
Feb  1 23:30:06 my-laptop kernel: [262161.475402] wlan0: authenticate with mm:mm:mm:mm:mm:mm
Feb  1 23:30:06 my-laptop kernel: [262161.476572] wlan0: send auth to mm:mm:mm:mm:mm:mm (try 1/3)
Feb  1 23:30:06 my-laptop kernel: [262161.478407] wlan0: authenticated
Feb  1 23:30:06 my-laptop NetworkManager[3800]: <info> (wlan0): supplicant interface state: scanning -> authenticating
Feb  1 23:30:11 my-laptop kernel: [262166.474938] wlan0: deauthenticating from mm:mm:mm:mm:mm:mm by local choice (reason=3)
Feb  1 23:30:11 my-laptop wpa_supplicant[1383]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="myssid" auth_failures=1 duration=10
Feb  1 23:30:11 my-laptop NetworkManager[3800]: <info> (wlan0): supplicant interface state: authenticating -> disconnected
Feb  1 23:30:21 my-laptop wpa_supplicant[1383]: wlan0: CTRL-EVENT-SCAN-STARTED 
Feb  1 23:30:21 my-laptop NetworkManager[3800]: <info> (wlan0): supplicant interface state: disconnected -> scanning
Feb  1 23:30:22 my-laptop wpa_supplicant[1383]: wlan0: CTRL-EVENT-SSID-REENABLED id=0 ssid="myssid"
Feb  1 23:30:22 my-laptop wpa_supplicant[1383]: wlan0: SME: Trying to authenticate with mm:mm:mm:mm:mm:mm (SSID='myssid' freq=2412 MHz)
Feb  1 23:30:22 my-laptop kernel: [262177.257358] wlan0: authenticate with mm:mm:mm:mm:mm:mm
Feb  1 23:30:22 my-laptop kernel: [262177.259481] wlan0: send auth to mm:mm:mm:mm:mm:mm (try 1/3)
Feb  1 23:30:22 my-laptop NetworkManager[3800]: <info> (wlan0): supplicant interface state: scanning -> authenticating
Feb  1 23:30:22 my-laptop kernel: [262177.260940] wlan0: authenticated
Feb  1 23:30:27 my-laptop wpa_supplicant[1383]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="myssid" auth_failures=2 duration=20
Feb  1 23:30:27 my-laptop kernel: [262182.258511] wlan0: deauthenticating from mm:mm:mm:mm:mm:mm by local choice (reason=3)
Feb  1 23:30:27 my-laptop NetworkManager[3800]: <info> (wlan0): supplicant interface state: authenticating -> disconnected
Feb  1 23:30:31 my-laptop NetworkManager[3800]: <warn> Activation (wlan0/wireless): association took too long, failing activation.
Feb  1 23:30:31 my-laptop NetworkManager[3800]: <info> (wlan0): device state change: config -> failed (reason 'SSID not found') [50 120 53]
Feb  1 23:30:31 my-laptop NetworkManager[3800]: <warn> Activation (wlan0) failed for connection 'myssid'
Feb  1 23:30:31 my-laptop NetworkManager[3800]: <info> (wlan0): device state change: failed -> disconnected (reason 'none') [120 30 0]
Feb  1 23:30:31 my-laptop NetworkManager[3800]: <info> (wlan0): deactivating device (reason 'none') [0]
Feb  1 23:30:31 my-laptop NetworkManager[3800]: <info> (wlan0): taking down device.
Feb  1 23:30:31 my-laptop NetworkManager[3800]: <info> (wlan0): reset MAC address to OO:OO:OO:OO:OO:OO
Feb  1 23:30:31 my-laptop kernel: [262186.002396] brcmsmac bcma0:0: brcms_ops_bss_info_changed: qos enabled: false (implement)
Feb  1 23:30:31 my-laptop kernel: [262186.002412] brcmsmac bcma0:0: brcms_ops_config: change power-save mode: false (implement)
Feb  1 23:30:31 my-laptop kernel: [262186.002596] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
Feb  1 23:30:31 my-laptop NetworkManager[3800]: <info> (wlan0): supplicant interface state: disconnected -> disabled
Feb  1 23:30:31 my-laptop wpa_supplicant[1383]: wlan0: CTRL-EVENT-SCAN-STARTED 
Feb  1 23:30:31 my-laptop NetworkManager[3800]: <info> (wlan0): supplicant interface state: disabled -> inactive

如果我将克隆的 MAC 地址设置为空或等于设备 MAC 地址,我就可以毫无问题地连接到 myssid。

答案1

如果你想更改 mac 地址,最简单的方法是使用命令

sudo ifconfig wlan0 down
sudo ifconfig wlan0 hw ether  xx:xx:xx:xx:xx:xx
sudo ifconfig wlan0 up

xx:xx:xx:xx:xx:xx - 代表“新” mac 地址

相关内容