Skip to content

Commit b305a50

Browse files
Shuotian Chenglguohan
Shuotian Cheng
authored andcommitted
[interfaces]: Bring up LAG members before they are enslaved (#505)
Signed-off-by: Shuotian Cheng <[email protected]>
1 parent abf54c2 commit b305a50

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

files/image_config/interfaces/interfaces.j2

+2-1
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,15 @@ iface {{ member }} inet manual
6969
{% endfor %}
7070
{% if minigraph_portchannels.keys() | length %}
7171
# "|| true" is added to suppress the error when interface is already a member of LAG
72+
# "ip link show | grep -q master" is added to ensure interface is enslaved
7273
{% endif %}
7374
{% for pc in minigraph_portchannels.keys()|sort %}
7475
{% for member in minigraph_portchannels[pc]['members'] %}
7576
auto {{ member }}
7677
allow-hotplug {{ member }}
7778
iface {{ member }} inet manual
7879
pre-up teamdctl {{ pc }} port add {{ member }} || true
79-
post-up ip link show {{ pc }} && ifconfig {{ member }} up
80+
post-up ip link show {{ member }} | grep -q master && ifconfig {{ member }} up
8081
post-down ifconfig {{ member }} down
8182
#
8283
{% endfor %}

0 commit comments

Comments
 (0)