Finding MAC address of ethernet port

Hi everyone!

I'm working on my graduation project at uni and have a Raspberry Pi with OctoPi hooked up to a printer. However, I'm having a lot of difficulty to connect the printer to the internet. WiFi is obviously available but I'm not able to have it connect. I've contacted the IT department and they have arranged an ethernet cable so I can connect it to the network via a wire. They will need the MAC address of the ethernet port of the Raspberry Pi to approve it to access the internet. I'm not really sure how I can get this MAC address. I found that you can use Rasbian to find it, but I've already got OctoPrint installed so I'm not sure how to proceed. Any suggestions?

Meanwhile I'm getting it to work by connecting the ethernet port directly to my laptop. This is not ideal however as I can't always stay in the lab due to Corona measurements. Ideally I would be able to monitor my print from anywhere within the faculty and only go to the lab when things are going wrong.

Thanks in advance for any suggestions!

Assuming you can ssh into the pi somehow, or connect a monitor/keyboard to it, log in and run ifconfig. Look for a section that starts with eth0. The indented line below that that starts with ether will have the mac address of the ethernet port.

For example:

taylor@printerpi:~ $ ifconfig
eth0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether xx:xx:xx:xx:xx:xx  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet  netmask
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 2676149  bytes 29983160680 (27.9 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2676149  bytes 29983160680 (27.9 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

In this case, xx:xx:xx:xx:xx:xx would be the MAC address.


you can ping the pi and then display arp table content on the machine you ping-ed from
on windows:
arp -a < ip pi >

Note: what you're looking for is the physical address, ex

C:\Users\Seb>arp -a

Interface: --- 0x5
  Internet Address      Physical Address      Type          cd-2c-e1-08-84-41     dynamic

1 Like

Thank you for your reply! I managed to find the MAC address this way. This is the first time working with a Raspberry Pi for me and don't have a lot of coding experience so this is all very new to me. Thanks a lot for your help!

1 Like

Thanks for your reply! I've solved my problem using the suggestion of TTalkington. I'm not really sure how your suggestion works as I don't have a lot of experience/knowledge about coding. I will try your solution later on, just to learn how to do it. But for now my problem has been solved.