Custom MAC Address Linux Service

MAC Addresses are unique for each Network Interface Controller (NIC) and most often are not configurable. Taking advantage of this fact in combination with the Organizationally Unique Identifier(OUI), many Network scanners use the MAC Address in order to determine the manufacturer of a Network Device or even the device type. As you can read in RFC 7042:

48-bit MAC "addresses" are the most commonly used Ethernet interface identifiers. Those that are globally unique are also called EUI-48 identifiers. An EUI-48 is structured into an initial 3-octet OUI and an additional 3 octets assigned by the OUI holder or into a larger initial prefix assigned to an organization and a shorter sequence of additional bits so as to add up to 48 bits in total.

Here you can find a complete list of the registered OUIs from IEEE and here the Wireshark OUI Lookup tool.


MAC addresses starting with:

  • DC-A6-32
  • E4-5F-01
  • B8-27-EB
    are Raspberry PI devices, because all three OUI’s are registered to Raspberry Pi Trading Ltd.

The "Privacy" concerns

The "static" nature of the MAC Address is among the most popular methods for tracking and profiling users. Following the Privacy Concerns which raised over the last years both Android and iOS are now using Randomized MAC addresses to avoid user’s tracking and profiling.

The ENC28J60 Module MAC Address

If you have been following along, you may have noticed that when I built the Raspberry PI "Drone" using the ENC28J60 Ethernet Module, the device’s MAC address was different after each restart. This is a screenshot of the network configuration when the device boot for first time:
MAC on First Boot

and this is after a reboot:

MAC Address after Reboot

As you can see, the MAC Address is different after each boot, which is a result of the ENC28J60 chip. The reason is that ENC28J60 does not come with a preset MAC address but instead it randomly generates a new one on every boot. We can overcome this, and set a constant MAC Address using a Linux service with systemd.

Use a Linux service to set your own MAC Address

1) Create a new file using the command:

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

2) Enter the following content:

Description=ENC28J60 module MAC Address
ExecStart=/sbin/ip link set dev eth0 address dc:a6:32:00:00:01
ExecStart=/sbin/ip link set dev eth0 up

3) Save the file using {CTRL} + {X}, then {Y} and finally {ENTER}

4) Apply the appropriate permissions:

sudo chmod 644 /lib/systemd/system/custommac.service

5) Enable the new service:

sudo systemctl enable custommac.service

Verify that the symlink was created:
Service Enabled

6) Reboot and use the following command check network settings:


Custom MAC Address Configured

Disable the service and use the random generated MAC Address to avoid tracking

To disable this service use the command:

sudo systemctl disable custommac.service

Disabling a custom Linux Service

Arduino Network Tester

How many times you wanted to know if an Ethernet plug or port has internet connectivity and you had to bring your laptop or a cable from the next room to check? And how many times the only tools available were the simple Network Cable tester and your provider’s Modem or Router? For me that was a common issue and of course there was no easy, "plug and play" solution (at a reasonable price!!). Taking these into consideration I decided to give a solution by making a simple optimization to the most common Network tool. Arduino Network Tester, extends the functionality of the well-known Network Cable tester by adding DHCP, DNS and Internet connectivity tests using an Arduino Pro Mini and a W5500 Ethernet Shield with an overall cost of less than €15!
Arduino Network Tester

Continue reading Arduino Network Tester

Raspberry PI as a Serial Device

There are many tutorials explaining how to set up your Raspberry PI as a Serial Device. Almost all of those tutorials explain how to setup your Raspberry as a Serial Console, which will act similar to a SSH connection. The current tutorial takes a different approach. You will find out how to turn your Raspi to a Serial USB Gadget, and how to control what you redirect to the Gadget’s Serial port in order to be available to the machine it will connect to. Using socat, commands we will redirect Serial data received over IP to the Gadget Serial port or data from the on-board UART protocol to the Gadget port.

Continue reading Raspberry PI as a Serial Device

Raspberry PI as a SOCKS Server

Raspi Socks Diagram

How it works

The SOCKS protocol is being used to exchange packets between a server and a client through a Proxy server. Expanding the Remote Drone’s abilities, we can configure the "Middle Host" to act as a PROXY Server and redirect all of our requests to the "Remote Drone". With this configuration, all the traffic will be transferred through the "Remote Drone" and we will be able to access the remote network, or even the Internet through the remote’s Network ISP Modem.

Continue reading Raspberry PI as a SOCKS Server

ecoPrinter Instructable

ecoPrinter is an innovative device which can replace hard copies with no interaction file transferring, by implementing Android Beam and USB Printer Gadget functionality on a Raspberry PI Zero W.

Forget searching for Bluetooth devices or Wifi networks, enabling visibility, establishing a connection/pairing or setting up Wifi Direct, everything has become automated using (the unfortunately now deprecated) Android Beam. You just place your mobile device on the ecoPrinter while this is searching for a device (Red indication Light) and a few seconds later you can view the file on your mobile device as PDF. No matter if it is an image, document or a web-page, full backward compatibility is guaranteed because ecoPrinter appears as any other Printing device on your computer.

The main idea for this device is to reduce the amount of paper we use and also help users organize and keep their receipts, invoices, documents with the minimum amount of effort.

Continue reading ecoPrinter Instructable

Access a remote network using Reverse SSH Tunneling

Raspberry Pi Network Drone
Reverse SSH Tunneling is the connection from the destination to the source instead of the default procedure which is the connection from the source to the destination. We can use this method to establish a connection to a remote network without knowing it’s external IP or making any changes to the network’s configuration. Unless a firewall restricts SSH traffic, the following guide using a Raspberry PI and an ENC28J60 module should be enough to establish a connection to the remote network by plugging the device to the remote network through ethernet.

Continue reading Access a remote network using Reverse SSH Tunneling

Add a new user and replace the default pi user

One of the most effortless way for an intruder to gain access to a system is "Password Guessing". As we can read from the NIST Special Publication 800-118:

Guessing attacks can be mitigated rather easily by using a combination of two methods. First, ensure that
passwords are sufficiently complex so that attackers cannot readily guess them. It is particularly important
to change all default OS and application passwords; lists of default accounts and passwords are widely
available to attackers.

For the Raspbian (official Raspberry PI OS), the default credentials (username: pi, password: raspberry) are the same since the launch of the first device in February of 2012 so if you plan to use a Raspberry PI for any of your projects, the first thing to do is change those credentials. For increased security is even better if you completely remove or disable the default pi user.

Continue reading Add a new user and replace the default pi user