Skip to content

Latest commit

 

History

History
85 lines (85 loc) · 2.61 KB

ovs_userspace.org

File metadata and controls

85 lines (85 loc) · 2.61 KB

ovs_userspace

1 ovs command

  1. packet out
ovs-ofctl packet-out br0 None "output:92" +packet hex buffer
  1. show ovs interface detail
ovs-vsctl list interface test
  1. dump flows
ovs-ofctl dump-flows br0 -Oopenflow13
  1. add gre port
ovs-vsctl --db=tcp:%s:6634 --timeout=3 --may-exist add-port br0 gre%s -- set interface gre%s type=gre options:remote_ip=%s options:local_ip=%s options:key=flow
  1. find gre port list
ovs-vsctl --db=tcp:%s:6634 --timeout=3 --columns=ofport,name,options -f json --no-heading find interface type=gre
  1. replace flow
ovs-ofctl replace-flows -Oopenflow13 br0 /tmp/synced-flow.txt
  1. show flow overview
ovs-ofctl dump-tables br0 -Oopenflow13
  1. set/change dpid
ovs-vsctl set bridge br0 other_config:datapath-id=0000001e08097302
ovs-vsctl show br0
  1. change ovs interface mac address
INTERFACE=ulb-lan
ovs-vsctl --may-exist add-port br0 $INTERFACE -- set interface $INTERFACE type=internal
ip link set $INTERFACE address 52:58:01:10:ff:01
ip addr add dev $INTERFACE 10.9.252.1/16
ip link set ulb-lan up
  1. add gre tunnel with gre tunnel id
'ovs-vsctl add-port br0 gre%s -- set Interface gre%s type=gre ofport_request=%d options:key=flow options:remote_ip=%s options:local_ip=%s' % (one_ovs.remote_ip, one_ovs.remote_ip, one_ovs.ofport, one_ovs.remote_ip, one_ovs.local_ip)
  1. add bridge/ del bridge/ list all bridge / check exist / show overview
ovs-vsctl add-br br0
ovs-vsctl del-br br0
ovs-vsctl list-br
ovs-vsctl br-exists br0
ovs-vsctl show
  1. add interface to bridge/ del interface / list all interface
ovs-vsctl add-port br0 eth0
ovs-vsctl del-port br0 eth0
ovs-vsctl list-ports br0
  1. set controller / get controller
ovs-vsctl set-controller ovs-br tcp:1.2.3.4:6633
ovs-vsctl show # see the is_connected:true
ovs-vsctl get-controller br0
ovs-vsctl del-controller br0

2 查看mac表项

ovs-appctl fdb/show br-int