You are not logged in.
I tried to use macchanger to randomize the product ID bits of my MAC address but sometimes, it takes a lot of time (40seconds+) to get started and even when it does, dhcpcd picks up my original MAC address.
Here is my /etc/systemd./system/macspoof@enp2s0.service file
[Unit]
Description=macchanger on %I
Wants=network-pre.target
Before=network-pre.target
BindsTo=sys-subsystem-net-devices-%i.device
After=sys-subsystem-net-devices-%i.device
[Service]
ExecStart=/usr/bin/macchanger -e %I
Type=oneshot
[Install]
WantedBy=multi-user.target
I enabled the service and this is the output of systemctl status macspoof@enp2s0.service
● macspoof@enp2s0.service - macchanger on enp2s0
Loaded: loaded (/etc/systemd/system/macspoof@enp2s0.service; enabled; vendor preset: disabled)
Active: inactive (dead) since ...
Process: 367 ExecStart=/usr/bin/macchanger -e %I (code=exited, status=0/SUCCESS)
Main PID: 367 (code=exited, status=0/SUCCESS)
systemd[1]: Starting macchanger on enp2s0...
macchanger[367]: Current MAC: <ORIGINAL MAC> (unknown)
macchanger[367]: Permanent MAC: <ORIGINAL MAC>(unknown)
macchanger[367]: New MAC: <NEW MAC> (unknown)
systemd[1]: Started macchanger on enp2s0.
This is the output of systemctl status dhcpcd@enp2s0.service
● dhcpcd@enp2s0.service - dhcpcd on enp2s0
Loaded: loaded (/usr/lib/systemd/system/dhcpcd@.service; enabled; vendor preset: disabled)
Active: active (running) since ...
Process: 363 ExecStart=/usr/bin/dhcpcd -q -w %I (code=exited, status=0/SUCCESS)
Main PID: 386 (dhcpcd)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/system-dhcpcd.slice/dhcpcd@enp2s0.service
└─386 /usr/bin/dhcpcd -q -w enp2s0
dhcpcd[363]: enp2s0: waiting for carrier
dhcpcd[363]: enp2s0: carrier acquired
dhcpcd[363]: DUID <16-DIGIT NUMBER>:<ORIGINAL MAC ADDRESS>
europa dhcpcd[363]: enp2s0: IAID <THE LAST 8 DIGITS OF THE ORIGINAL MAC ADDRESS>
dhcpcd[363]: enp2s0: rebinding lease of 192.168.1.100
dhcpcd[363]: enp2s0: leased 192.168.1.100 for 259200 seconds
dhcpcd[363]: enp2s0: adding route to 192.168.1.0/24
dhcpcd[363]: enp2s0: adding default route via 192.168.1.1
systemd[1]: Started dhcpcd on enp2s0.
Here's my dhcpcd.conf file with the comments removed
hostname
duid
persistent
option rapid_commit
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option ntp_servers
option interface_mtu
require dhcp_server_identifier
slaac private
ipv4only
noarp
noipv4ll
nohook resolv.conf
Is dhcpcd still seeing my original MAC address? If yes, what can I do to make dhcpcd see the randomized MAC address? Why is macchanger taking so much time (I have a SSD) to get activated?
Offline
dhcpcd reads the duid in /etc/dhcpcd.duid, if it does not exist then it creates it using the MAC address of a network card in your box if it can.
The DUID is an opaque field - it could be a stream of random bytes really. It just has to uniquely identify the host for the DHCP server so it can be assigned the same address, to avoid pool starvation.
Offline