if test ! -e "$CACERT" && test "$CACERT_MODE" != bootstrap; then
echo "$CACERT: CA certificate missing (and CA certificate bootstrapping not enabled)" >&2
fi
- echo "Run ofp-switch-setup or edit /etc/default/openflow-switch to configure" >&2
+ echo "Run ofp-switch-setup (in the openflow-switch-config package) or edit /etc/default/openflow-switch to configure" >&2
if test "$MODE" = discovery; then
echo "You may also delete or rename $PRIVKEY to disable SSL requirement" >&2
fi
start)
if test -z "$NETDEVS"; then
echo "$default: No network devices configured, switch disabled" >&2
- echo "Run ofp-switch-setup or edit /etc/default/openflow-switch to configure" >&2
+ echo "Run ofp-switch-setup (in the openflow-switch-config package) or edit /etc/default/openflow-switch to configure" >&2
exit 0
fi
if test "$MODE" = discovery; then
elif test "$MODE" = in-band || test "$MODE" = out-of-band; then
if test -z "$CONTROLLER"; then
echo "$default: No controller configured and not configured for discovery, switch disabled" >&2
- echo "Run ofp-switch-setup or edit /etc/default/openflow-switch to configure" >&2
+ echo "Run ofp-switch-setup (in the openflow-switch-config package) or edit /etc/default/openflow-switch to configure" >&2
exit 0
fi
else
echo "$default: MODE must set to 'discovery', 'in-band', or 'out-of-band'" >&2
- echo "Run ofp-switch-setup or edit /etc/default/openflow-switch to configure" >&2
+ echo "Run ofp-switch-setup (in the openflow-switch-config package) or edit /etc/default/openflow-switch to configure" >&2
exit 1
fi
: ${PRIVKEY:=/etc/openflow-switch/of0-privkey.pem}
;;
*)
echo "$default: CONTROLLER must be in the form 'ssl:HOST[:PORT]' or 'tcp:HOST[:PORT]' when not in discovery mode" >&2
- echo "Run ofp-switch-setup or edit /etc/default/openflow-switch to configure" >&2
+ echo "Run ofp-switch-setup (in the openflow-switch-config package) or edit /etc/default/openflow-switch to configure" >&2
exit 1
esac
if test "$SWITCH_IP" = dhcp; then
must_succeed "Temporarily disabling of0" ifconfig of0 down
else
- must_succeed "Configuring of0 as $SWITCH_IP" ifconfig of0 $SWITCH_IP
+ 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
echo -n "Starting $DESC: "
start-stop-daemon --start --quiet --pidfile $PIDFILE \
--exec $DAEMON -- nl:0 $CONTROLLER --detach --pidfile=$PIDFILE \
- --verbose=ANY:console:emer $DAEMON_OPTS $MGMT_OPTS $SSL_OPTS \
- "$COMMAND_OPT"
+ --verbose=ANY:console:emer --verbose=ANY:syslog:err --log-file \
+ $DAEMON_OPTS $MGMT_OPTS $SSL_OPTS "$COMMAND_OPT"
if running; then
echo "$NAME."
else
check_op "Removing $netdev from datapath" dpctl delif nl:0 $netdev
done
check_op "Deleting datapath" dpctl deldp nl:0
+ check_op "Unloading kernel module" modprobe -r openflow_mod
;;
force-stop)
echo -n "Forcefully stopping $DESC: "