From d1156ca3b2b78d0803562faf5062df93c0a4fe72 Mon Sep 17 00:00:00 2001 From: Shuotian Cheng Date: Thu, 26 Oct 2017 14:20:44 -0700 Subject: [PATCH] [teamd]: Bring down all member interfaces before starting teamd (#1081) teamd requires all members to be set down before adding as a team port Signed-off-by: Shu0T1an ChenG --- dockers/docker-teamd/start.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dockers/docker-teamd/start.sh b/dockers/docker-teamd/start.sh index 6b0a3d7858..6e80f6eb9a 100755 --- a/dockers/docker-teamd/start.sh +++ b/dockers/docker-teamd/start.sh @@ -17,6 +17,12 @@ fi for pc in `sonic-cfggen -d -v "PORTCHANNEL.keys() | join(' ') if PORTCHANNEL"`; do sonic-cfggen -d -a '{"pc":"'$pc'","hwaddr":"'$MAC_ADDRESS'"}' -t /usr/share/sonic/templates/teamd.j2 > $TEAMD_CONF_PATH/$pc.conf + # bring down all member ports before starting teamd + for member in $(sonic-cfggen -d -v "PORTCHANNEL['$pc']['members'] | join(' ')" ); do + if [ -L /sys/class/net/$member ]; then + ip link set $member down + fi + done done mkdir -p /var/sonic