ovs-vsctl(8) Open vSwitch Manual ovs-vsctl(8) (NAME) ovs-vsctl - ovs-vswitchd (SYNOPSIS) ovs-vsctl [] -- [] [] [-- [] []]... (DESCRIPTION) ovs-vsctl ovs-vswitchd(8) . ovs-vswitchd.conf.db(5) . ovs-vsctl ovsdb-server Open vSwitch . . ovs-vswitchd . ( ovs-vsctl ovs-vswitchd --no-wait .) ovs-vsctl . ovs-vsctl ( (OPTIONS) ). . -- . (-- .) ( ) . (EXAMPLES) . VLAN (Linux VLAN Bridging Compatibility) ovs-vsctl Open vSwitch VLAN . (trunk) 802.1Q ( VLAN) VLAN (implicit) 802.1Q . (Linux bridge) ovs-vsctl VLAN 802.1Q . add-br ( ) << >> (fake bridge) Open vSwitch . << >> ovs-vsctl << >> Open vSwitch VLAN . ( VLAN 0 802.1Q VLAN 0 .) (OPTIONS) ovs-vsctl . . -- . --db=server server ovs-vsctl . server OVSDB ovsdb(7) . unix:/run/openvswitch/db.sock . --no-wait ovs-vsctl ovs-vswitchd . ovs-vswitchd ovs-vsctl ovs-vswitchd . . --no-syslog ovs-vsctl . . --verbose=vsctl:syslog:warn . --oneline . \n \ . . list find (Table Formatting Options) . --dry-run ovs-vsctl . -t secs --timeout=secs secs 0 ovs-vsctl . secs . ovs-vsctl SIGALRM . ( .) --retry ovs-vsctl ( ) ovs-vsctl ( ovsdb-server ). --db ovs-vsctl ovs-vsctl . --timeout ovs-vsctl . (Table Formatting Options) list find . -f format --format=format . format : table . list () . html HTML. csv RFC 4180. json JSON RFC 4627. JSON . JSON : caption . . headings . . data . . . OVSDB OVSDB . -d format --data=format json json . format : string () (Database Values) . bare : [] {} . . json RFC 4627 JSON . --no-headings . --pretty JSON . JSON . . JSON . --bare --format=list --data=bare --no-headings. --max-column-width=n n . . . (Public Key Infrastructure Options) -p privkey.pem --private-key=privkey.pem PEM ovs-vsctl SSL/TLS . -c cert.pem --certificate=cert.pem PEM -p --private-key . (CA) SSL/TLS . -C cacert.pem --ca-cert=cacert.pem PEM CA ovs-vsctl SSL/TLS . ( SSL/TLS -c --certificate PKI .) -C none --ca-cert=none SSL/TLS . . --ssl-server-name=servername TLS ( SNI) . SNI . SNI (service meshes) . --bootstrap-ca-cert=cacert.pem cacert.pem -C --ca-cert . ovs-vsctl SSL/TLS CA SSL/TLS PEM . SSL/TLS CA . SSL/TLS (man-in-the- middle) CA (bootstrapping) . SSL/TLS CA SSL/TLS . SSL/TLS CA . -C --ca-cert () . --peer-ca-cert=peer-cacert.pem PEM SSL/TLS . peer-cacert.pem CA ovs-vsctl -c --certificate. ovs-vsctl (self-signed) --certificate --peer-ca-cert . SSL/TLS CA ovs-vsctl . CA SSL/TLS (bootstrap) . -v[spec] --verbose=[spec] . spec dbg . spec : o vlog/list ovs-appctl(8) . o syslog console file . ( --detach ovs-vsctl .) o off emer err warn info dbg . . off . ovs-appctl(8) . spec . file --log-file ( ). OVS any . -v --verbose --verbose=dbg . -vPATTERN:destination:pattern --verbose=PATTERN:destination:pattern destination pattern . pattern ovs-appctl(8) . -vFACILITY:facility --verbose=FACILITY:facility (facility) RFC 5424 . facility kern user mail daemon auth syslog lpr news uucp clock ftp ntp audit alert clock2 local0 local1 local2 local3 local4 local5 local6 local7 . daemon local0 --syslog-target . --log-file[=file] . file . file /var/log/openvswitch/ovs-vsctl.log . --syslog-target=host:port UDP port host . host IP . --syslog-method=method method . : o libc syslog() libc . libc /dev/log . o unix:file . . rsyslogd 8.9 . rsyslogd UDP IP . o udp:ip:port UDP . rsyslogd . UDP UDP iptables UDP . o null . OVS_SYSLOG_METHOD libc . -h --help . -V --version . (COMMANDS) ovs-vsctl . Open vSwitch (Open vSwitch Commands) Open vSwitch . init Open vSwitch . . ovs-vsctl Open vSwitch . . [--filter=filter-rule[,filter-rule]...] show . --filter . filter-rule table-name(filter[|filter]...) . filter . emer-reset . OpenFlow OVSDB SSL/TLS fail_mode NetFlow sFlow IPFIX . other-config other-config:hwaddr Bridge . . (Bridge Commands) Open vSwitch . [--may-exist] add-br bridge bridge . ( bridge). --may-exist . --may-exist bridge . [--may-exist] add-br bridge parent vlan << >> (fake bridge) bridge Open vSwitch parent parent . 802.1Q VLAN vlan 0 4095 . vlan . bridge ( bridge). --may-exist . --may-exist bridge VLAN parent vlan . [--if-exists] del-br bridge bridge . bridge bridge . --if-exists . --if-exists . [--real|--fake] list-br . --real --fake . br-exists bridge bridge . ovs-vsctl 0 . ovs-vsctl 2 . br-to-vlan bridge bridge 802.1Q VLAN . bridge 0 . br-to-parent bridge bridge . bridge bridge . br-set-external-id bridge key [value] << >> (external ID) bridge . Open vSwitch bridge . Open vSwitch key key value . value key bridge value . value key bridge ( ). set remove external-ids Bridge . fake-bridge- Port . br-get-external-id bridge [key] bridge . key key key . key key=value - . get external-ids Bridge . fake-bridge- Port . (Port Commands) Open vSwitch . (bonded) . list-ports bridge bridge . bridge . [--may-exist] add-port bridge port [column[:key]=value]... bridge port . Port . tag=9 (access port) VLAN 9 . set ( (Database Commands) ). --may-exist . --may-exist port bridge . [--if-exists] del-port [bridge] port port . bridge port bridge port . --if-exists . --if-exists . [--if-exists] --with-iface del-port [bridge] iface iface iface . bridge bridge . --if-exists . --if-exists . port-to-br port port . (Bond Commands) Open vSwitch <<>> (bonds) . [--fake-iface] add-bond bridge port iface... [column[:key]=value]... bridge port iface () . . DPDK 'dpdk' . Port . set ( (Database Commands) ). --fake-iface port . . --may-exist . --may-exist port bridge . [--may-exist] add-bond-iface bond iface iface bond . bond . --may-exist iface bond . --may-exist iface bond . ( iface .) [--if-exists] del-bond-iface [bond] iface iface . bond iface bond bond . iface . iface . --if-exists . --if-exists . (Interface Commands) Open vSwitch . . list-ifaces bridge bridge . bridge . iface-to-br iface iface . (Conntrack Zone Commands) CT (datapath) . [--may-exist] add-zone-tp datapath zone=zone_id policies conntrack zone_id datapath . policies key=value . icmp_first=30 icmp_reply=60 ICMP ICMP . CT_Timeout_Policy ovs-vswitchd.conf.db(5) . --may-exist policy zone_id . --may-exist zone_id . [--if-exists] del-zone-tp datapath zone=zone_id zone_id datapath . --if-exists . --if-exists . list-zone-tp datapath datapath . set-zone-limit datapath zone_id|default zone_limit conntrack zone_id|default datapath . 0 limit . [--if-exists] del-zone-limit datapath zone_id|default zone_id datapath . --if-exists . --if-exists . list-zone-limits datapath datapath . (Datapath Capabilities Command) (datapath) . list-dp-cap datapath . (OpenFlow Controller Connectivity) ovs-vswitchd OpenFlow . . . ovs-ofctl . get-controller bridge . del-controller bridge . set-controller bridge target... . target : ssl:host[:port] tcp:host[:port] port host DNS ( unbound ) IP IPv4 IPv6 . IPv6 tcp:[::1]:6653. %device (scope) - IPv6 tcp:[fe80::1234%eth0]:6653. ssl --private-key --certificate --ca-cert . port . unix:file POSIX file. pssl:[port][:host] ptcp:[port][:host] port OpenFlow . port . IPv4 . host IPv4 IPv6 ( ptcp:6653:[::1]). %device - IPv6 ptcp:6653:[fe80::1234%eth0]. unbound DNS . pssl --private-key --certificate --ca-cert . punix:file file OpenFlow . . . . standalone ovs-vswitchd . ovs-vswitchd (datapath) MAC . ovs-vswitchd (standalone) . secure ovs-vswitchd . get-fail-mode bridge . del-fail-mode bridge . set-fail-mode bridge standalone|secure . (Manager Connectivity) manager_options Open_vSwitch Managers . ovsdb-server manager_options OVSDB ( Open vSwitch ovsdb-server --remote=db:Open_vSwitch,Open_vSwitch,manager_options ) ovs-vsctl . get-manager () . del-manager () . set-manager target... . target OVSDB pssl:6640 ovsdb(7) . SSL/TLS (SSL/TLS Configuration) ovs-vswitchd SSL/TLS : private-key PEM SSL/TLS . certificate PEM (CA) . ca-cert PEM CA . ovs-vswitchd . ovs-vswitchd . SSL/TLS SSL/TLS . get-ssl SSL/TLS . del-ssl SSL/TLS . [--bootstrap] set-ssl private-key certificate ca-cert SSL/TLS . --bootstrap . CA SSL/TLS ovs-vswitchd . ca-cert --bootstrap ovs-vswitchd SSL/TLS CA PEM . SSL/TLS CA . SSL/TLS (man-in-the-middle) CA (bootstrapping) . CA SSL/TLS . SSL/TLS CA . (Auto-Attach Commands) Auto-Attach SPBM IETF (LLDP) IEEE 802.1AB (SPB) IEEE 802.1aq SPB . OVS SPB . VLAN I_SID SPB . I-SID/VLAN . add-aa-mapping bridge i-sid vlan bridge i-sid vlan . del-aa-mapping bridge i-sid vlan bridge i-sid vlan . get-aa-mapping bridge bridge . (Database Commands) ovsdb . ovsdb ovs-vsctl . table . record . record UUID . column . ovs-vswitchd.conf.db(5) --help . UUID ( ) . (-) (_) . net n NetFlow . . : (integer) -2**63 2**63-1 ( ). (real) . (Boolean) true false . (string) (null) . . true false UUID ( ) . JSON . ("") . (UUID) RFC 4122 ( f81d4fae-7dec-11d0-a765-00a0c91e6bf6) @name get create ovs-vsctl. . . [] . (range) . - . . . . <<>> (maps) - . key=value key value . ( ) . . {} . ( other-config={0=x,1=y} other-config=0=x other-config=1=y ). [--if-exists] [--columns=column[,column]...] list table [record]... record . table . --columns . . --if-exists record . --if-exists record . [--columns=column[,column]...] find table [column[:key]=value]... table column value key column key value . = : = != < > <= >= column[:key] value . column[:key] value . . . . ( - .) {=} {!=} . {<=} column[:key] value . flood-vlans{<=}1,2 flood-vlans . {<} column[:key] (proper subset) value . flood-vlans{<}1,2 flood-vlans . {>=} {>} {<=} {<} . flood-vlans{>=}1,2 flood-vlans . Open vSwitch : {in} column[:key] value . ( {<=} .) {not-in} column[:key] value . (= != < > <= >=) key column key . other-config:mtu!=1500 mtu mtu . key column key . other-config:mtu{!=}1500 mtu mtu . < > . --columns . . UUID ovs-vsctl . [--if-exists] [--id=@name] get table record [column[:key]]... column record table . key key . --if-exists record key key record . --if-exists . @name UUID record ovs-vsctl UUID . --id column . get record table . --id --if-exists . [--if-exists] set table record column[:key]=value... column record table value . key key ( ) . --if-exists record . --if-exists record . [--if-exists] add table record column [key=]value... - column record table . column key . key value ( set ). --if-exists record . --if-exists record . [--if-exists] remove table record column value... [--if-exists] remove table record column key... [--if-exists] remove table record column key=value... - column record table . : value . : key - key value . . --if-exists record . --if-exists record . [--if-exists] clear table record column... column record table . . --if-exists record . --if-exists record . [--id=(@name | uuid] create table column[:key]=value... table column . . UUID . @name UUID ovs-vsctl UUID . create . uuid UUID . (ovs-vsctl ) Open vSwitch Open_vSwitch . QoS Queue Open_vSwitch . ovs-vsctl . create ovs-vsctl Open_vSwitch . (EXAMPLES) . [--if-exists] destroy table record... record table . --if-exists record . --all destroy table table . (ovs-vsctl ) destroy QoS Queue . Open_vSwitch . . destroy . (EXAMPLES) . wait-until table record [column[:key]=value]... table record column value key column key value . find . column[:key]=value record . . (ovs-vsctl ) wait-until ovs-vsctl . wait-until bridge br0 -- get bridge br0 datapath_id br0 datapath_id get bridge br0 datapath_id -- wait-until bridge br0 ovs-vsctl br0 . --timeout=0 --wait-until ovs-vsctl . comment [arg]... . (EXAMPLES) br0 eth0 : ovs-vsctl add-br br0 ovs-vsctl add-port br0 eth0 : ovs-vsctl add-br br0 -- add-port br0 eth0 br0 : ovs-vsctl del-br br0 br0 : ovs-vsctl --if-exists del-br br0 qos Port eth0 QoS Queue : ovs-vsctl -- set port eth0 qos=@newqos -- --id=@newqos create qos type=linux-htb other-config:max-rate=1000000 queues:0=@newqueue -- --id=@newqueue create queue other-config:min-rate=1000000 other-config:max-rate=1000000 (CONFIGURATION COOKBOOK) (Port Configuration) << >> vlan10 br0 VLAN VLAN IP: ovs-vsctl add-port br0 vlan10 tag=10 -- set Interface vlan10 type=internal ip addr add 192.168.0.123/24 dev vlan10 GRE gre0 IP 1.2.3.4 br0: ovs-vsctl add-port br0 gre0 -- set Interface gre0 type=gre options:remote_ip=1.2.3.4 (Port Mirroring) eth0 eth1 eth2 br0 ( eth2 ): ovs-vsctl -- set Bridge br0 mirrors=@m \ -- --id=@eth0 get Port eth0 \ -- --id=@eth1 get Port eth1 \ -- --id=@eth2 get Port eth2 \ -- --id=@m create Mirror name=mymirror select-dst-port=@eth0,@eth1 select-src-port=@eth0,@eth1 output-port=@eth2 br0 Mirror ( ): ovs-vsctl -- --id=@rec get Mirror mymirror \ -- remove Bridge br0 mirrors @rec : ovs-vsctl clear Bridge br0 mirrors (Quality of Service - QoS) QoS linux-htb eth0 eth1: ovs-vsctl -- set Port eth0 qos=@newqos \ -- set Port eth1 qos=@newqos \ -- --id=@newqos create QoS type=linux-htb other-config:max-rate=1000000000 queues=0=@q0,1=@q1 \ -- --id=@q0 create Queue other-config:min-rate=100000000 other-config:max-rate=100000000 \ -- --id=@q1 create Queue other-config:min-rate=500000000 QoS eth1: ovs-vsctl clear Port eth1 qos QoS eth0 eth1 QoS ( QoS ): ovs-vsctl -- destroy QoS eth0 -- clear Port eth0 qos -- clear Port eth1 qos ( Queue . "ovs-vsctl list Queue" UUID "ovs-vsctl destroy Queue uuid1 uuid2" "ovs-vsctl -- --all destroy Queue" .) (Connectivity Monitoring) eth0. ovs-vsctl set Interface eth0 cfm_mpid=1 : ovs-vsctl clear Interface eth0 cfm_mpid (NetFlow) br0 NetFlow UDP 192.168.0.34 : ovs-vsctl -- set Bridge br0 netflow=@nf \ -- --id=@nf create NetFlow targets=\"192.168.0.34:5566\" active-timeout=30 NetFlow : ovs-vsctl set NetFlow br0 active_timeout=60 NetFlow br0 NetFlow ( ): ovs-vsctl clear Bridge br0 netflow (sFlow) br0 sFlow 10.0.0.1 IP eth1 : ovs-vsctl -- --id=@s create sFlow agent=eth1 target=\"10.0.0.1:6343\" header=128 sampling=64 polling=10 \ -- set Bridge br0 sflow=@s sFlow br0 sFlow ( ): ovs-vsctl -- clear Bridge br0 sflow (IPFIX) br0 IPFIX UDP 192.168.0.34 ( ) ( ): ovs-vsctl -- set Bridge br0 ipfix=@i \ -- --id=@i create IPFIX targets=\"192.168.0.34:4739\" obs_domain_id=123 obs_point_id=456 cache_active_timeout=60 cache_max_flows=13 \ other_config:enable-input-sampling=false other_config:enable-tunnel-sampling=true IPFIX br0 IPFIX ( ): ovs-vsctl clear Bridge br0 ipfix (802.1D Spanning Tree Protocol - STP) br0 802.1D: ovs-vsctl set Bridge br0 stp_enable=true br0 0x7800: ovs-vsctl set Bridge br0 other_config:stp-priority=0x7800 eth0 : ovs-vsctl set Port eth0 other_config:stp-path-cost=10 STP : ovs-vsctl set Bridge br0 stp_enable=false (Multicast Snooping) br0 (multicast snooping): ovs-vsctl set Bridge br0 mcast_snooping_enable=true br0 : ovs-vsctl set Bridge br0 other_config:mcast-snooping-aging-time=300 br0 : ovs-vsctl set Bridge br0 other_config:mcast-snooping-table-size=2048 (flooding) . true . false . br0 . ovs-vsctl set Bridge br0 other_config:mcast-snooping-disable-flood-unregistered=true ( Reports) . ovs-vsctl set Port eth1 other_config:mcast-snooping-flood=true Reports . ovs-vsctl set Port eth1 other_config:mcast-snooping-flood-reports=true : ovs-vsctl set Bridge br0 mcast_snooping_enable=false (802.1D-2004 Rapid Spanning Tree Protocol - RSTP) br0 802.1D-2004: ovs-vsctl set Bridge br0 rstp_enable=true br0 00:aa:aa:aa:aa:aa : ovs-vsctl set Bridge br0 other_config:rstp-address=00:aa:aa:aa:aa:aa br0 0x7000. ( ). 0x800 () . ovs-vsctl set Bridge br0 other_config:rstp-priority=28672 br0 . . . ovs-vsctl set Bridge br0 other_config:rstp-ageing-time=1000 br0 . : ( STP) ( ). ovs-vsctl set Bridge br0 other_config:rstp-force-protocol-version=0 br0 . . . ovs-vsctl set Bridge br0 other_config:rstp-max-age=10 br0 . . . ovs-vsctl set Bridge br0 other_config:rstp-forward-delay=15 br0 . . . ovs-vsctl set Bridge br0 other_config:rstp-transmit-hold-count=7 RSTP eth0: ovs-vsctl set Port eth0 other_config:rstp-enable=true RSTP eth0: ovs-vsctl set Port eth0 other_config:rstp-enable=false eth0 . ( ). 0x80 () . ovs-vsctl set Port eth0 other_config:rstp-port-priority=32 eth0 : ovs-vsctl set Port eth0 other_config:rstp-port-num=3 eth0 : ovs-vsctl set Port eth0 other_config:rstp-path-cost=150 (admin edge) eth0: ovs-vsctl set Port eth0 other_config:rstp-port-admin-edge=true (auto edge) eth0: ovs-vsctl set Port eth0 other_config:rstp-port-auto-edge=true MAC eth0. 0 ( ) 1 ( ) 2 ( ) . 2 0 ( ) . ovs-vsctl set Port eth0 other_config:rstp-admin-p2p-mac=1 eth0. true . ovs-vsctl set Port eth0 other_config:rstp-admin-port-state=false mcheck eth0: ovs-vsctl set Port eth0 other_config:rstp-port-mcheck=true RSTP : ovs-vsctl set Bridge br0 rstp_enable=false (OpenFlow Version) br0 OpenFlow: ovs-vsctl set bridge br0 protocols=OpenFlow10,OpenFlow12,OpenFlow13 (Flow Table Configuration) br0 : ovs-vsctl -- --id=@ft create Flow_Table flow_limit=100 overflow_policy=refuse -- set Bridge br0 flow_tables=0=@ft br0 : ovs-vsctl -- --id=@ft create Flow_Table flow_limit=100 overflow_policy=evict groups='"NXM_OF_IN_PORT[]"' -- set Bridge br0 flow_tables:0=@ft (EXIT STATUS) 0 . 1 . 2 bridge br-exists . 65 (commit) ovs-vsctl ovs-vswitchd . --no-wait . (roll back) . . (SEE ALSO) ovsdb-server(1), ovs-vswitchd(8), ovs-vswitchd.conf.db(5). Open vSwitch 4.0.0 ovs-vsctl(8)