Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion files/build_templates/docker_image_ctl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,18 @@ function postStartAction()
ip link set dev ns-eth1"$NET_NS" netns "$NET_NS"
ip netns exec "$NET_NS" ip link set ns-eth1"$NET_NS" name eth1

if [[ -n "$lc_ip_offset" ]]; then
# Use ip offset provided by platform vendor via chassisdb.conf to prevent any conflict
# with any platform IP range, e.g., LC eth1-midplane IP.
ip_offset=$lc_ip_offset
else
# If Vendor has not provided an ip offset, Use 10 as default offset. Platform vendor should
# ensure there is no conflict with platform IP range for any slot.
ip_offset=10
fi

# Configure IP address and enable eth1
slot_ip_address=`echo $midplane_subnet | awk -F. '{print $1 "." $2}'`.$slot_id.$(($DEV + 10))
slot_ip_address=`echo $midplane_subnet | awk -F. '{print $1 "." $2}'`.$slot_id.$(($DEV + $ip_offset))
slot_subnet_mask=${midplane_subnet#*/}
ip netns exec "$NET_NS" ip addr add $slot_ip_address/$slot_subnet_mask dev eth1
ip netns exec "$NET_NS" ip link set dev eth1 up
Expand Down
Loading