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 @RUNDIR@. 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.

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)