1 ##############################################################################
2 # Copyright (c) 2015 Ericsson AB and others.
3 # stefan.k.berg@ericsson.com
4 # jonas.bjurel@ericsson.com
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
13 # Provides: control-bond
14 # Required-Start: $remote_fs $all
16 # Default-Start: 2 3 4 5
18 # Short-Description: Bonds eth0 and eth1 and changes bridge configuration.
22 PATH=/sbin:/usr/sbin:/bin:/usr/bin
23 VSCTL=/usr/bin/ovs-vsctl
24 APPCTL=/usr/bin/ovs-appctl
28 logger "Starting addition of control-bond"
29 $VSCTL --may-exist br-fw-admin
30 $VSCTL --may-exist br-mgmt
31 $VSCTL add-bond br-fw-admin bond-control eth0 eth1
33 $VSCTL set port br-mgmt tag=66
34 $APPCTL bond/set-active-slave bond-control eth0
36 $VSCTL add-port br-fw-admin admin-to-mgmt
37 $VSCTL add-port br-mgmt mgmt-to-admin
38 $VSCTL set interface admin-to-mgmt type=patch
39 $VSCTL set interface mgmt-to-admin type=patch
41 $VSCTL set interface admin-to-mgmt options:peer=mgmt-to-admin
42 $VSCTL set interface mgmt-to-admin options:peer=admin-to-mgmt
44 $VSCTL set port admin-to-mgmt trunk=66
45 $VSCTL set port mgmt-to-admin trunk=66
46 logger "Finished addition of control-bond"
49 status_control_bond() {
50 if [ ! -f $VSCTL ]; then
53 $VSCTL show | grep -q "admin-to-mgmt"
67 restart|reload|force-reload)
68 echo "Error: argument '$1' not supported" >&2
74 echo "The control-bond is enabled"
77 echo "The control-bond is disabled"
83 echo "Stop is not supported"
87 echo "Usage: $0 start|status" >&2