如何在 Mac OS X 10.7.3 Lion 上更改 MAC 地址?

如何在 Mac OS X 10.7.3 Lion 上更改 MAC 地址?

我正在尝试更改接口 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

相关内容