Create elastic network interface
Updated at:2025-10-16
Description
Create an elastic network interface.
- IPv4 and IPv6 intranet IPs can be specified. The specified intranet IP must be within the subnet of the elastic network interface and cannot be occupied;
- Among the specified IPv4 IPs, only one can be the primary IP address, while the others must be secondary IP addresses;
- When specifying an IPv6 IP, the subnet where the elastic network interface resides must have an allocated IPv6 segment. Currently, all IPv6 IPs are secondary IP addresses
- The privateIpAddress of "" indicates automatic IP address allocation
- When creating an elastic network interface, it is possible to bind either an existing regular security group or enterprise security group (alternative). The VPC of the regular security group must match the VPC of the network interface card
Request structure
Plain Text
1POST /v{version}/eni?clientToken={clientToken} HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: authorization string
4{
5 "name":"eni_test",
6 "subnetId":"sbn-nbxaetqfwc4r",
7 "privateIpSet":[
8 {
9 "primary":true,
10 "privateIpAddress":""
11 },
12 {
13 "primary":false,
14 "privateIpAddress":"192.168.0.1"
15 }
16 ],
17 "ipv6PrivateIpSet":[
18 {
19 "primary":false,
20 "privateIpAddress":""
21 },
22 {
23 "primary":false,
24 "privateIpAddress":"2400:da00:e003:0:1d2:100:0:12"
25 }
26 ],
27 "securityGroupIds":[
28 "g-SY5smEG9"
29 ],
30 "description":"desc"
31}
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Types | Whether required | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | For API version No., the current value is 1 |
| name | String | Yes | RequestBody | Name of elastic network interface |
| subnetId | String | Yes | RequestBody | ID of subnet to which the elastic network interface belongs |
| securityGroupIds | List<String> | No | RequestBody | Specified set of bound regular security groups |
| enterpriseSecurityGroupIds | List<String> | No | RequestBody | Specified set of bound enterprise security groups |
| privateIpSet | List<[PrivateIP](VPC/API Reference/Appendix.md#PrivateIP)> | Yes | RequestBody | Specified intranet IPv4 IP information |
| ipv6PrivateIpSet | List<[PrivateIP](VPC/API Reference/Appendix.md#PrivateIP)> | No | RequestBody | Specified intranet IPv6 IP information |
| description | String | No | RequestBody | Elastic network interface description |
| networkInterfaceTrafficMode | String | No | RequestBody | Distinguish the creation of the elastic RDMA network interface (ERI) and the standard elastic network interface (ENI) |
| clientToken | String | No | Query | Idempotence Token, which is an ASCII string with a length not exceeding 64 bits, for details, refer to [ClientToken IdempotenceSupport](VPC/API Reference/General Description.md#Idempotence). |
securityGroupIds and enterpriseSecurityGroupIds cannot both be empty or both have values; select either one and assign value;
Two options are available for networkInterfaceTrafficMode: highPerformance and standard. highPerformance indicates the creation of an ERI, while standard indicates the creation of an ENI. The default is standard;
Response headers
No special headers are required beyond the standard ones.
Response parameters
| Parameter name | Types | Description |
|---|---|---|
| eniId | String | Elastic network interface ID |
Request example
Plain Text
1POST /v1/eni?clientToken=cecad37a-5a1e-4135-a1bc-b1a105d12dec HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2017-03-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
4{
5 "name":"eni_test",
6 "subnetId":"sbn-dk8gl9bc",
7 "privateIpSet":[
8 {
9 "primary":true,
10 "privateIpAddress":""
11 },
12 {
13 "primary":false,
14 "privateIpAddress":"192.168.0.1"
15 }
16 ],
17 "ipv6PrivateIpSet":[
18 {
19 "primary":false,
20 "privateIpAddress":""
21 },
22 {
23 "primary":false,
24 "privateIpAddress":"2400:da00:e003:0:1d2:100:0:12"
25 }
26 ],
27 "securityGroupIds":[
28 "g-SY5smEG9"
29 ],
30 "description":"desc"
31}
Response example
Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: 7e789a40-adac-414a-8bd4-916d6be61112
3Date: Mon, 02 Apr 2019 08:14:25 GMT
4Content-Type: application/json;charset=UTF-8
5Server: BWS
6{
7 "eniId":"eni-w2d4kgc3x0y1"
8}
