Skip to content

Instantly share code, notes, and snippets.

@icarocamelo
icarocamelo / sudo ovs-vsctl list ssl
Created August 20, 2015 13:55
sudo ovs-vsctl list ssl
mininet@mininet-vm:~$ sudo ovs-vsctl list ssl
_uuid : b8449e22-40a1-49ae-87fa-d25c04683426
bootstrap_ca_cert : false
ca_cert : "/var/lib/openvswitch/pki/controllerca/cacert.pem"
certificate : "/etc/openvswitch/sc-cert.pem"
external_ids : {}
private_key : "/etc/openvswitch/sc-privkey.pem"
@icarocamelo
icarocamelo / ovs-vswitchd-after-openssl-update.log
Created August 20, 2015 19:22
/var/log/openvswitch/ovs-vswitchd.log (after openssl update)
2015-08-20T19:17:19Z|00594|stream_ssl|ERR|Private key must be configured to use SSL
2015-08-20T19:17:19Z|00595|stream_ssl|ERR|Certificate must be configured to use SSL
2015-08-20T19:17:19Z|00596|stream_ssl|ERR|CA certificate must be configured to use SSL
2015-08-20T19:17:19Z|00597|rconn|WARN|s1<->ssl:10.0.1.6:6653: connection failed (Protocol not available)
2015-08-20T19:17:27Z|00598|stream_ssl|ERR|Private key must be configured to use SSL
2015-08-20T19:17:27Z|00599|stream_ssl|ERR|Certificate must be configured to use SSL
2015-08-20T19:17:27Z|00600|stream_ssl|ERR|CA certificate must be configured to use SSL
2015-08-20T19:17:27Z|00601|rconn|WARN|s1<->ssl:10.0.1.6:6653: connection failed (Protocol not available)
2015-08-20T19:17:31Z|00602|netdev_linux|WARN|ethtool command ETHTOOL_GFLAGS on network device s3-eth2 failed: No such device
2015-08-20T19:17:31Z|00603|dpif|WARN|Dropped 14 log messages in last 259 seconds (most recently, 259 seconds ago) due to excessive rate
<!-- default OF-switch-connection-provider (port 6633) -->
<module>
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:openflow:switch:connection:provider:impl">prefix:openflow-switch-connection-provider-impl</type>
<name>openflow-switch-connection-provider-default-impl</name>
<port>6633</port>
<switch-idle-timeout>15000</switch-idle-timeout>
<transport-protocol>TLS</transport-protocol>
<tls>
<keystore>configuration/ssl/ctl.jks</keystore>
<keystore-type>JKS</keystore-type>
./karaf debug -Djavax.net.debug=ssl,handshake
feature:install odl-openflowplugin-flow-services-li
# My OVS config:
sudo ovs-vsctl show
c1174f51-ea43-4a48-865c-679d4327b2be
Bridge "br0"
Controller "ssl:10.0.1.6:6633"
Port "br0"
Interface "br0"
@icarocamelo
icarocamelo / socket-client.py
Last active September 9, 2015 19:14
simple socket client
#client example
import socket
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print 'Connecting...'
client_socket.connect(('127.0.0.1', 8887))
print 'Connected'
while 1:
data = client_socket.recv(512)
if ( data == 'q' or data == 'Q'):
client_socket.close()
@icarocamelo
icarocamelo / socket-server.py
Last active September 9, 2015 19:13
simple socket server
#!/usr/bin/python
import socket
print 'Starting server...'
s = socket.socket()
host = '127.0.0.1'
port = 8887
s.bind((host, port))
print 'Bind'
s.listen(5) # Now wait for client connection.
while True:
@icarocamelo
icarocamelo / keystore.java
Created September 24, 2015 19:53
add-to-keystore
public java.security.cert.Certificate getCert(Certificate certificate,
InputStream certificateStream) throws NoSuchAlgorithmException,
CertificateException, IOException, KeyStoreException {
String alias = "alias"; // TODO: replace for certificate.getAlias()
KeyStore keystore = KeyStore.getInstance("JKS");
keystore.load(certificateStream,
certificate.getKeyPassword().toCharArray());
java.security.cert.Certificate cert = keystore.getCertificate(alias);
return cert;
}
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<profiles>
<profile>
<id>opendaylight-release</id>
<repositories>
<repository>
<id>opendaylight-mirror</id>
@icarocamelo
icarocamelo / odl-notes.txt
Created October 1, 2015 13:25
Opendaylight notes
1) GettingStarted:Development Environment Setup
https://wiki.opendaylight.org/view/GettingStarted:Development_Environment_Setup#Edit_your_.7E.2F.m2.2Fsettings.xml
GettingStarted:_Eclipse
2) https://wiki.opendaylight.org/view/GettingStarted:_Eclipse
You need to clone and compile in that order:
1. odlparent (git clone https://git.opendaylight.org/gerrit/odlparent)
2. yangtools (git clone https://git.opendaylight.org/gerrit/yangtools)
2015-10-08 18:36:32,123 | WARN | oupCloseable-6-1 | NetconfDeviceCommunicator | 264 - org.opendaylight.controller.sal-netconf-connector - 1.2.2.SNAPSHOT | RemoteDevice{controller-config}: Session went down
java.io.IOException: End of input detected. Close the session.
at org.opendaylight.controller.netconf.nettyutil.AbstractNetconfSession.endOfInput(AbstractNetconfSession.java:80)[116:org.opendaylight.controller.netconf-netty-util:0.3.2.SNAPSHOT]
at org.opendaylight.protocol.framework.AbstractProtocolSession.channelInactive(AbstractProtocolSession.java:40)[104:org.opendaylight.controller.protocol-framework:0.6.2.SNAPSHOT]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:237)[75:io.netty.transport:4.0.26.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:223)[75:io.netty.transport:4.0.26.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.jav