...
Code Block | ||||
---|---|---|---|---|
| ||||
apiVersion: sdewan sdewan.akraino.org/v1alpha1 kind: IpsecProposal IpsecSite metadata: name: ipsecsite-sample spec: sites: - name: siteA name: test_proposal_1 namespace: default labels: gatewaysdewanPurpose: 10.0.1.2 cnf-1 spec: pre_shared_keyencryption_algorithm: test123aes128 authenticationhash_methodalgorithm: psksha256 dh_group: local_identifier: C=CH, O=strongSwan, CN=peermodp3072 status: appliedVersion: "1" appliedTime: "2020-04-12T09:28:38Z" inSync: True |
Code Block | ||||
---|---|---|---|---|
| ||||
apiVersion: sdewan.akraino.org/v1alpha1 kind: IpsecSite metadata: name: ipsecsite-sample namespace: default labels: sdewanPurpose: cnf-1 spec: remote: xx.xx.xx.xx authentication_method: psk pre_shared_key: xxx local_public_cert: local_private_cert: shared_ca: local_identifier: remote_identifier: crypto_proposal: - test_proposal_1 connections: - connection_name: connection_A type: tunnel mode: start local_subnet: 172.12.0.0/24, 10.239.160.22 remote_sourceip: 172.12.0.30-172.12.0.45 remote_identifiersubnet: C=CH, O=strongSwan, CN=peerB crypto_proposal: - proposal1 - test_proposal_1 status: force_crypto_proposal appliedVersion: "01" connections:appliedTime: "2020-04-12T09:28:38Z" inSync: True - name: connA type: tunnel/transport mode: start local_subnet: 192.168.1.1/24 local_sourceip: 10.0.1.1 remote_subnet: 192.168.0.1/24 remote_sourceip: 10.0.1.2 |
Code Block | ||||
---|---|---|---|---|
| ||||
apiVersion: sdewan.akraino.org/v1alpha1 kind: IpsecHost metadata: name: ipsechost-sample namespace: default labels: sdewanPurpose: cnf-1 spec: remote: xx.xx.xx.xx/%any authentication_method: psk pre_shared_key: xxx local_public_cert: local_private_cert: shared_ca: local_identifier: remote_identifier: crypto_proposal: - cryptotest_proposal_1 connections: - connection_name: connection_A - proposal2 proposalstype: tunnel - namemode: proposal1start encryptionlocal_algorithmsourceip: aes128%config hash_algorithm: sha256remote_sourceip: xx.xx.xx.xx dhremote_group: modp3072subnet: xx.xx.xx.xx/xx - namecrypto_proposal: proposal2 encryption_algorithm: aes128- test_proposal_1 status: hash_algorithmappliedVersion: sha128"1" appliedTime: "2020-04-12T09:28:38Z" dh_groupinSync: modp3072True |
IPSec Rest API
SD-EWAN IPSec Restful API provides support to get/create/update/delete IPSec Site, Proposal.
...
- Normal response codes: 200
Response Parameters
Name
In
Type
Description
proposals body array a dict of defined proposals Response Example
{
"proposals": [{
"name": "proposal1",
"encryption_algorithm": "aes128",
"hash_algorithm": "sha256",
"dh_group": "modp3072"
}
]
}
GET /cgi-bin/luci/sdewan/ipsec/v1/proposals/{proposal-name}
...
Request: N/A
Request Parameters
Name
In
Type
Description
proposal-name path string proposal name
Response
- Normal response codes: 200
- Error response code: 404
Response Parameters
Name
In
Type
Description
name body string proposal name encryption_algorithm body string encryption algorithm hash_algorithm body string hash algorithm dh_group body string Diffie-Hellman group Response Example
{
"name": "proposal1",
"encryption_algorithm": "aes128",
"hash_algorithm": "sha256",
"dh_group": "modp3072"
}
DELETE /cgi-bin/luci/sdewan/ipsec/v1/proposals/{proposal-name}
...
Request:
Request Parameters:
Name
In
Type
Required Description
site-name path string Y Site name gateway body string Y The corresponding responder pre_shared_key body string N Optional, only if using the PSK authentication mode local_public_cert body string N Optional, only if using the public key authentication mode. Public key used for auth. local_private_cert body string N Optional, only if using the public key authentication mode. Private key used for auth. shared_ca body string N Optional, only if using the public key authentication mode. CA information authentication_method body string Y Either 'psk' or 'pubkey' as the authentication method. local_identifier body string N The identifier for localhost remote_identifier body string N The identifier for remote counter party crypto_proposal body list Y Proposal names used for ike process force_crypto_proposal body boolean N The flag on forcing the proposal or not connections body list Y List of connectionArray connectionArray:
Name In Type Required Description name body string Y Connection name type body string Y Type of connection. Either "tunnel" or "transport" mode body string Y Mode used for connection. Either 'add', 'route' or 'start' local_subnet body string N Defines the local subnet. local_nat body string N Defines the local nat, if exists, replace the local_subnet local_sourceip body string N Defines the local source ip local_updown body string N Defines the local iptable rules. local_firewall body string N Flag used to determine whether to enable the local firewall rules or not remote_subnet body string N Defines the subnet of the counter party remote_sourceip body string N Defines the source ip of the counter party remote_updown body string N Defines the iptable rules applied for the counter party remote_firewall body string N Flag used to determine whether to enable the remote firewall rules or not crypto_proposal body string N Crypto proposal used for ESP - Request Example
PUT /cgi-bin/luci/sdewan/ipsec/v1/sites/sites
{
"gateway": "10.1.0.2",
"name": "site1",
"crypto_proposal": "proposal1"
"connections": [
{
"name": "site_to_site",
"type": "tunnel"
"local_subnet":
"remote_subnet":
"crypto_proposal": "proposal1"
}
}
...
- Normal response codes: 200
Response Parameters
Name
In
Type
Description
sites body array a list of defined sites Response Example
{
"sites": [{ "name": "site1",
"gateway":"10.0.1.2",
"authentication_method": "psk",
"crypto_proposal": "proposal1",
"connections": [
{
"name": "connA"
"type": "tunnel"
"local_subnet": "192.168.1.1/24",
"remote_subnet": "192.168.0.1/24",
"crypto_proposal": "proposal1"
}
]
}
]
}
GET /cgi-bin/luci/sdewan/ipsec/v1/sites/{site-name}
...
Request: N/A
Request Parameters
Name
In
Type
Description
site-name path string remote site name
Response
- Normal response codes: 200
- Error response code: 404
Response Parameters
Name
In
Type
Required Description
name body string Y Site name gateway body string Y The corresponding responder pre_shared_key body string N Optional, only if using the PSK authentication mode local_public_cert body string N Optional, only if using the public key authentication mode. Public key used for auth. local_private_cert body string N Optional, only if using the public key authentication mode. Private key used for auth. shared_ca body string N Optional, only if using the public key authentication mode. CA information authentication_method body string Y Either 'psk' or 'pubkey' as the authentication method. local_identifier body string N The identifier for localhost remote_identifier body string N The identifier for remote counter party crypto_proposal body list Y Proposal names used for ike process force_crypto_proposal body boolean N The flag on forcing the proposal or not connections body list Y List of connectionArray connectionArray:
Name In Type Required Description name body string Y Connection name type body string Y Type of connection. Either "tunnel" or "transport" mode body string Y Mode used for connection. Either 'add', 'route' or 'start' local_subnet body string N Defines the local subnet. local_nat body string N Defines the local nat, if exists, replace the local_subnet local_sourceip body string N Defines the local source ip local_updown body string N Defines the local iptable rules. local_firewall body string N Flag used to determine whether to enable the local firewall rules or not remote_subnet body string N Defines the subnet of the counter party remote_sourceip body string N Defines the source ip of the counter party remote_updown body string N Defines the iptable rules applied for the counter party remote_firewall body string N Flag used to determine whether to enable the remote firewall rules or not crypto_proposal body string N Crypto proposal used for ESP Response Example
{
"name": "site1",
"gateway":"10.1.0.2",
"crypto_proposal": "proposal1"
"connections": [
{
"name": "site_to_site",
"type": "tunnel",
"local_subnet":
"remote_subnet":
"crypto_proposal": "proposal2"
}
]
}
DELETE /cgi-bin/luci/sdewan/ipsec/v1/sites/{site-name}
...