bridge ageing-time=0 is not working using NMCLI

Issues related to configuring your network
Post Reply
primitivo
Posts: 2
Joined: 2020/12/30 13:17:15

bridge ageing-time=0 is not working using NMCLI

Post by primitivo » 2020/12/30 14:23:23

Hi all
I'm using two VM , in a lab enviroment VM1 and VM2 with CENTOS 7 to test an l2gre setup
On VM1 I have configured the gretap interface and a bridge linux wth the following NMCLI command
nmcli connection add type bridge con-name bridge0 ifname bridge0
nmcli connection add type ethernet slave-type bridge con-name bridge0-port1 ifname eth2 master bridge0
nmcli connection add type ip-tunnel ip-tunnel.mode gretap slave-type bridge con-name bridge0-port2 ifname gretap1 remote 10.23.200.8 local 10.23.200.1 master bridge0
nmcli connection modify bridge0 connection.autoconnect-slaves 1
nmcli connection up bridge0
nmcli connection modify bridge0 ipv4.addresses '192.0.2.1/24'
nmcli connection modify bridge0 ipv4.method manual
nmcli con modify bridge0 bridge.stp no
On VM2 I have configured the gretap interface and a bridge linux wth the following NMCLI command
nmcli connection add type bridge con-name bridge0 ifname bridge0
nmcli connection add type ip-tunnel ip-tunnel.mode gretap slave-type bridge con-name bridge0-port2 ifname gretap1 remote 10.23.200.1 local 10.23.200.8 master bridge0
nmcli connection modify bridge0 connection.autoconnect-slaves 1
nmcli connection up bridge0
nmcli connection modify bridge0 ipv4.addresses '192.0.2.2/24'
nmcli connection modify bridge0 ipv4.method manual

The gretap between the two VM is working fine and the bridge too I tested pinging between the bridge IP Address of the two VM
Now on VM1 I' want modify the bridge to working as an hub device so I add the NMCLI command:

nmcli con modify bridge0 bridge.ageing-time 0 (I suppose that is the same as brctl setageing bridge0 0 used with bridge utilis script)

[root@centosa network-scripts]# cat ifcfg-bridge0
STP=no
TYPE=Bridge
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=bridge0
UUID=20fa2ec4-dec6-4243-bf17-bff602b2f20e
DEVICE=bridge0
ONBOOT=yes
AUTOCONNECT_SLAVES=yes
IPADDR=192.0.2.1
PREFIX=24
BRIDGING_OPTS=ageing_time=0

The problem is that after this change the bridge still learning dynamic MAC Address so it seems the command is not working well
I try to reload and update the connection, reboot the VM, but not solve

Do you have any suggestion?

[root@centosa network-scripts]# bridge fdb show
01:00:5e:00:00:01 dev eth0 self permanent
33:33:00:00:00:01 dev eth0 self permanent
33:33:ff:94:87:e8 dev eth0 self permanent
01:00:5e:00:00:01 dev eth1 self permanent
33:33:00:00:00:01 dev eth1 self permanent
33:33:ff:90:4a:e1 dev eth1 self permanent
fa:16:3e:8e:0f:ac dev eth2 master bridge0 permanent
fa:16:3e:8e:0f:ac dev eth2 vlan 1 master bridge0 permanent
01:00:5e:00:00:01 dev eth2 self permanent
33:33:00:00:00:01 dev eth2 self permanent
33:33:00:00:00:01 dev gretap0 self permanent
01:00:5e:00:00:01 dev bridge0 self permanent
33:33:00:00:00:01 dev bridge0 self permanent
33:33:ff:7b:2c:db dev bridge0 self permanent
1a:0c:d4:e0:7f:a9 dev gretap1 master bridge0 permanent
ea:f8:76:08:7a:07 dev gretap1 master bridge0 <<<<<<<<<<< dynamic MAC Address learned
1a:0c:d4:e0:7f:a9 dev gretap1 vlan 1 master bridge0 permanent
01:00:5e:00:00:01 dev gretap1 self permanent
33:33:00:00:00:01 dev gretap1 self permanent

primitivo
Posts: 2
Joined: 2020/12/30 13:17:15

Re: bridge ageing-time=0 is not working using NMCLI

Post by primitivo » 2020/12/31 16:30:29

Update...hope that can be useful to whom met the same issue

1- Tried these command to disable MAC learning on the port but doesn't work, MAC Address dynamic still present
[root@centosa ~]# bridge link set dev eth2 learning off learning_sync off
[root@centosa ~]# bridge link set dev gretap1 learning off learning_sync off

2- Download and installed bridge utilis, bridge-utils-1.5-9.el7.x86_64.rpm

set the brctl setageing bridge0 0 commad and finally it worked, dynamic MAC Address are not learned anymore

[root@centosa network-scripts]# brctl showmacs bridge0
port no mac addr is local? ageing timer
2 1a:0c:d4:e0:7f:a9 yes 0.00
2 1a:0c:d4:e0:7f:a9 yes 0.00
2 ea:f8:76:08:7a:07 no 1.26
1 fa:16:3e:8e:0f:ac yes 0.00
1 fa:16:3e:8e:0f:ac yes 0.00

[root@centosa network-scripts]# brctl setageing bridge0 0
[root@centosa network-scripts]#

[root@centosa network-scripts]# brctl showmacs bridge0
port no mac addr is local? ageing timer
2 1a:0c:d4:e0:7f:a9 yes 0.00
2 1a:0c:d4:e0:7f:a9 yes 0.00
1 fa:16:3e:8e:0f:ac yes 0.00
1 fa:16:3e:8e:0f:ac yes 0.00

Unfortunately after reboot the brctl setageing bridge0 0 command is not enabled so to solve, after search on google, I added it into /etc/rc.local file and then gave chmod 755 /etc/rc.local command
Now even after reboot the bridge doesn't learn dynamic MAC Address anymore and worked as an hub
So I think that the nmcli command "nmcli con modify bridge0 bridge.ageing-time 0" or is not the same as "brctl setageing bridge0 0" or not work

Post Reply

Return to “CentOS 7 - Networking Support”