ofp-discover(8)

NAME
ofp-discover - controller discovery utility

SYNOPSIS
ofp-discover [options] netdev [netdev...]

DESCRIPTION
The ofp-discover program attempts to discover the location of an OpenFlow controller on one of the network devices listed on the command line. It repeatedly broadcasts a DHCP request with vendor class identifier OpenFlow on each network device until it receives an acceptable DHCP response. It will accept any valid DHCP reply that has the same vendor class identifier and includes a vendor-specific option with code 1 whose contents are a string specifying the location of the controller in the same format used on the ofprotocol command line (e.g. ssl:192.168.0.1).

When ofp-discover receives an acceptable response, it prints the details of the response on stdout. Then, by default, it configures the network device on which the response was received with the received IP address, netmask, and default gateway, and detaches itself to the background.

OPTIONS

--accept-vconn=regex
    By default, ofp-discover accepts any controller location advertised over DHCP. With this option, only controllers whose names match POSIX extended regular expression regex will be accepted. Specifying ssl:.* for regex, for example, would cause only SSL controller connections to be accepted.

    The regex is implicitly anchored at the beginning of the controller location string, as if it begins with ^.

--exit-without-bind
    By default, ofp-discover binds the network device that receives the first acceptable response to the IP address received over DHCP. With this option, the configuration of the network device is not changed at all, except to bring it up if it is initially down, and ofp-discover will exit immediately after it receives an acceptable DHCP response.

    This option is mutually exclusive with --exit-after-bind and --no-detach.

--exit-after-bind
    By default, after it receives an acceptable DHCP response, ofp-discover detaches itself from the foreground session and runs in the background maintaining the DHCP lease as necessary. With this option, ofp-discover will exit immediately after it receives an acceptable DHCP response and configures the network device with the received IP address. The address obtained via DHCP could therefore be used past the expiration of its lease.

    This option is mutually exclusive with --exit-without-bind and --no-detach.

--no-detach
    By default, ofp-discover runs in the foreground until it obtains an acceptable DHCP response, then it detaches itself from the foreground session and run as a background process. This option prevents ofp-discover from detaching, causing it to run in the foreground even after it obtains a DHCP response.

    This option is mutually exclusive with --exit-without-bind and --exit-after-bind.

-P[pidfile], --pidfile[=pidfile]
    Causes a file (by default, ofp-discover.pid) to be created indicating the PID of the running process. If pidfile is not specified, or if it does not begin with /, then it is created in /var/run.

    The pidfile is created when ofp-discover detaches, so this this option has no effect when one of --exit-without-bind, --exit-after-bind, or --no-detach is also given.

-f, --force
    By default, when -P or --pidfile is specified and the specified pidfile already exists and is locked by a running process, controller refuses to start. Specify -f or --force to cause it to instead overwrite the pidfile.

    When -P or --pidfile is not specified, this option has no effect.

-vmodule[:facility[:level]], --verbose=module[:facility[:level]]

    Sets the logging level for module in facility to level:

    •   module may be any valid module name (as displayed by the --list action on vlogconf(8)), or the special name ANY to set the logging levels for all modules.

    •   facility may be syslog, console, or file to set the levels for logging to the system log, the console, or a file respectively, or ANY to set the logging levels for both facilities. If it is omitted, facility defaults to ANY.

        Regardless of the log levels set for file, logging to a file will not take place unless --log-file is also specified (see below).

    •   level must be one of emer, err, warn, info, or dbg, designating the minimum severity of a message for it to be logged. If it is omitted, level defaults to dbg.

-v, --verbose
    Sets the maximum logging verbosity level, equivalent to --verbose=ANY:ANY:dbg.

-vPATTERN:facility:pattern, --verbose=PATTERN:facility:pattern
    Sets the log pattern for facility to pattern. Refer to vlogconf(8) for a description of the valid syntax for pattern.

--log-file[=file]
    Enables logging to a file. If file is specified, then it is used as the exact name for the log file. The default log file name used if file is omitted is /var/log/openflow/ofp-discover.log.

-h, --help
    Prints a brief help message to the console.

-V, --version
    Prints version information to the console.

BUGS

If the network devices specified on the command line have been added to an OpenFlow switch with dpctl addif, then controller discovery will fail because ofp-discover will not be able to see DHCP responses, even though tools such as tcpdump(8) and wireshark(1) can see them on the wire. This is because of the structure of the Linux kernel networking stack, which hands packets first to programs that listen for all arriving packets, then to OpenFlow, then to programs that listen for a specific kind of packet. OpenFlow consumes all the packets handed to it, so tools like tcpdump that look at all packets will see packets arriving on OpenFlow interfaces, but ofp-discover, which listens only for arriving IP packets, will not.

SEE ALSO

ofprotocol(8), ofp-pki(8)