Changing MAC address on my ethernet to USB adapter

-bash: nmcli: command not found

So far, you've shown your router is observing a number new MAC addresses.
We haven't confirmed what device owns those MAC addresses.

Why do you think it is your Pi-hole machine that owns them?
Does your machine running Pi-hole match any of those new addresses?
Use the following command on your Pi-hole machine to list your MAC addresses

ip link

pi@raspberrypi:~ $ sudo apt install nmcli
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package nmcli
pi@raspberrypi:~ $

pi@raspberrypi:~ $ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DORMANT group default qlen 1000
    link/ether b8:27:eb:ba:dd:ad brd ff:ff:ff:ff:ff:ff
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether ea:81:b0:ba:dd:ad brd ff:ff:ff:ff:ff:ff

i am absolutely shure that the pi is the multiple unknown device... i think i already proof it with the screenshots...

No dont install Networkmanager !
You've got dhcpcd5 that does network for you:

pi@ph5:~ $ apt show dhcpcd5
[..]
Description: DHCPv4, IPv6RA and DHCPv6 client with IPv4LL support
 dhcpcd is a one stop network management daemon which includes
  * RFC compliant DHCPv4 and DHCPv6 clients
  * DHCPv6 Prefix Delegation support
  * IPv4LL (aka ZeroConf) support
  * ARP address conflict resolution
  * Link carrier detection
  * Wireless SSID profiles
  * ARP ping profiles

But I have no idea why it does that on eth0.
I would expect MAC randomization for WiFi but not copper.

i never set up any randomizer... and never used wifi... the pi is plugged via ethernet cable.

to make it absolutely clear... here additional screenshots.


so before and after 5 restarts of the pi and i know for shure that the pi is the 192.168.11.3 because it is my dns and i reach the web interface over that adress.

pi@ph5:~ $ hostnamectl | tail -3
  Operating System: Raspbian GNU/Linux 10 (buster)
            Kernel: Linux 4.19.97-v7+
      Architecture: arm

pi@ph5:~ $ uptime && ip -br link show eth0
 11:53:25 up 81 days, 20:55,  1 user,  load average: 0.00, 0.00, 0.00
eth0             UP             b8:27:eb:5e:xx:xx <BROADCAST,MULTICAST,UP,LOWER_UP>

pi@ph5:~ $ sudo reboot

pi@ph5:~ $ uptime && ip -br link show eth0
 11:54:05 up 0 min,  1 user,  load average: 0.83, 0.19, 0.06
eth0             UP             b8:27:eb:5e:xx:xx <BROADCAST,MULTICAST,UP,LOWER_UP>

dang i want what you have!!! everything was so smooth and easy so far. now after testing for a month i decided to clean up the last cosmetic mistakes... and now my pi is playing the diva...

Screen shots of your router only show your router's view of the world.
To link that to your Pi-hole machine, information should be sourced from that machine.
We've done that now, the ethernet link does show the same MAC as your screen shot in one instance.

As you are using a Zero, you have to be connecting Ethernet by means of a USB adapter.
What's the make and model of that Ethernet dongle?

Yeah good one.
Could be a driver thing.
Check if that dongle has some kind of support/setup software.

EDIT:

lsusb


that is what i got with it. and what i have done to "install it"

but yes on the second look it looks like they know about the problems with the mac adress thats why they stress the point about the dhcp that much...

https://www.raspberrypi.org/forums/viewtopic.php?t=188009

I'm using Pi Zero's with a ENC28J60. It's know that this causes random MAC addresses, and there's a couple of fixes.

1 Like

It seems that adapter does not come with a preset MAC address.

If you don't set it explicitly, it will generate a random MAC, just as you observe.

Articles like the one linked below may help setting one:

You may have to search further, as I am not sure whether the device used is yours exactly.

ok have some work now i will follow that rout later :slight_smile: thanks alot so far!

Post output for below for others to find if you get to a solution:

lsusb

i will continue this next week and then i will post the solution for this network adapter. so dont worry it will be solved :slight_smile: but right now it is to time consuming for me and i take the help of a mate who is way better than i am in unix stuff. I see him next week so until than this project is on ice.

ok tried many "solutions" now what worked for me was:

Hardware: pi zero, sideboard modul ENC28J60
OS: Raspberry Pi OS (32-bit) Lite Minimal image based on Debian Buster

->Connect via SSH

Start by creating the following file:

sudo nano /lib/systemd/system/setmac.service

Add the following contents:

[Unit]
Description=Set MAC address for ENC28J60 module
Wants=network-pre.target
Before=network-pre.target
BindsTo=sys-subsystem-net-devices-eth0.device
After=sys-subsystem-net-devices-eth0.device
[Service]
Type=oneshot
ExecStart=/sbin/ip link set dev eth0 address b8:27:eb:00:00:01
ExecStart=/sbin/ip link set dev eth0 up
[Install]
WantedBy=multi-user.target

do not forget to change the last 3 sectors of the mac address: b8:27:eb:XX:XX:XX

-> Save and exit using CTRL-X, Y and ENTER.

now give rights and register as service

sudo chmod 644 /lib/systemd/system/setmac.service
sudo systemctl daemon-reload
sudo systemctl enable setmac.service

With everything configured you can now reboot your Pi using:

sudo reboot

Solution found at: Adding Ethernet to a Pi Zero - Raspberry Pi Spy

1 Like

Funny you chose the b8:27:eb MAC prefix but makes sense in a way:

pi@ph5:~ $ sqlite3 /etc/pihole/macvendor.db ".tables"
macvendor

pi@ph5:~ $ sqlite3 /etc/pihole/macvendor.db ".schema macvendor"
CREATE TABLE macvendor (mac TEXT NOT NULL, vendor TEXT NOT NULL, PRIMARY KEY (mac));

pi@ph5:~ $ sqlite3 /etc/pihole/macvendor.db "SELECT vendor FROM macvendor WHERE mac LIKE 'b8:27:eb'"
Raspberry Pi Foundation

Am still interested if that board shows up when do below (probably not) ?

lsusb