Setting static mac for a port


I need to set a static MAC for a given port. I am unable to find any command under Cumulus Linux reference guide. Could you provide me any pointer to it.

Thanks in advance.

7 replies

Userlevel 4
Which reference guide were you using?

cumulus@leaf1002:mgmt-vrf:~$ ip addr show swp14: swp1:  mtu 9216 qdisc pfifo_fast master server1001-d state UP group default qlen 1000
link/ether 44:38:39:00:00:7c brd ff:ff:ff:ff:ff:ff
nano or vi /etc/network/interfaces
auto swp1 iface swp1
mtu 9216
hwaddress 00:12:34:56:78:90

Then ifdown/ifup that port (or do an ifreload -a)

4: swp1:  mtu 9216 qdisc pfifo_fast master server1001-d state UP group default qlen 1000     link/ether 00:12:34:56:78:90 brd ff:ff:ff:ff:ff:ff
Thanks Sean. But I meant 'static mac' as below , I.E. "A Static MAC address is one that has been manualy input (typed via a command) into the CAM or MAC address table. A dynamic MAC address is one that has been learned via an arp request. For example if a switch learns the MAC address from another device then it has dynamically sourced the MAC address." I am referring to this link https://support.cumulusnetworks.com/hc/en-us/articles/205384457-Cumulus-Linux-Command-Reference-Guide Thanks
Userlevel 4
Hey Nivas,

This would took some help from Roopa (one of our developers). I had not configured this on the VLAN-aware bridge yet.

What you need to do is use "bridge fdb add"

root@switch:mgmt-vrf# bridge fdb add 12:34:56:12:34:56 dev swp1 vlan 150 master static
root@switch:mgmt-vrf# bridge fdb show
44:38:39:00:00:7c dev swp1 master bridge permanent
12:34:56:12:34:56 dev swp1 vlan 150 master bridge static
44:38:39:00:00:7c dev swp1 self permanent
12:12:12:12:12:12 dev swp1 self permanent
12:34:12:34:12:34 dev swp1 self permanent
12:34:56:12:34:56 dev swp1 self permanent
12:34:12:34:12:34 dev bridge master bridge permanent
44:38:39:00:00:7c dev bridge vlan 500 master bridge permanent
12:12:12:12:12:12 dev bridge master bridge permanent
Thanks again Sean. Is it possible through NCLU tool too? .
Userlevel 4
In another post you said you are running 3.0.0 and 3.2. NCLU will only work on 3.2 and newer. Is that ok?
Sean Cavanaugh wrote:

In another post you said you are running 3.0.0 and 3.2. NCLU will only work on 3.2 and newer. ...

yes..as suggested we started testing 3.2 too..now we have both 3.0 and 3.2 running in different switches. Our objective is to do all the needed things through commands (with out editing any files manually). If 3.2 suits our need, then we are happy to go only with 3.2
Userlevel 4
Sean Cavanaugh wrote:

In another post you said you are running 3.0.0 and 3.2. NCLU will only work on 3.2 and newer. ...

Our objective is to do all the needed things through commands (with out editing any files manually)

So there is literally a ton of programs that will edit the files for you. Ansible, Puppet and Chef all specialize with manipulation of flat files and controlling configuration policy. You don't "have" to use flat-file manipulation but I just wanted to make that option available to you.

Reply