V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
a2z
V2EX  ›  macOS

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

  •  
  •   a2z · 2014-02-10 15:00:35 +08:00 · 2923 次点击
    这是一个创建于 3743 天前的主题,其中的信息可能已经有所发展或是发生改变。
    不要问我有什么用,呵呵

    下面这段加到/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;
    4 条回复    2015-03-09 21:52:50 +08:00
    sunxiaonian
        1
    sunxiaonian  
       2014-02-10 15:37:38 +08:00
    我们公司是MAC白名单形式,自动换了之后就没法上网了
    YouXia
        2
    YouXia  
       2014-02-10 16:11:26 +08:00 via Android
    赞。
    SoloCompany
        3
    SoloCompany  
       2014-02-10 17:05:19 +08:00   ❤️ 1
    这个帖子出现在 MAC 节点下有点莫名的喜感
    sweetomy
        4
    sweetomy  
       2015-03-09 21:52:50 +08:00
    第二位必须是偶数吧
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5309 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 09:37 · PVG 17:37 · LAX 02:37 · JFK 05:37
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.