source: etherws/trunk/README.rst @ 274

Revision 274, 6.8 KB checked in by atzm, 9 years ago (diff)

version bump

  • Property svn:keywords set to Id
RevLine 
[141]1Introduction
2============
[260]3etherws is an implementation of software switch with the Ethernet over
4WebSocket tunnel.
[141]5
[216]6Overview
7========
[260]8*etherws sw* is a simple virtual ethernet switch.  And this is controlled by
9*etherws ctl*::
[141]10
[260]11   [tap] [netdev]
12     |      |
13  +--+------+--+   (control)
[216]14  | etherws sw | <-----------+
15  +-----||-----+             |
16        ||            +-------------+
17    (WebSocket)       | etherws ctl |
18        ||            +-------------+
19  +-----||-----+             |
20  | etherws sw | <-----------+
[260]21  +--+------+--+   (control)
22     |      |
23   [tap] [netdev]
[141]24
[216]25Basic Usage
26===========
27For example, consider creating following simple network::
[141]28
[216]29          (Physical Network)
[260]30  -----+--------- // --------+-----
[216]31       | 10.0.0.10           | 10.0.0.5
32  +----+-----+         +-----+----+
33  | NodeA    |         | NodeB    |
34  |          |         |          |
35  | [ethws0] |         | [ethws0] |
36  +----||----+         +----||----+
37       || 192.0.2.10/24     || 192.0.2.5/24
38       ``===================''
39          (WebSocket Tunnel)
[141]40
[260]41In this case, WebSocket Tunnel will be created by following commands.
[141]42
[216]43on NodeA::
[141]44
[216]45  # etherws sw
46  # etherws ctl addport tap ethws0
[218]47  # etherws ctl setif --address 192.0.2.10 --netmask 255.255.255.0 1
[141]48
[216]49on NodeB::
[146]50
[216]51  # etherws sw
52  # etherws ctl addport tap ethws0
[218]53  # etherws ctl setif --address 192.0.2.5 --netmask 255.255.255.0 1
[216]54  # etherws ctl addport client ws://10.0.0.10/
[144]55
[216]56*listport*, *listif* or *listfdb* commands will show you current port list,
57interface list, or forwarding database entries::
[162]58
[216]59  # etherws ctl listport
60  # etherws ctl listif
61  # etherws ctl listfdb
[162]62
[156]63Using SSL/TLS
[216]64-------------
[260]65etherws supports SSL/TLS connection.  Tunnels will be encrypted and server will
[216]66be verified by using following options.
[144]67
[216]68On server side::
[152]69
[216]70  # etherws sw --sslkey ssl.key --sslcert ssl.crt
[144]71
[260]72*ssl.key* is a server private key, and *ssl.crt* is a server
73certificate.
[144]74
[216]75On client side::
[144]76
[216]77  # etherws ctl addport client --cacerts ssl.crt wss://10.0.0.10/
[152]78
[216]79URL scheme was just changed to *wss*, and CA certificate to verify server
80certificate was specified.
[156]81
[260]82Client verifies server certificate by default.  So, for example, *addport* will
[216]83fail if your server uses self-signed certificate and client uses another CA
84certificate.
[156]85
[216]86If you want to just encrypt tunnels and do not need to verify server
87certificate, then you can use *--insecure* option::
[156]88
[216]89  # etherws ctl addport client --insecure wss://10.0.0.10/
[156]90
[216]91Note: see http://docs.python.org/library/ssl.html for more information about
92certificates.
[156]93
[152]94Client Authentication
[216]95---------------------
[260]96etherws supports HTTP Basic Authentication.  This means you can use etherws as
[216]97simple L2-VPN server/client.
[152]98
[216]99On server side, etherws requires user informations in Apache htpasswd format
[260]100(and currently supports SHA-1 digest only).  To create this file::
[152]101
102  # htpasswd -s -c filename username
103
[216]104If you do not have htpasswd command, then you can use python one-liner
105instead::
[152]106
107  # python -c 'import hashlib; print("username:{SHA}" + hashlib.sha1("password").digest().encode("base64"))'
108
[216]109To run server with this file::
[152]110
[216]111  # etherws sw --htpasswd filename
[152]112
[216]113On client side, etherws requires username and password from option with
114*addport* command::
[152]115
[216]116  # etherws ctl addport client --user username --passwd password ws://10.0.0.10/
[152]117
[216]118Or, password can be input from stdin::
[152]119
[216]120  # etherws ctl addport client --user username ws://10.0.0.10/
121  Client Password:
[152]122
[216]123If authentication did not succeed, then *addport* will fail.
[152]124
[216]125Note that you should not use HTTP Basic Authentication without SSL/TLS support,
[260]126because this is insecure in itself.
[152]127
[216]128Advanced Usage
129==============
[152]130
[216]131Remote Control
132--------------
[260]133*etherws ctl* controls *etherws sw* by JSON-RPC over HTTP.  This means you can
134control *etherws sw* from remote nodes.  However, allowing remote control
135without careful consideration also allows to attack to your server or
136network.  So control URL is bound to localhost by default.
[170]137
[216]138If you just want to allow remote control, you can use following options for
139example::
[170]140
[216]141  # etherws sw --ctlhost 10.0.0.10 --ctlport 1234
[170]142
[216]143This means allowing remote control from any nodes that can access
[260]14410.0.0.10:1234 TCP/IP.  Of course this is very dangerous as described above.
[170]145
[216]146Here, *etherws ctl* can control remote *etherws sw* using following option::
[170]147
[216]148  # etherws ctl --ctlurl http://10.0.0.10:1234/ctl ...
149
150*etherws sw* controller supports SSL/TLS connection and client authentication
151as well as WebSocket tunnel service.
152
153On server side::
154
155  # etherws sw --ctlhost 10.0.0.10 --ctlport 443 \
156               --ctlhtpasswd htpasswd --ctlsslkey ssl.key --ctlsslcert ssl.crt
157
158On client side::
159
160  # etherws ctl --ctlurl https://10.0.0.10/ctl \
161                --ctluser username --ctlpasswd password ...
162
163Password can be input from stdin as well as WebSocket tunnel creation.
164
[260]165Virtual Machines Connection
166---------------------------
[216]167For example, consider creating following virtual machine network::
168
169  +------------------+             +------------------+
170  | HypervisorA      |             |      HypervisorB |
171  |  +-----+         |             |         +-----+  |
172  |  | VM  |         |             |         | VM  |  |
173  |  +--+--+         |             |         +--+--+  |
[260]174  |  (vnet0)         |             |         (vnet0)  |
[216]175  |     |            |             |            |     |
[260]176  | [etherws] (eth0) |             | (eth0) [etherws] |
[216]177  +----||--------+---+             +----+-------||----+
178       ||        |                      |       ||
[260]179       ||   -----+--------- // ---------+-----  ||
[216]180       ||           (Physical Network)          ||
181       ||                                       ||
182       ``=======================================''
183                   (WebSocket Tunnel)
184
[260]185Existing network interfaces can also be added to *etherws sw*.
186So in this case, this will be created by following commands.
[216]187
188on HypervisorA::
189
190  # etherws sw
[260]191  # etherws ctl addport netdev vnet0
[216]192
193on HypervisorB::
194
195  # etherws sw
[260]196  # etherws ctl addport netdev vnet0
[216]197  # etherws ctl addport client ws://HypervisorA/
198
[260]199Of course, you can create the TAP port and connect these using the Linux Bridge
200or the like.
201
[141]202History
203=======
[274]2041.2 (2014-12-29 JST)
205  - verification of controller SSL certificate support
206  - correspond to some library updates
207
[260]2081.1 (2013-10-10 JST)
209  - netdev (existing network interfaces) support
210
[220]2111.0 (2012-08-18 JST)
[216]212  - global architecture change
213
[170]2140.7 (2012-06-29 JST)
215  - switching support
216  - multiple ports support
217
[162]2180.6 (2012-06-16 JST)
219  - improve performance
220
[160]2210.5 (2012-05-20 JST)
222  - added passwd option to client mode
223  - fixed bug: basic authentication password cannot contain colon
224  - fixed bug: client loops meaninglessly even if server stops
225
[158]2260.4 (2012-05-19 JST)
227  - server certificate verification support
228
[152]2290.3 (2012-05-17 JST)
230  - client authentication support
231
[144]2320.2 (2012-05-16 JST)
233  - SSL/TLS connection support
234
2350.1 (2012-05-15 JST)
[141]236  - First release
Note: See TracBrowser for help on using the repository browser.