Skip to content

Commit 84cbfd5

Browse files
jipanyanglguohan
authored andcommitted
[configdb]: Store switch mac to configDB switch table (#1108)
Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>
1 parent c17d6a7 commit 84cbfd5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

files/image_config/interfaces/interfaces-config.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ fi
1212

1313
sonic-cfggen -d -a '{"hwaddr":"'$SYSTEM_MAC_ADDRESS'"}' -t /usr/share/sonic/templates/interfaces.j2 > /etc/network/interfaces
1414

15+
# Also store the system mac to configDB switch table. User configured switch_mac is not supported for now.
16+
/usr/bin/docker exec database redis-cli -n 4 hset SWITCH\|SWITCH_ATTR switch_mac $SYSTEM_MAC_ADDRESS
17+
1518
[ -f /var/run/dhclient.eth0.pid ] && kill `cat /var/run/dhclient.eth0.pid` && rm -f /var/run/dhclient.eth0.pid
1619

1720
systemctl restart networking

0 commit comments

Comments
 (0)