5 If you want to use secure channel to connect OpenFlow switches, you
6 need to use TLS connection. This document describes how to setup Ryu
7 to connect to the Open vSwitch over TLS.
10 Configuring a Public Key Infrastructure
11 ========================================
13 If you don't have a PKI, the ovs-pki script included with Open vSwitch
14 can help you. This section is based on the INSTALL.SSL in the Open
17 NOTE: How to install Open vSwitch isn't described in this
18 document. Please refer to the Open vSwitch documents.
21 Create a PKI by using ovs-pki script::
24 (Default directory is /usr/local/var/lib/openvswitch/pki)
26 The pki directory consists of controllerca and switchca
27 subdirectories. Each directory contains CA files.
30 Create a controller private key and certificate::
32 % ovs-pki req+sign ctl controller
34 ctl-privkey.pem and ctl-cert.pem are generated in the current
38 Create a switch private key and certificate::
40 % ovs-pki req+sign sc switch
42 sc-privkey.pem and sc-cert.pem are generated in the current directory.
45 Testing TLS Connection
46 ======================
48 Configuring ovs-vswitchd to use CA files using the ovs-vsctl "set-ssl"
51 % ovs-vsctl set-ssl /etc/openvswitch/sc-privkey.pem \
52 /etc/openvswitch/sc-cert.pem \
53 /usr/local/var/lib/openvswitch/pki/controllerca/cacert.pem
54 % ovs-vsctl add-br br0
55 % ovs-vsctl set-controller br0 ssl:127.0.0.1:6633
57 Substitute the correct file names, if they differ from the ones used
58 above. You should use absolute file names.
61 Run Ryu with CA files::
63 % ryu-manager --ctl-privkey ctl-privkey.pem \
64 --ctl-cert ctl-cert.pem \
65 --ca-certs /usr/local/var/lib/openvswitch/pki/switchca/cacert.pem \
68 You can see something like::
70 loading app ryu.controller.ofp_handler
71 instantiating app ryu.controller.ofp_handler
73 CONSUMES EventOFPSwitchFeatures
74 CONSUMES EventOFPErrorMsg
75 CONSUMES EventOFPHello
76 CONSUMES EventOFPEchoRequest
77 connected socket:<SSLSocket fileno=4 sock=127.0.0.1:6633 peer=127.0.0.1:61302> a
78 ddress:('127.0.0.1', 61302)
79 hello ev <ryu.controller.ofp_event.EventOFPHello object at 0x1047806d0>
81 switch features ev version: 0x1 msg_type 0x6 xid 0xb0bb34e5 port OFPPhyPort(port
82 _no=65534, hw_addr='\x16\xdc\xa2\xe2}K', name='br0\x00\x00\x00\x00\x00\x00\x00\x
83 00\x00\x00\x00\x00\x00', config=0, state=0, curr=0, advertised=0, supported=0, p