Assign static MAC address to embedded device

Thread Starter

div_01

Joined Nov 3, 2022
2
Hi,

I have an embedded device and a laptop without an ethernet port. I want to assign a static MAC address to the USB interface and then assign an IP address to the device. For example, I have connected the raspberry pi to the laptop through a USB cable and I want to assign a MAC address to it. Is it possible to assign a static MAC address to a serial USB port? (Assuming that I know nothing about the embedded device)

Thanks & Regards
 

DickCappels

Joined Aug 21, 2008
10,171
The next logical question would be "What operating system are you using, and where are you getting the port and hub information (from the USB stack?)? I would not know enough to actually use that information
 

Ya’akov

Joined Jan 27, 2019
9,152
Welcome to AAC.

It sounds like you hope that “assigning a MAC address” will turn your USB port into an interface that can use TCP/IP to connect to the RPi. This is a mistake. USB and Ethernet are not interchangeable.

But, recent models of RPi (e.g.: Zero W, and as far as I know only recent models) have something called “gadget mode” where the RPi emulates a USB Ethernet adapter. When you plug it in, it appears to the computer to be an Ethernet adapter which you can use to talk to the RPi, but at the logical level, this is not over USB but Ethernet.

All of the Ethernet bits live on the RPi, the computer just treats the connection as if it was an Ethernet adapter and so can use a TCP/IP stack to talk to the RPi.

This older Adafruit tutorial covers the basics. There are probably more resources available if you look around.
 
Top