
我正在嘗試更改介面 en1 的 MAC 位址。
ifconfig
輸出:
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
options=3<RXCSUM,TXCSUM>
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 48:4b:29:36:4f:79
inet6 fe80::4a5b:39ff:fe46:5f89%en0 prefixlen 64 scopeid 0x4
media: autoselect (<unknown type>)
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 1c:3b:d6:d6:3a:25
inet6 fe80::1e4b:d6ff:fed6:4a26%en1 prefixlen 64 scopeid 0x5
inet 192.168.1.105 netmask 0xffffff00 broadcast 192.168.1.255
media: autoselect
status: active
輸入的命令:
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/bin/airport
sudo airport -z
sudo ifconfig en1 ether B2:E6:1C:0B:C7:C9
sudo ifconfig en1 lladdr B2:E6:1C:0B:C7:C9
sudo ifconfig en1 down
sudo ifconfig en1 up
ifcongig
輸出:
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
options=3<RXCSUM,TXCSUM>
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 48:4b:29:36:4f:79
inet6 fe80::4a5b:39ff:fe46:5f89%en0 prefixlen 64 scopeid 0x4
media: autoselect (<unknown type>)
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether b2:e6:1c:0b:c7:c9
media: autoselect (<unknown type>)
status: inactive
可以看到地址已經改變了。但如果您進入“系統偏好設定/網路/Wi-Fi/進階/硬體”,則會出現舊的 MAC 位址 1c:3b:d6:d6:3a:25。並且在路由器上啟用無線 MAC 過濾器不允許使用舊位址進入網路。這意味著地址沒有改變。有什麼解決辦法嗎?
答案1
嘗試
sudo airport --disassociate
sudo ifconfig en1 down
sudo ifconfig en1 ether B2:E6:1C:0B:C7:C9
sudo ifconfig en1 up