Mac OS系统怎么修改mac地址

有时候我们需要指定固定的mac地址上网

具体方法:

networksetup -listallhardwareports //查看当前所有端口Mac地址
sudo ifconfig en0 ether e4:ce:8f:32:51:82 //修改

ifconfig en1 | grep ether //查看是否修改成功,这里修改的是虚拟Mac,看硬件是看不出来的

demo案例:修改en8的mac地址

1、查看当前所有端口mac地址

apple@fenglolodeMacBook-Pro ~ % networksetup -listallhardwareports

Hardware Port: USB Ethernet
Device: en8
Ethernet Address: 00:0e:c6:68:7d:c1

Hardware Port: Wi-Fi
Device: en0
Ethernet Address: 78:4f:43:83:5a:5a

Hardware Port: Bluetooth PAN
Device: en5
Ethernet Address: 78:4f:43:84:d0:d8

Hardware Port: Thunderbolt 1
Device: en1
Ethernet Address: 82:c9:93:e2:54:01

Hardware Port: Thunderbolt 2
Device: en2
Ethernet Address: 82:c9:93:e2:54:00

Hardware Port: Thunderbolt 3
Device: en3
Ethernet Address: 82:c9:93:e2:54:05

Hardware Port: Thunderbolt 4
Device: en4
Ethernet Address: 82:c9:93:e2:54:04

Hardware Port: Thunderbolt Bridge
Device: bridge0
Ethernet Address: 82:c9:93:e2:54:01

VLAN Configurations
===================

2、修改en8的mac地址为98:ee:cb:a3:8d:bf

apple@fenglolodeMacBook-Pro ~ % sudo ifconfig en8 ether 98:ee:cb:a3:8d:bf
Password:

3、查看修改后的en8的mac地址,确认是否修改成功。

apple@fenglolodeMacBook-Pro ~ % ifconfig en8 | grep ether
	ether 98:ee:cb:a3:8d:bf 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值