Programmable Internetworking & Communication Operating System Docs ... Click Spaces -> Space Directory to see docs for all releases ...
Page tree
Skip to end of metadata
Go to start of metadata

Configuring ovsdb Locally

User can check the status of the ovsdb-server process using the ps command from the Linux shell.

admin@PicOS-OVS$ps aux|grep ovs
root      3422  0.0  0.1   7020  2788 ?        S    10:42   0:00 ovsdb-server /ovs/ovs-vswitchd.conf.db /tmp/inventory.conf.db /ovs/function.conf.db --pidfile --remote=ptcp:6640:127.0.0.1 --remote=punix:/ovs/var/run/openvswitch/db.sock --remote=db:Open_vSwitch,Manager,target
root      3435 15.7  1.5 122860 32320 ?        Sl   10:42   2:12 ovs-vswitchd --pidfile=ovs-vswitchd.pid --overwrite-pidfile
root      3494  0.0  0.2  12960  5752 ?        Ss   10:43   0:00 /usr/bin/python /ovs/share/openvswitch/scripts/ovs-invd --pidfile=ovs-invd.pid --overwrite-pidfile --detach --root-prefix=/ovs/
admin     3738  0.0  0.0   2200   684 ttyS0    S+   10:56   0:00 grep --color=auto ovs
admin@PicOS-OVS$

The string '--remote=ptcp:6640:127.0.0.1' in the output above shows that the ovsdb-server is listening the local IP 127.0.0.1 and port 6640. 

User can configure ovs-vswitchd locally as shown below:

root@PicOS-OVS$ovs-vsctl add-br br0 -- set bridge br0 datapath_type=pica8
root@PicOS-OVS$ovs-vsctl add-port br0 qe-1/1/1 vlan_mode=trunk tag=1 -- set interface qe-1/1/1 type=pica8
root@PicOS-OVS$ovs-vsctl add-port br0 vxlan1 -- set interface vxlan1 type=pica8_vxlan options:remote_ip=10.10.10.2 options:local_ip=10.10.10.1 options:vlan=1 options:vnid=1122867 options:udp_dst_port=4789 options:src_mac=C8:0A:A9:04:49:1A  options:dst_mac=C8:0A:A9:9E:14:A5  options:egress_port=qe-1/1/1
root@PicOS-OVS$ovs-vsctl set-controller br0 tcp:10.10.51.51:6633

Configuring ovsdb Remotely

Check the state of ovsdb-server on the switch.

admin@PicOS-OVS$ps aux|grep ovs
root      3422  0.0  0.1   7020  2788 ?        S    10:42   0:00 ovsdb-server /ovs/ovs-vswitchd.conf.db /tmp/inventory.conf.db /ovs/function.conf.db --pidfile --remote=ptcp:6640:127.0.0.1 --remote=punix:/ovs/var/run/openvswitch/db.sock --remote=db:Open_vSwitch,Manager,target
root      3435 14.9  1.5 122860 32388 ?        Sl   10:42   3:16 ovs-vswitchd --pidfile=ovs-vswitchd.pid --overwrite-pidfile
root      3494  0.0  0.2  12960  5752 ?        Ss   10:43   0:00 /usr/bin/python /ovs/share/openvswitch/scripts/ovs-invd --pidfile=ovs-invd.pid --overwrite-pidfile --detach --root-prefix=/ovs/
admin     3835  0.0  0.0   2200   680 ttyS0    S+   11:04   0:00 grep --color=auto ovs

The string '--remote=db:Open_vSwitch,Manager,target'  in the output above shows that the ovsdb-server is listening remote Manager and target default. User can configure switch ovsdb at remote side.

User can configure ovs-vswitchd remotely as shown below, switch's managerment ip is 10.10.51.138.

root@dev-42:~# ovs-vsctl --db=tcp:10.10.51.138:6640 add-br br0 -- set bridge br0 datapath_type=pica8
root@dev-42:~# ovs-vsctl --db=tcp:10.10.51.138:6640 add-port br0 qe-1/1/1 vlan_mode=trunk tag=1 -- set interface qe-1/1/1 type=pica8
root@dev-42:~# ovs-vsctl --db=tcp:10.10.51.138:6640 add-port br0 vxlan1 -- set interface vxlan1 type=pica8_vxlan options:remote_ip=10.10.10.2 options:local_ip=10.10.10.1 options:vlan=1 options:vnid=1122867 options:udp_dst_port=4789 options:src_mac=C8:0A:A9:04:49:1A  options:dst_mac=C8:0A:A9:9E:14:A5  options:egress_port=qe-1/1/1
root@dev-42:~# ovs-vsctl --db=tcp:10.10.51.138:6640 set-controller br0 tcp:10.10.51.51:6633

 

Add flow locally

User can add flow entry in switch cli.

 

admin@PicOS-OVS$ovs-ofctl add-flow br0 in_port=31,actions=output:32
admin@PicOS-OVS$
admin@PicOS-OVS$ovs-ofctl dump-flows br0
OFPST_FLOW reply (OF1.4) (xid=0x2):
 flow_id=29, cookie=0x0, duration=3.313s, table=0, n_packets=n/a, n_bytes=3481169152, in_port=31 actions=output:32
admin@PicOS-OVS$

 

Add flow remotely

User can add flow entry at remote side, and must configure controller before, switch's managerment ip is 10.10.51.138.

Switch,
admin@PicOS-OVS$ovs-vsctl set-controller br0 ptcp:6633:10.10.51.138
 
Remote server,
root@dev-42:~# ovs-ofctl add-flow tcp:10.10.51.138:6633 in_port=32,actions=output:31                  
root@dev-42:~# 
  • No labels