Linux随机设置Mac地址

出于隐私需求,不想暴露自己的真实mac地址。
把下面这个脚本的内容加入/etc/init.d,就可以在每次开机的时候为网卡随机设置一个mac地址。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
#Chorder
#2016/12/08
#http://chorder.net

mhash=`date +%s|md5sum`

ifconfig eth0 down
ifconfig eth0 hw ether `echo ${mhash:$((RANDOM % 13)):2}:\
${mhash:$((RANDOM % 13)):2}:${mhash:$((RANDOM % 13)):2}:\
${mhash:$((RANDOM % 15)):2}:${mhash:$((RANDOM % 15)):2}:\
${mhash:$((RANDOM % 15)):2} `
ifconfig eth0 up

ifconfig wlan0 down
ifconfig wlan0 hw ether `echo ${mhash:$((RANDOM % 13)):2}:\
${mhash:$((RANDOM % 13)):2}:${mhash:$((RANDOM % 13)):2}:\
${mhash:$((RANDOM % 15)):2}:${mhash:$((RANDOM % 15)):2}:\
${mhash:$((RANDOM % 15)):2} `
ifconfig wlan0 up
SP Flash Tool版本对应MTK处理器型号(SP Flash Tool 版本速查) Kali 2.0 鼠标滚轮方向调整
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×