+
+ @staticmethod
+ def linux_add_bridge(node, br_name, if_1, if_2):
+ """Bridge two interfaces on linux node.
+
+ :param node: Node to add bridge on.
+ :param br_name: Bridge name.
+ :param if_1: First interface to be added to the bridge.
+ :param if_2: Second interface to be added to the bridge.
+ :type node: dict
+ :type br_name: str
+ :type if_1: str
+ :type if_2: str
+ """
+ cmd = 'brctl addbr {0}'.format(br_name)
+ exec_cmd_no_error(node, cmd, sudo=True)
+ cmd = 'brctl addif {0} {1}'.format(br_name, if_1)
+ exec_cmd_no_error(node, cmd, sudo=True)
+ cmd = 'brctl addif {0} {1}'.format(br_name, if_2)
+ exec_cmd_no_error(node, cmd, sudo=True)
+
+ @staticmethod
+ def linux_del_bridge(node, br_name):
+ """Delete bridge from linux node.
+
+ :param node: Node to delete bridge from.
+ :param br_name: Bridge name.
+ .. note:: The network interface corresponding to the bridge must be
+ down before it can be deleted!
+ """
+ cmd = 'brctl delbr {0}'.format(br_name)
+ exec_cmd_no_error(node, cmd, sudo=True)