OLD | NEW |
(Empty) | |
| 1 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 # |
| 5 # An example of how to set up a VPN from the Client (DUT), through the |
| 6 # Router to to the Server. |
| 7 # |
| 8 |
| 9 { "name":"VPNGenesis", |
| 10 "steps":[ |
| 11 ### Create WiFi connection from Client to Router. |
| 12 [ "create", { "type":"hostap" } ], |
| 13 [ "config", { "channel":"2412", "mode":"11b" } ], |
| 14 [ "connect", { "security":"none" } ], |
| 15 |
| 16 ### Create Client & Server VPN configurations. |
| 17 ### |
| 18 ### o Install certficiates files on Server, and Client. |
| 19 ### o Create VPN configuration on the Server. |
| 20 |
| 21 [ "install_files", { "system" : "server", |
| 22 "files" : |
| 23 { "/tmp/vpn-ca.crt": |
| 24 site_eap_certs.ca_cert_1, |
| 25 "/tmp/vpn-server.crt": |
| 26 site_eap_certs.server_cert_1, |
| 27 "/tmp/vpn-server.key": |
| 28 site_eap_certs.server_private_key_1, |
| 29 "/tmp/vpn-dh1024.pem": |
| 30 site_eap_certs.dh1024_pem_key_1 |
| 31 }}], |
| 32 [ "install_files", { "system" : "client", |
| 33 "files" : |
| 34 { "/tmp/ca.crt": |
| 35 site_eap_certs.ca_cert_1, |
| 36 "/tmp/client.crt": |
| 37 site_eap_certs.client_cert_1, |
| 38 "/tmp/client.key": |
| 39 site_eap_certs.client_private_key_1 |
| 40 }}], |
| 41 ### Configure and launch the VPN server. |
| 42 ### Automatically kills any previously running server. |
| 43 ### |
| 44 ### There are two vpn_server_config() uses to ensure that the |
| 45 ### internal configuration is persistent across invocations. |
| 46 [ "vpn_server_config", { "kind" : "openvpn", |
| 47 "config" : |
| 48 { "port":"1194", |
| 49 "proto":"udp", |
| 50 "dev":"tun", |
| 51 "ca":"/tmp/vpn-ca.crt", |
| 52 "cert":"/tmp/vpn-server.crt", |
| 53 "key":"/tmp/vpn-server.key", |
| 54 "dh":"/tmp/vpn-dh1024.pem", |
| 55 "server":"10.8.0.0 255.255.255.0", |
| 56 "ifconfig-pool-persist":"/tmp/ipp.txt", |
| 57 "keepalive":"10 120", |
| 58 "persist-key":"", |
| 59 "persist-tun":"", |
| 60 "status":"/tmp/openvpn-status.log", |
| 61 "verb":"0" |
| 62 } |
| 63 }], |
| 64 [ "vpn_server_config", { "kind" : "openvpn", |
| 65 "config" : { "comp-lzo":"" } |
| 66 }], |
| 67 ### Launch the VPN Client. |
| 68 [ "vpn_client_load_tunnel" ], |
| 69 [ "vpn_client_config", { "kind":"openvpn", |
| 70 "files":{ |
| 71 "ca-certificate":"/tmp/ca.crt", |
| 72 "client-certificate":"/tmp/client.crt", |
| 73 "client-key":"/tmp/client.key" } |
| 74 }], |
| 75 |
| 76 ### Verify the client is connected to the server |
| 77 [ "client_ping", { "ping_ip":"10.8.0.1", |
| 78 "count":"10" } ], |
| 79 |
| 80 [ "vpn_server_kill" ], # Shut down the VPN Server. |
| 81 [ "vpn_client_kill" ], # Shut down the VPN Client. |
| 82 [ "disconnect" ], # Disconnect WiFi setup |
| 83 ], |
| 84 } |
OLD | NEW |