Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
22 years ago

Ethernet MAC Address

Which file has the ethernet MAC address? What is the variable name? Any suggestions for making this changable for production?

5 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I have a script that should allow you to change your MAC address fairly easily. It writes to the last sector of flash which is where the Linux kernel looks for the MAC address.

    Which board are you using? I'll test it out on that board for you to make sure it works and then I'll post the script that I use online later
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I use the Altera Cyclone NIOS board, but I also need to implement it on a custom board. Which source file retrieves/specifies where the MAC address is stored?

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The file that reads the MAC address from flash is setup.c and it can be found in <linux eclipse plugin directory>/linux-2.6.x/arch/nios2nommu/kernel.

    Dennis Scott

    Microtronix Datacom Ltd.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Ken:

    Did you ever post the script? I&#39;m interested in using it with a custom board.

    Thanks.

    -John

    --- Quote Start ---

    originally posted by ken@Dec 6 2004, 09:39 AM

    i have a script that should allow you to change your mac address fairly easily. it writes to the last sector of flash which is where the linux kernel looks for the mac address.

    which board are you using? i&#39;ll test it out on that board for you to make sure it works and then i&#39;ll post the script that i use online later

    <div align='right'><{post_snapback}> (index.php?act=findpost&pid=3043)

    --- quote end ---

    --- Quote End ---

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The format of the sector is listed in:

    nios2\examples\software\simple_socket_server\network_utilities.c

    This is actually part of the MicroC/OS-II example, but you should be able to strip out the stuff you need to make your own programming utility.