每次启动自动随机生成新的MAC地址

2014-02-10 15:00:35 +08:00
 a2z
不要问我有什么用,呵呵

下面这段加到/etc/rc.common 最后

#########################
#Random mac address every time#

MAC1=`openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'`;
MAC2=`openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'`;
ifconfig en0 ether $MAC1;
ifconfig en1 ether $MAC2;
ifconfig en0 down;
ifconfig en0 up;
ifconfig en1 down;
ifconfig en1 up;
2927 次点击
所在节点    macOS
4 条回复
sunxiaonian
2014-02-10 15:37:38 +08:00
我们公司是MAC白名单形式,自动换了之后就没法上网了
YouXia
2014-02-10 16:11:26 +08:00
赞。
SoloCompany
2014-02-10 17:05:19 +08:00
这个帖子出现在 MAC 节点下有点莫名的喜感
sweetomy
2015-03-09 21:52:50 +08:00
第二位必须是偶数吧

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/99563

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX