Commit af11c51e authored by Dimitris Aragiorgis's avatar Dimitris Aragiorgis Committed by Klaus Aehlig
Browse files

Better ovs support in NIC configuration scripts



Make setup_ovs() function in net-common library to use
exported VLAN variable. Use it to set port's tag and trunks.
Signed-off-by: default avatarDimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent 747ee762
......@@ -67,7 +67,21 @@ function setup_bridge {
function setup_ovs {
if [ "$MODE" = "openvswitch" ]; then
# Remove stale port
ovs-vsctl del-port $INTERFACE || true
# Bring interface up
ip link set $INTERFACE up
# Add port
ovs-vsctl add-port ${LINK} $INTERFACE
# Set up access port
# From gnt-instance man page vlan should be either .VLAN_ID or VLAN_ID
ACPORT=${VLAN%%:*} # remove any trunk info
[ -n "$ACPORT" ] && ovs-vsctl set port $INTERFACE tag=${ACPORT#.}
# Set up trunk port
# From gnt-instance man page vlan should be :VLAN_ID[:VLAN_ID2..]
TRUNKS=${VLAN#.*:} # remove any access info
[ -n "$TRUNKS" ] && ovs-vsctl set port $INTERFACE trunks=${TRUNKS//:/,}
fi
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment