Neutron/VPNaaS/SSLVPN
概述
此页面描述了 IceHouse 版本 OpenStack Networking 中的 SSL-VPN 扩展功能。请同时查看如何使用 sslvpn 扩展功能 使用方法
数据模型
SSLVPN连接资源
| 属性 | 类型 | 必需 | CRUD | 默认值 | 验证约束 | 笔记 |
|---|---|---|---|---|---|---|
| id | uuid-str | 不适用 | R | 自动生成 | 不适用 | VPNService 对象的 UUID |
| tenant_id | uuid-str | Yes | CR | 无 | 有效的 tenant_id | vpn 服务的租户 UUID |
| name | 字符串 | 否 | CRU | 无 | 不适用 | VPN 服务的名称 |
| status | 字符串 | 不适用 | R | 不适用 | 不适用 | 指示 ipsec vpnservice 是否当前处于运行状态。可能的值包括 ACTIVE DOWN BUILD ERROR |
| admin_state_up | 布尔值 | 不适用 | CRU | TRUE | true/false | vpnservice 的管理状态。如果为 false (down),端口将不转发数据包 |
| client_address_pool_cidr | cidr | 是 | CR | 不适用 | 有效的 cidr | sslvpn 客户端将使用的客户端地址池子网 |
| credential_id | uuid-str | 是 | CR | 有效的 vpn 凭证 ID | 不适用 | VPNCredential 的 UUID |
| vpnservice_id | uuid-str | 是 | CR | 有效的 vpn 服务 ID | 不适用 | VPNService 的 UUID |
| port_no | 整数 | 否 | CRU | 非负数 | 不适用 | sslvpn 监听的端口号 |
VPN凭证资源
| 属性 | 类型 | 必需 | CRUD | 默认值 | 验证约束 | 笔记 |
|---|---|---|---|---|---|---|
| id | uuid-str | 不适用 | R | 自动生成 | 不适用 | UUID for the IKEPolicy |
| tenant_id | uuid-str | Yes | CR | 无 | 有效的 tenant_id | vpn 服务的拥有者 UUID |
| name | 字符串 | 是 | CRU | 无 | 不适用 | ikepolicy 的友好名称 |
| ca | 字符串 | 是 | CR | 不适用 | 不适用 | PEM 编码的 CA 证书 |
| server_certificate | 字符串 | 是 | CR | 不适用 | 不适用 | PEM 编码的服务器证书 |
| server_key | 字符串 | 是 | CR | 不适用 | 不适用 | PEM 编码的服务器密钥 |
| dh | 字符串 | 是 | CR | 不适用 | 不适用 | PEM 编码的 dh 密钥 |
| crl | 字符串 | 否 | CRU | 无 | 不适用 | PEM 编码的 crl 密钥 |
命令
本节描述了将引入 python-neutronclient 的命令,以支持 SSLVPN 服务
vpn-credential-create Create an VPNCredential. vpn-credential-delete Delete a given VPNCredential. vpn-credential-list List VPNCredentials that belong to a given tenant. vpn-credential-show Show information of a given VPNCredential. vpn-credential-update Update a given VPNCredential. ssl-vpn-connection-create Create an SSLVPNConnection. ssl-vpn-connection-delete Delete a given SSLVPNConnection. ssl-vpn-connection-list List SSLVPNConnections that belong to a given tenant. ssl-vpn-connection-show Show information of a given SSLVPNConnection. ssl-vpn-connection-update Update a given SSLVPNConnection.
命令规范 (待定)
vpn-credential-create
创建一个新的 vpn 凭证
usage: neutron vpn-credential-create [-h] [-f {shell,table}] [-c COLUMN]
[--variable VARIABLE] [--prefix PREFIX]
[--request-format {json,xml}]
[--tenant-id TENANT_ID]
[--admin-state-down] [--name NAME] --ca
CA --server_certificate
SERVER_CERTIFICATE --server_key
SERVER_KEY --dh DH --crl CRL
样本
neutron vpn-credential-create --name test --ca ca.crt --server_certificate east-server.crt --server_key east-server.key --dh dh1024.pem
vpn-credential-list
创建一个新的 vpn 凭证
usage: neutron vpn-credential-list
vpn-credential-list
列出新的 vpn 凭证
usage: neutron vpn-credential-list
vpn-credential-show
显示一个新的 vpn 凭证
usage: neutron vpn-credential-show [-h] [-f {shell,table}] [-c COLUMN]
[--variable VARIABLE] [--prefix PREFIX]
[--request-format {json,xml}] [-D]
[-F FIELD]
VPN_CREDENTIAL
vpn-credential-delete
删除一个 vpn 凭证
usage: neutron vpn-credential-delete [-h] [--request-format {json,xml}]
VPN_CREDENTIAL
ssl-vpn-connection-create
usage: neutron ssl-vpn-connection-create [-h] [-f {shell,table}] [-c COLUMN]
[--variable VARIABLE]
[--prefix PREFIX]
[--request-format {json,xml}]
[--tenant-id TENANT_ID]
[--admin-state-down] [--name NAME]
[--client_address_pool_cidr CLIENT_ADDRESS_POOL_CIDR]
VPNSERVICE VPNCREDENTIAL
ssl-vpn-connection-list
列出 ssl vpn 连接
usage: neutron ssl-vpn-connection-list
ssl-vpn-connection-list
显示一个 ssl vpn 连接
usage: neutron ssl-vpn-connection-show [-h] [-f {shell,table}] [-c COLUMN]
[--variable VARIABLE] [--prefix PREFIX]
[--request-format {json,xml}] [-D]
[-F FIELD]
SSL_VPN_CONNECTION
ssl-vpn-connection-update
更新一个 ssl vpn 连接
usage: neutron ssl-vpn-connection-update [-h] [--request-format {json,xml}]
SSL_VPN_CONNECTION
ssl-vpn-connection-delete
删除一个 ssl vpn 连接
usage: neutron ssl-vpn-connection-delete [-h] [--request-format {json,xml}]
SSL_VPN_CONNECTION
REST API
创建 VPN 凭证
curl -X POST -H "X-Auth-Token: $auth_token" -H "Content-type:application/json" -d '{"vpn_credential": {"name": "cred1", "ca":"CA certificate in PEM format", "server_certificate":"server certificate in PEM format", "server_key":"server key in PEM format", "dh":"dh in PEM format", "crl":"crl in pem format"} }' $q_url/vpn/vpn-credentials
创建 SSL VPN 连接
curl -X POST -H "X-Auth-Token: $auth_token" -H "Content-type:application/json" -d '{"ssl_vpn_connection":{"name":"conn1", "client_address_pool_cidr":"10.8.0.0/24", "credential_id": "434a9843-ecc0-4653-8f3a-e604d9d7aadc", "admin_state_up": "True", "vpnservice_id":"cc91b7af-8304-4aff-ad07-86bdbaae2e93"}}' $q_url/vpn/ssl-vpn-connections
列出 VPN 凭证
curl -X GET -H "X-Auth-Token: $auth_token" $q_url/vpn/vpn-credentials
列出 SSL VPN 连接
curl -X GET -H "X-Auth-Token: $auth_token" $q_url/vpn/ssl-vpn-connections
删除 VPN 凭证
curl -X DELETE -H "X-Auth-Token: $auth_token" $q_url/vpn/vpn-credentials/336fb70e-8ce1-469a-9f6f-04f696d030cf
删除 SSL VPN 连接
curl -X DELETE -H "X-Auth-Token: $auth_token" $q_url/vpn/ssl-vpn-connections/336523b8-edd9-4c22-9f62-a45f7cd39f59
高级任务流程
使用 SSLVPN API 配置 SSL VPN 的高级任务流程如下
- 租户创建一个 VPNService,不包含任何连接。
- 租户创建一个或多个 VPNCredential。
- 租户创建一个或多个 SSLVPnConnection 并与 VPNService id、VPNCredential id 关联
Blueprints
https://blueprints.launchpad.net/neutron/+spec/neutron-ssl-vpn