Estimated Reading Time: 2 minutes

Method

Method 1: Use the Bash Script

#!/bin/bash
randmac=$(echo 03:6a:2f:`openssl rand -hex 3 | sed 's/\(..\)/\1:/g; s/.$//'`)
sudo ifconfig eth0 down
sudo ifconfig eth0 hw ether $randmac
sudo ifconfig eth0 up
exit 0

Method 2: Randomize everytime when you connect

/etc/NetworkManager/conf.d/randmac.conf

[device-mac-randomization]
# "yes" is already the default for scanning
wifi.scan-rand-mac-address=yes
[connection-mac-randomization]
 # Randomize MAC for every ethernet connection 
ethernet.cloned-mac-address=random 
# Generate a random MAC for each WiFi and associate the two permanently. 
wifi.cloned-mac-address=random

最后修改日期:2020年5月28日

作者

留言

发表您的高见,产生思维碰撞