- must_succeed "Creating datapath" ovs-dpctl add-dp of0 $NETDEVS
-
- xx='[0-9abcdefABCDEF][0-9abcdefABCDEF]'
- case $DATAPATH_ID in
- '')
- # Check if the DMI System UUID contains a Nicira mac address
- # that should be used for this datapath. The UUID is assumed
- # to be RFC 4122 compliant.
- DMIDECODE=`which dmidecode`
- if [ -n $DMIDECODE ]; then
- UUID_MAC=`$DMIDECODE -s system-uuid | cut -d'-' -f 5`
- case $UUID_MAC in
- $NICIRA_OUI*)
- ifconfig of0 down
- must_succeed "Setting of0 MAC address to $UUID_MAC" ifconfig of0 hw ether $UUID_MAC
- ifconfig of0 up
- ;;
- esac
- fi
- ;;
- $xx:$xx:$xx:$xx:$xx:$xx)
- ifconfig of0 down
- must_succeed "Setting of0 MAC address to $DATAPATH_ID" ifconfig of0 hw ether $DATAPATH_ID
- ifconfig of0 up
- ;;
- *)
- echo "DATAPATH_ID is not a valid MAC address in the form XX:XX:XX:XX:XX:XX, ignoring" >&2
- ;;
- esac
-
- if test "$MODE" = in-band; then
- if test "$SWITCH_IP" = dhcp; then
- must_succeed "Temporarily disabling of0" ifconfig of0 down
- else
- COMMAND="ifconfig of0 $SWITCH_IP"
- if test -n "$SWITCH_NETMASK"; then
- COMMAND="$COMMAND netmask $SWITCH_NETMASK"
- fi
- must_succeed "Configuring of0: $COMMAND" $COMMAND
- if test -n "$SWITCH_GATEWAY"; then
- # This can fail because the route already exists,
- # so we don't insist that it succeed.
- COMMAND="route add default gw $SWITCH_GATEWAY"
- check_op "Adding default route: $COMMAND" $COMMAND
- fi
- fi
- else
- must_succeed "Disabling of0" ifconfig of0 down