ovs-appctl

package: openvswitch

title: ovs-appctl(8)

text:
# ovs-appctl(8)

## NAME
ovs-appctl - utility for configuring running Open vSwitch daemons

## SYNOPSIS
ovs-appctl [--target=target | -t target] [--timeout=secs | -T secs] command [arg ...]

ovs-appctl --help

ovs-appctl --version

## DESCRIPTION
Open vSwitch daemons accept certain commands at runtime to control their behavior and query their settings. Every daemon accepts a common set of commands documented under Common Commands below. Some daemons support additional commands documented in their own manpages. ovs-vswitchd in particular accepts a number of additional commands documented in ovs-vswitchd(8).

The ovs-appctl program provides a simple way to invoke these commands. The command to be sent is specified on ovs-appctl’s command line as non-option arguments. ovs-appctl sends the command and prints the daemon’s response on standard output.

In normal use only a single option is accepted:

- -t target or --target=target Tells ovs-appctl which daemon to contact.

If target begins with / it must name a Unix domain socket on which an Open vSwitch daemon is listening for control channel connections. By default, each daemon listens on a Unix domain socket in the rundir (e.g. /run) named <program>.<pid>.ctl, where <program> is the program’s name and <pid> is its process ID. For example, if ovs-vswitchd has PID 123, it would listen on ovs-vswitchd.123.ctl.

Otherwise, ovs-appctl looks in the rundir for a pidfile, that is, a file whose contents are the process ID of a running process as a decimal number, named target.pid. (The --pidfile option makes an Open vSwitch daemon create a pidfile.) ovs-appctl reads the pidfile, then looks in the rundir for a Unix socket named target.<pid>.ctl, where <pid> is replaced by the process ID read from the pidfile, and uses that file as if it had been specified directly as the target.

On Windows, target can be an absolute path to a file that contains a localhost TCP port on which an Open vSwitch daemon is listening for control channel connections. By default, each daemon writes the TCP port on which it is listening for control connection into the file <program>.ctl located inside the rundir. If target is not an absolute path, ovs-appctl looks in the rundir for a file named target.ctl. The default target is ovs-vswitchd.

- -T secs or --timeout=secs By default, or with a secs of 0, ovs-appctl waits forever to connect to the daemon and receive a response. This option limits runtime to approximately secs seconds. If the timeout expires, ovs-appctl exits with a SIGALRM signal.

## COMMON COMMANDS
Every Open vSwitch daemon supports a common set of commands, which are documented in this section.

### General Commands
These commands display daemon-specific commands and the running version. Note that these commands are different from the --help and --version options that return information about the ovs-appctl utility itself.

- list-commands Lists the commands supported by the target.

- version Displays the version and compilation date of the target.

### Logging Commands
Open vSwitch has several log levels. The highest-severity log level is:

•

off No message is ever logged at this level, so setting a logging destination’s log level to off disables logging to that destination.

The following log levels, in order of descending severity, are available:

- emer A major failure forced a process to abort.

- err A high-level operation or a subsystem failed. Attention is warranted.

- warn A low-level operation failed, but higher-level subsystems may be able to recover.

- info Information that may be useful in retrospect when investigating a problem.

- dbg Information useful only to someone with intricate knowledge of the system, or that would commonly cause too-voluminous log output. Log messages at this level are not logged by default.

Every Open vSwitch daemon supports the following commands for examining and adjusting log levels:

- vlog/list Lists the known logging modules and their current levels.

- vlog/list-pattern Lists logging pattern used for each destination.

- vlog/set [spec] Sets logging levels. Without any spec, sets the log level for every module and destination to dbg. Otherwise, spec is a list of words separated by spaces or commas or colons, up to one from each category below:

- A valid module name, as displayed by the vlog/list command on ovs-appctl(8), limits the log level change to the specified module.

- syslog, console, or file, to limit the log level change to only to the system log, to the console, or to a file, respectively. On Windows platform, syslog is only useful if target was started with the --syslog-target option (it has no effect otherwise).

- off, emer, err, warn, info, or dbg, to control the log level. Messages of the given severity or higher will be logged, and messages of lower severity will be filtered out. off filters out all messages.

Case is not significant within spec.

Regardless of the log levels set for file, logging to a file will not take place unless the target application was invoked with the --log-file option.

For compatibility with older versions of OVS, any is accepted within spec but it has no effect.

•

vlog/set PATTERN:destination:pattern Sets the log pattern for destination to pattern. Each time a message is logged to destination, pattern determines the message’s formatting. Most characters in pattern are copied literally to the log, but special escapes beginning with % are expanded as follows:

- %A The name of the application logging the message, e.g. ovs-vswitchd.

- %B The RFC5424 syslog PRI of the message.

- %c The name of the module (as shown by ovs-appctl --list) logging the message.

- %d The current date and time in ISO 8601 format (YYYY-MM-DD HH:MM:SS).

- %d{format} The current date and time in the specified format, which takes the same format as the template argument to strftime(3). As an extension, any # characters in format will be replaced by fractional seconds, e.g. use %H:%M:%S.### for the time to the nearest millisecond. Sub-second times are only approximate and currently decimal places after the third will always be reported as zero.

- %D The current UTC date and time in ISO 8601 format (YYYY-MM-DD HH:MM:SS).

- %D{format} The current UTC date and time in the specified format, which takes the same format as the template argument to strftime(3). Supports the same extension for sub-second resolution as %d{...}.

- %E The hostname of the node running the application.

- %m The message being logged.

- %N A serial number for this message within this run of the program, as a decimal number. The first message a program logs has serial number 1, the second one has serial number 2, and so on.

- %n A new-line.

- %p The level at which the message is logged, e.g. DBG.

- %P The program’s process ID (pid), as a decimal number.

- %r The number of milliseconds elapsed from the start of the application to the time the message was logged.

- %t The subprogram name, that is, an identifying name for the process or thread that emitted the log message, such as monitor for the process used for --monitor or main for the primary process or thread in a program.

- %T The subprogram name enclosed in parentheses, e.g. (monitor), or the empty string for the primary process or thread in a program.

- %% A literal %.

A few options may appear between the % and the format specifier character, in this order:

- - Left justify the escape’s expansion within its field width. Right justification is the default.

- 0 Pad the field to the field width with 0 characters. Padding with spaces is the default.

- width A number specifies the minimum field width. If the escape expands to fewer characters than width then it is padded to fill the field width. (A field wider than width is not truncated to fit.)

The default pattern for console and file output is %D{%Y-%m-%dT %H:%M:%SZ}|%05N|%c|%p|%m; for syslog output, %05N|%c|%p|%m.

Daemons written in Python (e.g. ovs-monitor-ipsec) do not allow control over the log pattern.

- vlog/set FACILITY:facility Sets the RFC5424 facility of the log message. facility can be one of kern, user, mail, daemon, auth, syslog, lpr, news, uucp, clock, ftp, ntp, audit, alert, clock2, local0, local1, local2, local3, local4, local5, local6 or local7.

- vlog/close Causes the daemon to close its log file, if it is open. (Use vlog/reopen to reopen it later.)

- vlog/reopen Causes the daemon to close its log file, if it is open, and then reopen it. (This is useful after rotating log files, to cause a new log file to be used.)

This has no effect if the target application was not invoked with the --log-file option.

## OPTIONS
-h, --help

Prints a brief help message to the console.

-V, --version

Prints version information to the console.

## SEE ALSO
ovs-appctl can control all Open vSwitch daemons, including ovs-vswitchd(8) and ovsdb-server(1).

## Author
The Open vSwitch Development Community

## Copyright
2016-2021, The Open vSwitch Development Community

branch: sisyphus


ovs-ctl

title: ovs-ctl(8)

summary: OVS startup helper script

text:
# ovs-ctl(8)

## NAME
ovs-ctl - OVS startup helper script

## SYNOPSIS
ovs-ctl --system-id=random|<uuid> [<options>] start

ovs-ctl stop

ovs-ctl --system-id=random|<uuid> [<options>] restart

ovs-ctl status

ovs-ctl version

ovs-ctl [<options>] load-kmod

ovs-ctl --system-id=random|<uuid> [<options>] force-reload-kmod

ovs-ctl [--protocol=<protocol>] [--sport=<sport>] [--dport=<dport>] enable-protocol

ovs-ctl delete-transient-ports

ovs-ctl help | -h | --help

ovs-ctl --version

## DESCRIPTION
The ovs-ctl program starts, stops, and checks the status of Open vSwitch daemons. It is not meant to be invoked directly by system administrators but to be called internally by system startup scripts.

Each ovs-ctl command is described separately below.

### The start command
The start command starts Open vSwitch. It performs the following tasks:

1.

Loads the Open vSwitch kernel module. If this fails, and the Linux bridge module is loaded but no bridges exist, it tries to unload the bridge module and tries loading the Open vSwitch kernel module again. (This is because the Open vSwitch kernel module cannot coexist with the Linux bridge module before 2.6.37.)

The start command skips the following steps if ovsdb-server is already running:

2.

If the Open vSwitch database file does not exist, it creates it. If the database does exist, but it has an obsolete version, it upgrades it to the latest schema.

3.

Starts ovsdb-server, unless the --no-ovsdb-server command option is given.

4.

Initializes a few values inside the database.

5.

If the --delete-bridges option was used, deletes all of the bridges from the database.

6.

If the --delete-transient-ports option was used, deletes all ports that have other_config:transient set to true.

The start command skips the following step if ovs-vswitchd is already running, or if the --no-ovs-vswitchd command option is given:

7.

Starts ovs-vswitchd.

### Options
Several command-line options influence the start command’s behavior. Some form of the following option should ordinarily be specified:

•

--system-id=<uuid> or --system-id=random This specifies a unique system identifier to store into external-ids:system-id in the database’s Open_vSwitch table. Remote managers that talk to the Open vSwitch database server over network protocols use this value to identify and distinguish Open vSwitch instances, so it should be unique (at least) within OVS instances that will connect to a single controller.

When random is specified, ovs-ctl will generate a random ID that persists from one run to another (stored in a file). When another string is specified ovs-ctl uses it literally.

The following options should be specified if the defaults are not suitable:

•

--system-type=<type> or --system-version=<version> Sets the value to store in the system-type and system-version columns, respectively, in the database’s Open_vSwitch table. Remote managers may use these values too determine the kind of system to which they are connected (primarily for display to human administrators).

When not specified, ovs-ctl uses values from the optional system-type.conf and system-version.conf files (see Files) or it uses the lsb_release program, if present, to provide reasonable defaults.

The following options are also likely to be useful:

- --external-id="<name>=<value>" Sets external-ids:<name> to <value> in the database’s Open_vSwitch table. Specifying this option multiple times adds multiple key-value pairs.

- --delete-bridges Ordinarily Open vSwitch bridges persist from one system boot to the next, as long as the database is preserved. Some environments instead expect to re-create all of the bridges and other configuration state on every boot. This option supports that, by deleting all Open vSwitch bridges after starting ovsdb-server but before starting ovs-vswitchd.

- --delete-transient-ports Deletes all ports that have other_config:transient set to true. This is important on certain environments where some ports are going to be recreated after reboot, but other ports need to be persisted in the database.

- --ovs-user=user[:group] Ordinarily Open vSwitch daemons are started as the user invoking the ovs-ctl command. Some system administrators would prefer to have the various daemons spawn as different users in their environments. This option allows passing the --user option to the ovsdb-server and ovs-vswitchd daemons, allowing them to change their privilege levels.

The following options are less important:

- --no-monitor By default ovs-ctl passes --monitor to ovs-vswitchd and ovsdb-server, requesting that it spawn a process monitor which will restart the daemon if it crashes. This option suppresses that behavior.

- --daemon-cwd=<directory> Specifies the current working directory that the OVS daemons should run from. The default is / (the root directory) if this option is not specified. (This option is useful because most systems create core files in a process’s current working directory and because a file system that is in use as a process’s current working directory cannot be unmounted.)

- --no-force-corefiles By default, ovs-ctl enables core dumps for the OVS daemons. This option disables that behavior.

- --no-mlockall By default ovs-ctl passes --mlockall to ovs-vswitchd, requesting that it lock all of its virtual memory, preventing it from being paged to disk. This option suppresses that behavior.

- --no-self-confinement Disable self-confinement for ovs-vswitchd and ovsdb-server daemons. This flag may be used when, for example, OpenFlow controller creates its Unix Domain Socket outside OVS run directory and OVS needs to connect to it. It is better to stick with the default behavior and not to use this flag, unless:

- You have Open vSwitch running under SELinux or AppArmor Mandatory Access Control that would prevent OVS from messing with sockets outside ordinary OVS directories.

- You believe that relying on protocol handshakes (e.g. OpenFlow) is enough to prevent OVS to adversely interact with other daemons running on your system.

- You don’t have much worries of remote OVSDB exploits in the first place, because, perhaps, OVSDB manager is running on the same host as OVS and share similar attack vectors.

- --ovsdb-server-priority=<niceness> or --ovs-vswitchd-priority=<niceness> Sets the nice(1) level used for each daemon. All of them default to -10.

- --ovsdb-server-wrapper=<wrapper> or --ovs-vswitchd-wrapper=<wrapper> Configures the specified daemon to run under <wrapper>, which is one of the following:

- valgrind: Run the daemon under valgrind(1), if it is installed, logging to <daemon>.valgrind.log.<pid> in the log directory.

- strace: Run the daemon under strace(1), if it is installed, logging to <daemon>.strace.log.<pid> in the log directory.

- glibc: Enable GNU C library features designed to find memory errors.

By default, no wrapper is used.

Each of the wrappers can expose bugs in Open vSwitch that lead to incorrect operation, including crashes. The valgrind and strace wrappers greatly slow daemon operations so they should not be used in production. They also produce voluminous logs that can quickly fill small disk partitions. The glibc wrapper is less resource-intensive but still somewhat slows the daemons.

The following options control file locations. They should only be used if the default locations cannot be used. See FILES, below, for more information.

- --db-file=<file> Overrides the file name for the OVS database.

- --db-sock=<socket> Overrides the file name for the Unix domain socket used to connect to ovsdb-server.

- --db-schema=<schema> Overrides the file name for the OVS database schema.

- --extra-dbs=<file> Adds <file> as an extra database for ovsdb-server to serve out. Multiple space-separated file names may also be specified. <file> should begin with /; if it does not, then it will be taken as relative to <dbdir>.

### The stop command
The stop command stops the ovs-vswitchd and ovsdb-server daemons. It does not unload the Open vSwitch kernel modules. It can take the same --no-ovsdb-server and --no-ovs-vswitchd options as that of the start command.

This command does nothing and finishes successfully if the OVS daemons aren’t running.

### The restart command
The restart command performs a stop followed by a start command. The command can take the same options as that of the start command. In addition, it saves and restores OpenFlow flows for each individual bridge.

### The status command
The status command checks whether the OVS daemons ovs-vswitchd and ovsdb-server are running and prints messages with that information. It exits with status 0 if the daemons are running, 1 otherwise.

### The version command
The version command runs ovsdb-server --version and ovs-vswitchd --version.

### The force-reload-kmod command
The force-reload-kmod command allows upgrading the Open vSwitch kernel module without rebooting. It performs the following tasks:

1.

Gets a list of OVS “internal” interfaces, that is, network devices implemented by Open vSwitch. The most common examples of these are bridge “local ports”.

2.

Saves the OpenFlow flows of each bridge.

3.

Stops the Open vSwitch daemons, as if by a call to ovs-ctl stop.

4.

Saves the kernel configuration state of the OVS internal interfaces listed in step 1, including IP and IPv6 addresses and routing table entries.

5.

Unloads the Open vSwitch kernel module (including the bridge compatibility module if it is loaded).

6.

Starts OVS back up, as if by a call to ovs-ctl start. This reloads the kernel module, restarts the OVS daemons and finally restores the saved OpenFlow flows.

7.

Restores the kernel configuration state that was saved in step 4.

8.

Checks for daemons that may need to be restarted because they have packet sockets that are listening on old instances of Open vSwitch kernel interfaces and, if it finds any, prints a warning on stdout. DHCP is a common example: if the ISC DHCP client is running on an OVS internal interface, then it will have to be restarted after completing the above procedure. (It would be nice if ovs-ctl could restart daemons automatically, but the details are far too specific to a particular distribution and installation.)

force-kmod-reload internally stops and starts OVS, so it accepts all of the options accepted by the start command except for the --no-ovs-vswitchd option.

### The load-kmod command
The load-kmod command loads the openvswitch kernel modules if they are not already loaded. This operation also occurs as part of the start command. The motivation for providing the load-kmod command is to allow errors when loading modules to be handled separately from other errors that may occur when running the start command.

By default the load-kmod command attempts to load the openvswitch kernel module.

### The enable-protocol command
The enable-protocol command checks for rules related to a specified protocol in the system’s iptables(8) configuration. If there are no rules specifically related to that protocol, then it inserts a rule to accept the specified protocol.

More specifically:

- If iptables is not installed or not enabled, this command does nothing, assuming that lack of filtering means that the protocol is enabled.

- If the INPUT chain has a rule that matches the specified protocol, then this command does nothing, assuming that whatever rule is installed reflects the system administrator’s decisions.

- Otherwise, this command installs a rule that accepts traffic of the specified protocol.

This command normally completes successfully, even if it does nothing. Only the failure of an attempt to insert a rule normally causes it to return an exit code other than 0.

The following options control the protocol to be enabled:

- --protocol=<protocol> The name of the IP protocol to be enabled, such as gre or tcp. The default is gre.

- --sport=<sport> or --dport=<dport> TCP or UDP source or destination port to match. These are optional and allowed only with --protocol=tcp or --protocol=udp.

### The delete-transient-ports command
Deletes all ports that have the other_config:transient value set to true.

### The help command
Prints a usage message and exits successfully.

## OPTIONS
In addition to the options listed for each command above, these options control the behavior of several ovs-ctl commands.

By default, ovs-ctl controls the ovsdb-server and ovs-vswitchd daemons. The following options restrict that control to exclude one or the other:

- --no-ovsdb-server Specifies that the ovs-ctl commands start, stop, and restart should not modify the running status of ovsdb-server.

- --no-ovs-vswitchd Specifies that the ovs-ctl commands start, stop, and restart should not modify the running status of ovs-vswitchd. It is an error to include this option with the force-reload-kmod command.

## EXIT STATUS
ovs-ctl exits with status 0 on success and nonzero on failure. The start command is considered to succeed if OVS is already started; the stop command is considered to succeed if OVS is already stopped.

## ENVIRONMENT
The following environment variables affect ovs-ctl:

- PATH ovs-ctl does not hardcode the location of any of the programs that it runs. ovs-ctl will add the <sbindir> and <bindir> that were specified at configure time to PATH, if they are not already present.

- OVS_LOGDIR, OVS_RUNDIR, OVS_DBDIR, OVS_SYSCONFDIR, OVS_PKGDATADIR, OVS_BINDIR, OVS_SBINDIR Setting one of these variables in the environment overrides the respective configure option, both for ovs-ctl itself and for the other Open vSwitch programs that it runs.

## FILES
ovs-ctl uses the following files:

- ovs-lib Shell function library used internally by ovs-ctl. It must be installed in the same directory as ovs-ctl.

- <logdir>/<daemon>.log Per-daemon logfiles.

- <rundir>/<daemon>.pid Per-daemon pidfiles to track whether a daemon is running and with what process ID.

- <pkgdatadir>/vswitch.ovsschema The OVS database schema used to initialize the database (use --db-schema to override this location).

- <dbdir>/conf.db The OVS database (use --db-file to override this location).

- <rundir>/openvswitch/db.sock The Unix domain socket used for local communication with ovsdb-server (use --db-sock to override this location).

- <sysconfdir>/openvswitch/system-id.conf The persistent system UUID created and read by --system-id=random.

- <sysconfdir>/openvswitch/system-type.conf and <sysconfdir>/openvswitch/system-version.conf The system-type and system-version values stored in the database’s Open_vSwitch table when not specified as a command-line option.

## EXAMPLE
The file debian/openvswitch-switch.init in the Open vSwitch source distribution is a good example of how to use ovs-ctl.

## SEE ALSO
README.rst, ovsdb-server(8), ovs-vswitchd(8).

## Author
The Open vSwitch Development Community

## Copyright
2016-2021, The Open vSwitch Development Community


ovs-dpctl

title: ovs-dpctl(8)

summary: administer Open vSwitch datapaths

text:
# ovs-dpctl(8)

## NAME
ovs-dpctl - administer Open vSwitch datapaths

## SYNOPSIS
ovs-dpctl [options] command [switch] [args...]

## DESCRIPTION
The ovs-dpctl program can create, modify, and delete Open vSwitch datapaths. A single machine may host any number of datapaths.

This program works only with datapaths that are implemented outside of ovs-vswitchd itself, such as the Linux and Windows kernel-based datapaths. To manage datapaths that are integrated into ovs-vswitchd, such as the userspace (netdev) datapath, use ovs-appctl(8) to invoke the dpctl/* commands, which are documented in ovs-vswitchd(8).

A newly created datapath is associated with only one network device, a virtual network device sometimes called the datapath's ``local port''. A newly created datapath is not, however, associated with any of the host's other network devices. To intercept and process traffic on a given network device, use the add-if command to explicitly add that network device to the datapath.

If ovs-vswitchd(8) is in use, use ovs-vsctl(8) instead of ovs-dpctl.

Most ovs-dpctl commands that work with datapaths take an argument that specifies the name of the datapath. Datapath names take the form [type@]name, where name is the network device associated with the datapath's local port. If type is given, it specifies the datapath provider of name, otherwise the default provider system is assumed.

The following commands manage datapaths. Do not use commands to add or remove or modify datapaths if ovs-vswitchd is running because this interferes with ovs-vswitchd's own datapath management.

add-dp dp [netdev[,option]...]

Creates datapath dp, with a local port also named dp. This will fail if a network device dp already exists.

If netdevs are specified, ovs-dpctl adds them to the new datapath, just as if add-if was specified.

del-dp dp

Deletes datapath dp. If dp is associated with any network devices, they are automatically removed.

add-if dp netdev[,option]...

Adds each netdev to the set of network devices datapath dp monitors, where dp is the name of an existing datapath, and netdev is the name of one of the host's network devices, e.g. eth0. Once a network device has been added to a datapath, the datapath has complete ownership of the network device's traffic and the network device appears silent to the rest of the system.

A netdev may be followed by a comma-separated list of options. The following options are currently supported:

type=type

Specifies the type of port to add. The default type is system.

port_no=port

Requests a specific port number within the datapath. If this option is not specified then one will be automatically assigned.

key=value

Adds an arbitrary key-value option to the port's configuration.

ovs-vswitchd.conf.db(5) documents the available port types and options.

set-if dp port[,option]...

Reconfigures each port in dp as specified. An option of the form key=value adds the specified key-value option to the port or overrides an existing key's value. An option of the form key=, that is, without a value, deletes the key-value named key. The type and port number of a port cannot be changed, so type and port_no are only allowed if they match the existing configuration.

del-if dp netdev...

Removes each netdev from the list of network devices datapath dp monitors.

dump-dps

Prints the name of each configured datapath on a separate line.

[-s | --statistics] show [dp...]

Prints a summary of configured datapaths, including their datapath numbers and a list of ports connected to each datapath. (The local port is identified as port 0.) If -s or --statistics is specified, then packet and byte counters are also printed for each port.

The datapath numbers consists of flow stats and mega flow mask stats.

The "lookups" row displays three stats related to flow lookup triggered by processing incoming packets in the datapath. "hit" displays number of packets matches existing flows. "missed" displays the number of packets not matching any existing flow and require user space processing. "lost" displays number of packets destined for user space process but subsequently dropped before reaching userspace. The sum of "hit" and "miss" equals to the total number of packets datapath processed.

The "flows" row displays the number of flows in datapath.

The "masks" row displays the mega flow mask stats. This row is omitted for datapath not implementing mega flow. "hit" displays the total number of masks visited for matching incoming packets. "total" displays number of masks in the datapath. "hit/pkt" displays the average number of masks visited per packet; the ratio between "hit" and total number of packets processed by the datapath.

If one or more datapaths are specified, information on only those datapaths are displayed. Otherwise, ovs-dpctl displays information about all configured datapaths.

### DATAPATH FLOW TABLE DEBUGGING COMMANDS
The following commands are primarily useful for debugging Open vSwitch. The flow table entries (both matches and actions) that they work with are not OpenFlow flow entries. Instead, they are different and considerably simpler flows maintained by the Open vSwitch kernel module. Do not use commands to add or remove or modify datapath flows if ovs-vswitchd is running because it interferes with ovs-vswitchd's own datapath flow management. Use ovs-ofctl(8), instead, to work with OpenFlow flow entries.

The dp argument to each of these commands is optional when exactly one datapath exists, in which case that datapath is the default. When multiple datapaths exist, then a datapath name is required.

[-m | --more] [--names | --no-names] dump-flows [dp] [filter=filter] [type=type] [pmd=pmd]

Prints to the console all flow entries in datapath dp's flow table. Without -m or --more, output omits match fields that a flow wildcards entirely; with -m or --more, output includes all wildcarded fields.

If filter=filter is specified, only displays the flows that match the filter. filter is a flow in the form similar to that accepted by ovs-ofctl(8)'s add-flow command. (This is not an OpenFlow flow: besides other differences, it never contains wildcards.) The filter is also useful to match wildcarded fields in the datapath flow. As an example, filter='tcp,tp_src=100' will match the datapath flow containing 'tcp(src=80/0xff00,dst=8080/0xff)'.

If pmd=pmd is specified, only displays flows of the specified pmd. Using pmd=-1 will restrict the dump to flows from the main thread. This option is only supported by the userspace datapath.

If type=type is specified, only displays flows of the specified types. This option supported only for ovs-appctl dpctl/dump-flows. type is a comma separated list, which can contain any of the following:

ovs - displays flows handled in the ovs dp

tc - displays flows handled in the tc dp

dpdk - displays flows fully offloaded by dpdk

offloaded - displays flows offloaded to the HW

non-offloaded - displays flows not offloaded to the HW

partially-offloaded - displays flows where only part of their proccessing is done in HW

all - displays all the types of flows

By default all the types of flows are displayed. ovs-dpctl always acts as if the type was ovs.

add-flow [dp] flow actions

[--clear] [--may-create] [-s | --statistics] mod-flow [dp] flow actions

Adds or modifies a flow in dp's flow table that, when a packet matching flow arrives, causes actions to be executed.

The add-flow command succeeds only if flow does not already exist in dp. Contrariwise, mod-flow without --may-create only modifies the actions for an existing flow. With --may-create, mod-flow will add a new flow or modify an existing one.

If -s or --statistics is specified, then mod-flow prints the modified flow's statistics. A flow's statistics are the number of packets and bytes that have passed through the flow, the elapsed time since the flow last processed a packet (if ever), and (for TCP flows) the union of the TCP flags processed through the flow.

With --clear, mod-flow zeros out the flow's statistics. The statistics printed if -s or --statistics is also specified are those from just before clearing the statistics.

NOTE: flow and actions do not match the syntax used with ovs-ofctl(8)'s add-flow command.

Usage Examples

Forward ARP between ports 1 and 2 on datapath myDP:

ovs-dpctl add-flow myDP \

"in_port(1),eth(),eth_type(0x0806),arp()" 2

ovs-dpctl add-flow myDP \

"in_port(2),eth(),eth_type(0x0806),arp()" 1

Forward all IPv4 traffic between two addresses on ports 1 and 2:

ovs-dpctl add-flow myDP \

"in_port(1),eth(),eth_type(0x800),\

ipv4(src=172.31.110.4,dst=172.31.110.5)" 2

ovs-dpctl add-flow myDP \

"in_port(2),eth(),eth_type(0x800),\

ipv4(src=172.31.110.5,dst=172.31.110.4)" 1

add-flows [dp] file

mod-flows [dp] file

del-flows [dp] file

Reads flow entries from file (or stdin if file is -) and adds, modifies, or deletes each entry to the datapath. Each flow specification (e.g., each line in file) may start with add, modify, or delete keyword to specify whether a flow is to be added, modified, or deleted. A flow specification without one of these keywords is treated based on the used command. All flow modifications are executed as individual transactions in the order specified.

[-s | --statistics] del-flow [dp] flow

Deletes the flow from dp's flow table that matches flow. If -s or --statistics is specified, then del-flow prints the deleted flow's statistics.

[-m | --more] [--names | --no-names] get-flow [dp] ufid:ufid

Fetches the flow from dp's flow table with unique identifier ufid. ufid must be specified as a string of 32 hexadecimal characters.

del-flows [dp]

Deletes all flow entries from datapath dp's flow table.

### DATAPATH FLOW CACHE COMMANDS
The following commands are useful for debugging and configuring the datapath flow cache settings.

cache-get-size [dp]

Prints the current cache sizes to the console.

cache-set-size dp cache size

Set the dp's specific cache to the given size. The cache name can be found by using the cache-get-size command.

### CONNECTION TRACKING TABLE COMMANDS
The following commands are useful for debugging and configuring the connection tracking table in the datapath.

The dp argument to each of these commands is optional when exactly one datapath exists, in which case that datapath is the default. When multiple datapaths exist, then a datapath name is required.

N.B.(Linux specific): the system datapaths (i.e. the Linux kernel module Open vSwitch datapaths) share a single connection tracking table (which is also used by other kernel subsystems, such as iptables, nftables and the regular host stack). Therefore, the following commands do not apply specifically to one datapath.

ipf-set-enabled [dp] v4|v6

ipf-set-disabled [dp] v4|v6

Enables or disables IP fragmentation handling for the userspace connection tracker. Either v4 or v6 must be specified. Both IPv4 and IPv6 fragment reassembly are enabled by default. Only supported for the userspace datapath.

ipf-set-min-frag [dp] v4|v6 minfrag

Sets the minimum fragment size (L3 header and data) for non-final fragments to minfrag. Either v4 or v6 must be specified. For enhanced DOS security, higher minimum fragment sizes can usually be used. The default IPv4 value is 1200 and the clamped minimum is 400. The default IPv6 value is 1280, with a clamped minimum of 400, for testing flexibility. The maximum fragment size is not clamped, however, setting this value too high might result in valid fragments being dropped. Only supported for userspace datapath.

ipf-set-max-nfrags [dp] maxfrags

Sets the maximum number of fragments tracked by the userspace datapath connection tracker to maxfrags. The default value is 1000 and the clamped maximum is 5000. Note that packet buffers can be held by the fragmentation module while fragments are incomplete, but will timeout after 15 seconds. Memory pool sizing should be set accordingly when fragmentation is enabled. Only supported for userspace datapath.

[-m | --more] ipf-get-status [dp]

Gets the configuration settings and fragment counters associated with the fragmentation handling of the userspace datapath connection tracker. With -m or --more, also dumps the IP fragment lists. Only supported for userspace datapath.

[-m | --more] [-s | --statistics] dump-conntrack [dp] [zone=zone]

Prints to the console all the connection entries in the tracker used by dp. If zone=zone is specified, only shows the connections in zone. With --more, some implementation specific details are included. With --statistics timeouts and timestamps are added to the output.

dump-conntrack-exp [dp] [zone=zone]

Prints to the console all the expectation entries in the tracker used by dp. If zone=zone is specified, only shows the expectations in zone. Only supported for userspace datapath.

flush-conntrack [dp] [zone=zone] [ct-origin-tuple [ct-reply-tuple]]

Flushes the connection entries in the tracker used by dp based on zone and connection tracking tuple ct-origin-tuple. If ct-tuple is not provided, flushes all the connection entries. If zone=zone is specified, only flushes the connections in zone.

If ct-[orig|reply]-tuple is provided, flushes the connection entry specified by ct-[orig|reply]-tuple in zone. The zone defaults to 0 if it is not provided. The userspace connection tracker requires flushing with the original pre-NATed tuple and a warning log will be otherwise generated. The tuple can be partial and will remove all connections that are matching on the specified fields. In order to specify only ct-reply-tuple, provide empty string as ct-origin-tuple.

Note: Currently there is a limitation for matching on ICMP, in order to partially match on ICMP parameters the ct-[orig|reply]-tuple has to include either source or destination IP.

An example of an IPv4 ICMP ct-[orig|reply]-tuple:

"ct_nw_src=10.1.1.1,ct_nw_dst=10.1.1.2,ct_nw_proto=1,icmp_type=8,icmp_code=0,icmp_id=10"

An example of an IPv6 TCP ct-[orig|reply]-tuple:

"ct_ipv6_src=fc00::1,ct_ipv6_dst=fc00::2,ct_nw_proto=6,ct_tp_src=1,ct_tp_dst=2"

[-m | --more] ct-stats-show [dp] [zone=zone]

Displays the number of connections grouped by protocol used by dp. If zone=zone is specified, numbers refer to the connections in zone. With --more, groups by connection state for each protocol.

ct-bkts [dp] [gt=threshold]

For each conntrack bucket, displays the number of connections used by dp. If gt=threshold is specified, bucket numbers are displayed when the number of connections in a bucket is greater than threshold.

ct-set-maxconns [dp] maxconns

Sets the maximum limit of connection tracker entries to maxconns on dp. This can be used to reduce the processing load on the system due to connection tracking or simply limiting connection tracking. If the number of connections is already over the new maximum limit request then the new maximum limit will be enforced when the number of connections decreases to that limit, which normally happens due to connection expiry. Only supported for userspace datapath.

ct-get-maxconns [dp]

Prints the maximum limit of connection tracker entries on dp. Only supported for userspace datapath.

ct-get-nconns [dp]

Prints the current number of connection tracker entries on dp. Only supported for userspace datapath.

ct-enable-tcp-seq-chk [dp]

ct-disable-tcp-seq-chk [dp]

Enables or disables TCP sequence checking. When set to disabled, all sequence number verification is disabled, including for TCP resets. This is similar, but not the same as 'be_liberal' mode, as in Netfilter. Disabling sequence number verification is not an optimization in itself, but is needed for some hardware offload support which might offer some performance advantage. Sequence number checking is enabled by default to enforce better security and should only be disabled if required for hardware offload support. This command is only supported for the userspace datapath.

ct-get-tcp-seq-chk [dp]

Prints whether TCP sequence checking is enabled or disabled on dp. Only supported for the userspace datapath.

ct-set-sweep-interval [dp] ms

Sets the sweep interval. Only supported for the userspace datapath.

ct-get-sweep-interval [dp]

Prints the current sweep interval in ms. Only supported for the userspace datapath.

ct-set-limits [dp] [default=default_limit] [zone=zone,limit=limit]...

Sets the maximum allowed number of connections in a connection tracking zone. A specific zone may be set to limit, and multiple zones may be specified with a comma-separated list. If a per-zone limit for a particular zone is not specified in the datapath, it defaults to the default per-zone limit. A default zone may be specified with the default=default_limit argument. Initially, the default per-zone limit is unlimited. An unlimited number of entries may be set with 0 limit.

ct-del-limits [dp] zone=zone[,zone]...

Deletes the connection tracking limit for zone. Multiple zones may be specified with a comma-separated list.

ct-get-limits [dp] [zone=zone[,zone]...]

Retrieves the maximum allowed number of connections and current counts per-zone. If zone is given, only the specified zone(s) are printed. If no zones are specified, all the zone limits and counts are provided. The command always displays the default zone limit.

## OPTIONS
-t

--timeout=secs

Limits ovs-dpctl runtime to approximately secs seconds. If the timeout expires, ovs-dpctl will exit with a SIGALRM signal.

-v[spec]

--verbose=[spec]

Sets logging levels. Without any spec, sets the log level for every module and destination to dbg. Otherwise, spec is a list of words separated by spaces or commas or colons, up to one from each category below:

- A valid module name, as displayed by the vlog/list command on ovs-appctl(8), limits the log level change to the specified module.

- syslog, console, or file, to limit the log level change to only to the system log, to the console, or to a file, respectively. (If --detach is specified, ovs-dpctl closes its standard file descriptors, so logging to the console will have no effect.)

On Windows platform, syslog is accepted as a word and is only useful along with the --syslog-target option (the word has no effect otherwise).

•

off, emer, err, warn, info, or dbg, to control the log level. Messages of the given severity or higher will be logged, and messages of lower severity will be filtered out. off filters out all messages. See ovs-appctl(8) for a definition of each log level.

Case is not significant within spec.

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

For compatibility with older versions of OVS, any is accepted as a word but has no effect.

-v

--verbose

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

-vPATTERN:destination:pattern

--verbose=PATTERN:destination:pattern

Sets the log pattern for destination to pattern. Refer to ovs-appctl(8) for a description of the valid syntax for pattern.

-vFACILITY:facility

--verbose=FACILITY:facility

Sets the RFC5424 facility of the log message. facility can be one of kern, user, mail, daemon, auth, syslog, lpr, news, uucp, clock, ftp, ntp, audit, alert, clock2, local0, local1, local2, local3, local4, local5, local6 or local7. If this option is not specified, daemon is used as the default for the local system syslog and local0 is used while sending a message to the target provided via the --syslog-target option.

--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/openvswitch/ovs-dpctl.log.

--syslog-target=host:port

Send syslog messages to UDP port on host, in addition to the system syslog. The host must be a numerical IP address, not a hostname.

--syslog-method=method

Specify method how syslog messages should be sent to syslog daemon. Following forms are supported:

- libc, use libc syslog() function. Downside of using this options is that libc adds fixed prefix to every message before it is actually sent to the syslog daemon over /dev/log UNIX domain socket.

- unix:file, use UNIX domain socket directly. It is possible to specify arbitrary message format with this option. However, rsyslogd 8.9 and older versions use hard coded parser function anyway that limits UNIX domain socket use. If you want to use arbitrary message format with older rsyslogd versions, then use UDP socket to localhost IP address instead.

- udp:ip:port, use UDP socket. With this method it is possible to use arbitrary message format also with older rsyslogd. When sending syslog messages over UDP socket extra precaution needs to be taken into account, for example, syslog daemon needs to be configured to listen on the specified UDP port, accidental iptables rules could be interfering with local syslog traffic and there are some security considerations that apply to UDP sockets, but do not apply to UNIX domain sockets.

- null, discards all messages logged to syslog.

The default is taken from the OVS_SYSLOG_METHOD environment variable; if it is unset, the default is libc.

-h

--help

Prints a brief help message to the console.

-V

--version

Prints version information to the console.

## SEE ALSO
ovs-appctl(8), ovs-vswitchd(8)


ovs-kmod-ctl

title: ovs-kmod-ctl(8)

text:
# ovs-kmod-ctl(8)

## NAME
ovs-kmod-ctl - OVS startup helper script for loading kernel modules

## SYNOPSIS
ovs-kmod-ctl insert

ovs-kmod-ctl remove

ovs-kmod-ctl help | -h | --help

ovs-kmod-ctl --version

ovs-kmod-ctl version

## DESCRIPTION
The ovs-kmod-ctl program is responsible for inserting and removing Open vSwitch kernel modules. It is not meant to be invoked directly by system administrators but to be called internally by system startup scripts. The script is used as part of an SELinux transition domain.

Each of ovs-kmod-ctl's commands is described separately below.

## The ``insert'' command
The insert command loads the Open vSwitch kernel modules, if needed. If this fails, and the Linux bridge module is loaded but no bridges exist, it tries to unload the bridge module and tries loading the Open vSwitch kernel module again.

## The ``remove'' command
The remove command unloads the Open vSwitch kernel module (including the bridge compatibility module, if loaded) and any associated vport modules.

## EXIT STATUS
ovs-kmod-ctl exits with status 0 on success and nonzero on failure. The insert command is considered to succeed if kernel modules are already loaded; the remove command is considered to succeed if none of the kernel modules are loaded.

## ENVIRONMENT
The following environment variables affect ovs-kmod-ctl:

PATH

ovs-kmod-ctl does not hardcode the location of any of the programs that it runs. ovs-kmod-ctl will add the sbindir and bindir that were specified at configure time to PATH, if they are not already present.

OVS_LOGDIR

OVS_RUNDIR

OVS_DBDIR

OVS_SYSCONFDIR

OVS_PKGDATADIR

OVS_BINDIR

OVS_SBINDIR

Setting one of these variables in the environment overrides the respective configure option, both for ovs-kmod-ctl itself and for the other Open vSwitch programs that it runs.

## FILES
ovs-kmod-ctl uses the following files:

ovs-lib

Shell function library used internally by ovs-kmod-ctl. It must be installed in the same directory as ovs-kmod-ctl.

## EXAMPLE
ovs-kmod-ctl isn't intended to be manually executed. However, the following examples demonstrate loading the kernel modules.

ovs-kmod-ctl insert

Attempts to insert the Open vSwitch kernel modules.

ovs-kmod-ctl remove

Attempts to remove the Open vSwitch kernel modules.

## SEE ALSO
README.rst, ovs-ctl(8)