# Interface MAC Address in IOS Layer-2 Images

DevFeed: [Interface MAC Address in IOS Layer-2 Images](<https://devfeed.tech/articles/interface-mac-address-in-ios-layer-2-images-11324.md>)

Original publisher: [Read original article](<https://blog.ipspace.net/2026/02/ios-layer2-mac-address/>)

Published: 2026-02-03T07:08:00Z

Content type: article

Language: en

Sources: [ipSpace.net blog](<https://devfeed.tech/sources/ipspace-net-blog.md>)

Topics: [Cisco](<https://devfeed.tech/topics/cisco.md>), [bug](<https://devfeed.tech/topics/bug.md>), [configuration](<https://devfeed.tech/topics/configuration.md>), [Ansible](<https://devfeed.tech/topics/ansible.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [ansible](<https://devfeed.tech/tags/ansible.md>), [bug](<https://devfeed.tech/tags/bug.md>), [cisco](<https://devfeed.tech/tags/cisco.md>), [code](<https://devfeed.tech/tags/code.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [netlab](<https://devfeed.tech/tags/netlab.md>)

## AI overview

The article explains that Cisco IOS layer-2 images change an interface's MAC address when its switchport status changes. It also describes how a bug in a netlab Jinja template and Ansible's configuration comparison can leave the resulting device configuration inconsistent.

## Source excerpt

Here's another "You can't make this up, but it sounds too crazy to be true" story: Cisco IOS layer-2 images change the interface MAC address when you change the interface switchport status. Let me start with a bit of background: IOL Layer 2 image starts with interfaces enabled and in bridged (switchport) mode (details) netlab has to run a normalize script (applicable to IOLL2, IOSv L2, and Arista EOS) before configuring anything else to ensure all interfaces are shut down. The IOLL2 normalize Jinja template had a bug - when setting the interface MAC address, it checked l.mac_address instead of intf.mac_address. Nevertheless, everything worked because the MAC addresses were also set during the initial device configuration. Read more ...