<p style="box-sizing: border-box; margin-right: auto; margin-bottom: 1.5em; margin-left: auto; padding: 0px; direction: ltr; color: #4f4e4e; font-family: &quot;typoninesans regular 18&quot;, &quot;lucida grande&quot;, Lucida, Verdana, sans-serif; font-size: 18px; background-color: #ffffff;"><span style="box-sizing: border-box; font-family: &quot;typoninesans text 16&quot;; font-stretch: normal;">Reference</span>&nbsp;&nbsp;&nbsp;<a class="wikilink" href="https://www.arduino.cc/en/Reference/HomePage" style="box-sizing: border-box; color: #00979c; text-decoration-line: none; line-height: inherit;" target="_blank">Language</a>&nbsp;|&nbsp;<a class="wikilink" href="https://www.arduino.cc/en/Reference/Libraries" style="box-sizing: border-box; color: #00979c; text-decoration-line: none; line-height: inherit;" target="_blank">Libraries</a>&nbsp;|&nbsp;<a class="wikilink" href="https://www.arduino.cc/en/Reference/Comparison" style="box-sizing: border-box; color: #00979c; text-decoration-line: none; line-height: inherit;" target="_blank">Comparison</a>&nbsp;|&nbsp;<a class="wikilink" href="https://www.arduino.cc/en/Reference/Changes" style="box-sizing: border-box; color: #00979c; text-decoration-line: none; line-height: inherit;" target="_blank">Changes</a></p>
<p style="box-sizing: border-box; margin-right: auto; margin-bottom: 1.5em; margin-left: auto; padding: 0px; direction: ltr; color: #4f4e4e; font-family: &quot;typoninesans regular 18&quot;, &quot;lucida grande&quot;, Lucida, Verdana, sans-serif; font-size: 18px; background-color: #ffffff;"><a class="wikilink" href="https://www.arduino.cc/en/Reference/Ethernet" style="box-sizing: border-box; color: #00979c; text-decoration-line: none; line-height: inherit;" target="_blank">Ethernet</a></p>
<h2 style="box-sizing: border-box; margin: 0.6em 0px; padding: 0px; direction: ltr; line-height: 1.2em; text-rendering: optimizelegibility; color: #4f4e4e; font-size: 40px; hyphens: none; font-family: &quot;typoninesans light 17&quot;; font-weight: 400; font-stretch: normal; background-color: #ffffff;"><span class="wikiword" style="box-sizing: border-box;">Ethernet.MACAddress</span>()</h2>
<h4 style="box-sizing: border-box; margin: 1.2777em 0px 0.6em; padding: 0px; direction: ltr; line-height: 1.33333rem; text-rendering: optimizelegibility; color: #e67e22; font-size: 18px; hyphens: none; font-family: &quot;typoninesans regular 18&quot;; font-weight: 400; font-stretch: normal; background-color: #ffffff;">Description</h4>
<p style="box-sizing: border-box; margin-right: auto; margin-bottom: 1.5em; margin-left: auto; padding: 0px; direction: ltr; color: #4f4e4e; font-family: &quot;typoninesans regular 18&quot;, &quot;lucida grande&quot;, Lucida, Verdana, sans-serif; font-size: 18px; background-color: #ffffff;">Fills the supplied buffer with the MAC address of the device.</p>
<h4 style="box-sizing: border-box; margin: 1.2777em 0px 0.6em; padding: 0px; direction: ltr; line-height: 1.33333rem; text-rendering: optimizelegibility; color: #e67e22; font-size: 18px; hyphens: none; font-family: &quot;typoninesans regular 18&quot;; font-weight: 400; font-stretch: normal; background-color: #ffffff;">Syntax</h4>
<p style="box-sizing: border-box; margin-right: auto; margin-bottom: 1.5em; margin-left: auto; padding: 0px; direction: ltr; color: #4f4e4e; font-family: &quot;typoninesans regular 18&quot;, &quot;lucida grande&quot;, Lucida, Verdana, sans-serif; font-size: 18px; background-color: #ffffff;"><span class="wikiword" style="box-sizing: border-box;">Ethernet.MACAddress</span>(mac_address)</p>
<h4 style="box-sizing: border-box; margin: 1.2777em 0px 0.6em; padding: 0px; direction: ltr; line-height: 1.33333rem; text-rendering: optimizelegibility; color: #e67e22; font-size: 18px; hyphens: none; font-family: &quot;typoninesans regular 18&quot;; font-weight: 400; font-stretch: normal; background-color: #ffffff;">Parameters</h4>
<p style="box-sizing: border-box; margin-right: auto; margin-bottom: 1.5em; margin-left: auto; padding: 0px; direction: ltr; color: #4f4e4e; font-family: &quot;typoninesans regular 18&quot;, &quot;lucida grande&quot;, Lucida, Verdana, sans-serif; font-size: 18px; background-color: #ffffff;"><span style="box-sizing: border-box; font-family: &quot;typoninesans text 16&quot;; font-stretch: normal;">mac_address</span>: buffer to receive the MAC address (array of 6 bytes)</p>
<h4 style="box-sizing: border-box; margin: 1.2777em 0px 0.6em; padding: 0px; direction: ltr; line-height: 1.33333rem; text-rendering: optimizelegibility; color: #e67e22; font-size: 18px; hyphens: none; font-family: &quot;typoninesans regular 18&quot;; font-weight: 400; font-stretch: normal; background-color: #ffffff;">Returns</h4>
<p style="box-sizing: border-box; margin-right: auto; margin-bottom: 1.5em; margin-left: auto; padding: 0px; direction: ltr; color: #4f4e4e; font-family: &quot;typoninesans regular 18&quot;, &quot;lucida grande&quot;, Lucida, Verdana, sans-serif; font-size: 18px; background-color: #ffffff;">Nothing</p>
<h4 style="box-sizing: border-box; margin: 1.2777em 0px 0.6em; padding: 0px; direction: ltr; line-height: 1.33333rem; text-rendering: optimizelegibility; color: #e67e22; font-size: 18px; hyphens: none; font-family: &quot;typoninesans regular 18&quot;; font-weight: 400; font-stretch: normal; background-color: #ffffff;">Example</h4>
<p style="box-sizing: border-box; margin-right: auto; margin-bottom: 1.5em; margin-left: auto; padding: 0px; direction: ltr; color: #4f4e4e; font-family: &quot;typoninesans regular 18&quot;, &quot;lucida grande&quot;, Lucida, Verdana, sans-serif; font-size: 18px; background-color: #ffffff;">&nbsp;</p>
<div class="sourceblock " id="sourceblock1" style="box-sizing: border-box; margin: 0px; padding: 0px; direction: ltr; color: #4f4e4e; font-family: &quot;typoninesans regular 18&quot;, &quot;lucida grande&quot;, Lucida, Verdana, sans-serif; font-size: 18px; background-color: #ffffff;">
   <div class="sourceblocktext" style="box-sizing: border-box; margin: 0px; padding: 0.5em; direction: ltr; color: #000000; background-color: #ecf1f1;">
      <div class="arduino" style="box-sizing: border-box; margin: 0px; padding: 0px; direction: ltr; font-family: &quot;TyponineSans Monospace Regular 4&quot;; font-stretch: normal; font-size: 14px; line-height: 18px; height: 486px;"><span class="co2" style="box-sizing: border-box; color: #7e7e7e;">#include &lt;SPI.h&gt;</span><br style="box-sizing: border-box;" /><span class="co2" style="box-sizing: border-box; color: #7e7e7e;">#include &lt;Ethernet.h&gt;</span><br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /><span class="kw1" style="box-sizing: border-box; color: #cc6600;">byte</span>&nbsp;mac<span class="br0" style="box-sizing: border-box;">[</span><span class="br0" style="box-sizing: border-box;">]</span>&nbsp;<span class="sy0" style="box-sizing: border-box;">=</span>&nbsp;<span class="br0" style="box-sizing: border-box;">{</span><span class="nu12" style="box-sizing: border-box; color: #208080;">0xDE</span><span class="sy0" style="box-sizing: border-box;">,</span>&nbsp;<span class="nu12" style="box-sizing: border-box; color: #208080;">0xAD</span><span class="sy0" style="box-sizing: border-box;">,</span>&nbsp;<span class="nu12" style="box-sizing: border-box; color: #208080;">0xBE</span><span class="sy0" style="box-sizing: border-box;">,</span>&nbsp;<span class="nu12" style="box-sizing: border-box; color: #208080;">0xEF</span><span class="sy0" style="box-sizing: border-box;">,</span>&nbsp;<span class="nu12" style="box-sizing: border-box; color: #208080;">0xFE</span><span class="sy0" style="box-sizing: border-box;">,</span>&nbsp;<span class="nu12" style="box-sizing: border-box; color: #208080;">0xED</span><span class="br0" style="box-sizing: border-box;">}</span><span class="sy0" style="box-sizing: border-box;">;</span><br style="box-sizing: border-box;" />IPAddress ip<span class="br0" style="box-sizing: border-box;">(</span><span class="nu0" style="box-sizing: border-box;">10</span><span class="sy0" style="box-sizing: border-box;">,</span>&nbsp;<span class="nu0" style="box-sizing: border-box;">0</span><span class="sy0" style="box-sizing: border-box;">,</span>&nbsp;<span class="nu0" style="box-sizing: border-box;">0</span><span class="sy0" style="box-sizing: border-box;">,</span>&nbsp;<span class="nu0" style="box-sizing: border-box;">177</span><span class="br0" style="box-sizing: border-box;">)</span><span class="sy0" style="box-sizing: border-box;">;</span><br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /><span class="kw1" style="box-sizing: border-box; color: #cc6600;">void</span>&nbsp;<span class="kw3" style="box-sizing: border-box; color: #cc6600; font-weight: bold;">setup</span><span class="br0" style="box-sizing: border-box;">(</span><span class="br0" style="box-sizing: border-box;">)</span>&nbsp;<span class="br0" style="box-sizing: border-box;">{</span><br style="box-sizing: border-box;" />&nbsp;&nbsp;<span class="kw1" style="box-sizing: border-box; color: #cc6600;">Serial</span>.<span class="kw1" style="box-sizing: border-box; color: #cc6600;">begin</span><span class="br0" style="box-sizing: border-box;">(</span><span class="nu0" style="box-sizing: border-box;">9600</span><span class="br0" style="box-sizing: border-box;">)</span><span class="sy0" style="box-sizing: border-box;">;</span><br style="box-sizing: border-box;" />&nbsp;&nbsp;<span class="kw1" style="box-sizing: border-box; color: #cc6600;">while</span>&nbsp;<span class="br0" style="box-sizing: border-box;">(</span><span class="sy0" style="box-sizing: border-box;">!</span><span class="kw1" style="box-sizing: border-box; color: #cc6600;">Serial</span><span class="br0" style="box-sizing: border-box;">)</span>&nbsp;<span class="br0" style="box-sizing: border-box;">{</span><br style="box-sizing: border-box;" />&nbsp; &nbsp;&nbsp;<span class="sy0" style="box-sizing: border-box;">;</span>&nbsp;<span class="co1" style="box-sizing: border-box; color: #7e7e7e; font-style: italic;">// wait for serial port to connect. Needed for native USB port only</span><br style="box-sizing: border-box;" />&nbsp;&nbsp;<span class="br0" style="box-sizing: border-box;">}</span><br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" />&nbsp; Ethernet.<span class="kw1" style="box-sizing: border-box; color: #cc6600;">begin</span><span class="br0" style="box-sizing: border-box;">(</span>mac<span class="sy0" style="box-sizing: border-box;">,</span>&nbsp;ip<span class="br0" style="box-sizing: border-box;">)</span><span class="sy0" style="box-sizing: border-box;">;</span><br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" />&nbsp;&nbsp;<span class="kw1" style="box-sizing: border-box; color: #cc6600;">byte</span>&nbsp;macBuffer<span class="br0" style="box-sizing: border-box;">[</span><span class="nu0" style="box-sizing: border-box;">6</span><span class="br0" style="box-sizing: border-box;">]</span><span class="sy0" style="box-sizing: border-box;">;</span>&nbsp;&nbsp;<span class="co1" style="box-sizing: border-box; color: #7e7e7e; font-style: italic;">// create a buffer to hold the MAC address</span><br style="box-sizing: border-box;" />&nbsp; Ethernet.<span class="me1" style="box-sizing: border-box; color: #ff1493;">MACAddress</span><span class="br0" style="box-sizing: border-box;">(</span>macBuffer<span class="br0" style="box-sizing: border-box;">)</span><span class="sy0" style="box-sizing: border-box;">;</span>&nbsp;<span class="co1" style="box-sizing: border-box; color: #7e7e7e; font-style: italic;">// fill the buffer</span><br style="box-sizing: border-box;" />&nbsp;&nbsp;<span class="kw1" style="box-sizing: border-box; color: #cc6600;">Serial</span>.<span class="kw1" style="box-sizing: border-box; color: #cc6600;">print</span><span class="br0" style="box-sizing: border-box;">(</span><span class="st0" style="box-sizing: border-box; color: #0066cc;">"The MAC address is: "</span><span class="br0" style="box-sizing: border-box;">)</span><span class="sy0" style="box-sizing: border-box;">;</span><br style="box-sizing: border-box;" />&nbsp;&nbsp;<span class="kw1" style="box-sizing: border-box; color: #cc6600;">for</span>&nbsp;<span class="br0" style="box-sizing: border-box;">(</span><span class="kw1" style="box-sizing: border-box; color: #cc6600;">byte</span>&nbsp;octet&nbsp;<span class="sy0" style="box-sizing: border-box;">=</span>&nbsp;<span class="nu0" style="box-sizing: border-box;">0</span><span class="sy0" style="box-sizing: border-box;">;</span>&nbsp;octet&nbsp;<span class="sy0" style="box-sizing: border-box;">&lt;</span>&nbsp;<span class="nu0" style="box-sizing: border-box;">6</span><span class="sy0" style="box-sizing: border-box;">;</span>&nbsp;octet<span class="sy0" style="box-sizing: border-box;">++</span><span class="br0" style="box-sizing: border-box;">)</span>&nbsp;<span class="br0" style="box-sizing: border-box;">{</span><br style="box-sizing: border-box;" />&nbsp; &nbsp;&nbsp;<span class="kw1" style="box-sizing: border-box; color: #cc6600;">Serial</span>.<span class="kw1" style="box-sizing: border-box; color: #cc6600;">print</span><span class="br0" style="box-sizing: border-box;">(</span>macBuffer<span class="br0" style="box-sizing: border-box;">[</span>octet<span class="br0" style="box-sizing: border-box;">]</span><span class="sy0" style="box-sizing: border-box;">,</span>&nbsp;<span class="kw2" style="box-sizing: border-box; color: #006699;">HEX</span><span class="br0" style="box-sizing: border-box;">)</span><span class="sy0" style="box-sizing: border-box;">;</span><br style="box-sizing: border-box;" />&nbsp; &nbsp;&nbsp;<span class="kw1" style="box-sizing: border-box; color: #cc6600;">if</span>&nbsp;<span class="br0" style="box-sizing: border-box;">(</span>octet&nbsp;<span class="sy0" style="box-sizing: border-box;">&lt;</span>&nbsp;<span class="nu0" style="box-sizing: border-box;">5</span><span class="br0" style="box-sizing: border-box;">)</span>&nbsp;<span class="br0" style="box-sizing: border-box;">{</span><br style="box-sizing: border-box;" />&nbsp; &nbsp; &nbsp;&nbsp;<span class="kw1" style="box-sizing: border-box; color: #cc6600;">Serial</span>.<span class="kw1" style="box-sizing: border-box; color: #cc6600;">print</span><span class="br0" style="box-sizing: border-box;">(</span><span class="st0" style="box-sizing: border-box; color: #0066cc;">'-'</span><span class="br0" style="box-sizing: border-box;">)</span><span class="sy0" style="box-sizing: border-box;">;</span><br style="box-sizing: border-box;" />&nbsp; &nbsp;&nbsp;<span class="br0" style="box-sizing: border-box;">}</span><br style="box-sizing: border-box;" />&nbsp;&nbsp;<span class="br0" style="box-sizing: border-box;">}</span><br style="box-sizing: border-box;" /><span class="br0" style="box-sizing: border-box;">}</span><br style="box-sizing: border-box;" /><br style="box-sizing: border-box;" /><span class="kw1" style="box-sizing: border-box; color: #cc6600;">void</span>&nbsp;<span class="kw3" style="box-sizing: border-box; color: #cc6600; font-weight: bold;">loop</span>&nbsp;<span class="br0" style="box-sizing: border-box;">(</span><span class="br0" style="box-sizing: border-box;">)</span>&nbsp;<span class="br0" style="box-sizing: border-box;">{</span><span class="br0" style="box-sizing: border-box;">}</span><br style="box-sizing: border-box;" />&nbsp;</div>
      </div>
   <div class="sourceblocklink" style="box-sizing: border-box; margin: 0px; padding: 0px; direction: ltr; text-align: right; font-size: smaller;"><a href="https://www.arduino.cc/en/Reference/EthernetMACAddress?action=sourceblock&amp;num=1" type="text/plain" style="box-sizing: border-box; color: #00979c; text-decoration-line: none; line-height: inherit;" target="_blank">[Get Code]</a></div>
   </div>
<p style="box-sizing: border-box; margin-right: auto; margin-bottom: 1.5em; margin-left: auto; padding: 0px; direction: ltr; color: #4f4e4e; font-family: &quot;typoninesans regular 18&quot;, &quot;lucida grande&quot;, Lucida, Verdana, sans-serif; font-size: 18px; background-color: #ffffff;">&nbsp;</p>
<h4 style="box-sizing: border-box; margin: 1.2777em 0px 0.6em; padding: 0px; direction: ltr; line-height: 1.33333rem; text-rendering: optimizelegibility; color: #e67e22; font-size: 18px; hyphens: none; font-family: &quot;typoninesans regular 18&quot;; font-weight: 400; font-stretch: normal; background-color: #ffffff;">See also</h4>
<ul style="box-sizing: border-box; margin: 0px; padding: 0px 0px 0px 30px; direction: ltr; font-size: 18px; line-height: 1.6; list-style-position: outside; font-family: &quot;typoninesans regular 18&quot;, &quot;lucida grande&quot;, Lucida, Verdana, sans-serif; list-style-type: none; color: #4f4e4e; background-color: #ffffff;">
   <li style="box-sizing: border-box; margin: 0.235294rem 0px; padding: 0px; direction: ltr; text-indent: -18px;"><a class="wikilink" href="https://www.arduino.cc/en/Reference/EthernetLocalIP" style="box-sizing: border-box; color: #00979c; text-decoration-line: none; line-height: inherit;" target="_blank">Ethernet.localIP()</a></li>
   <li style="box-sizing: border-box; margin: 0.235294rem 0px; padding: 0px; direction: ltr; text-indent: -18px;"><a class="wikilink" href="https://www.arduino.cc/en/Reference/EthernetDnsServerIP" style="box-sizing: border-box; color: #00979c; text-decoration-line: none; line-height: inherit;" target="_blank">Ethernet.dnsServerIP()</a></li>
   <li style="box-sizing: border-box; margin: 0.235294rem 0px; padding: 0px; direction: ltr; text-indent: -18px;"><a class="wikilink" href="https://www.arduino.cc/en/Reference/EthernetGatewayIP" style="box-sizing: border-box; color: #00979c; text-decoration-line: none; line-height: inherit;" target="_blank">Ethernet.gatewayIP()</a></li>
   <li style="box-sizing: border-box; margin: 0.235294rem 0px; padding: 0px; direction: ltr; text-indent: -18px;"><a class="wikilink" href="https://www.arduino.cc/en/Reference/EthernetSubnetMask" style="box-sizing: border-box; color: #00979c; text-decoration-line: none; line-height: inherit;" target="_blank">Ethernet.subnetMask()</a></li>
   <li style="box-sizing: border-box; margin: 0.235294rem 0px; padding: 0px; direction: ltr; text-indent: -18px;"><a class="wikilink" href="https://www.arduino.cc/en/Reference/EthernetBegin" style="box-sizing: border-box; color: #00979c; text-decoration-line: none; line-height: inherit;" target="_blank">Ethernet.begin()</a></li>
   </ul>
<p style="box-sizing: border-box; margin-right: auto; margin-bottom: 1.5em; margin-left: auto; padding: 0px; direction: ltr; color: #4f4e4e; font-family: &quot;typoninesans regular 18&quot;, &quot;lucida grande&quot;, Lucida, Verdana, sans-serif; font-size: 18px; background-color: #ffffff;"><br style="box-sizing: border-box;" /><a class="wikilink" href="https://www.arduino.cc/en/Reference/HomePage" style="box-sizing: border-box; color: #00979c; text-decoration-line: none; line-height: inherit;" target="_blank">Reference Home</a></p>
<p style="box-sizing: border-box; margin-right: auto; margin-bottom: 1.5em; margin-left: auto; padding: 0px; direction: ltr; color: #4f4e4e; font-family: &quot;typoninesans regular 18&quot;, &quot;lucida grande&quot;, Lucida, Verdana, sans-serif; font-size: 18px; background-color: #ffffff;"><em style="box-sizing: border-box;">Corrections, suggestions, and new documentation should be posted to the&nbsp;<a class="urllink" href="http://arduino.cc/forum/index.php/board,23.0.html" rel="nofollow" style="box-sizing: border-box; color: #00979c; text-decoration-line: none; line-height: inherit;" target="_blank">Forum</a>.</em></p>
<p style="box-sizing: border-box; margin-right: auto; margin-bottom: 1.5em; margin-left: auto; padding: 0px; direction: ltr; color: #4f4e4e; font-family: &quot;typoninesans regular 18&quot;, &quot;lucida grande&quot;, Lucida, Verdana, sans-serif; font-size: 18px; background-color: #ffffff;">The text of the Arduino reference is licensed under a&nbsp;<a class="urllink" href="http://creativecommons.org/licenses/by-sa/3.0/" rel="nofollow" target="_blank" style="box-sizing: border-box; color: #00979c; text-decoration-line: none; line-height: inherit;">Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.</p>