|
1 |
| -**To create a network interface** |
2 |
| - |
3 |
| -This example creates a network interface for the specified subnet. |
4 |
| - |
5 |
| -Command:: |
6 |
| - |
7 |
| - aws ec2 create-network-interface --subnet-id subnet-9d4a7b6c --description "my network interface" --groups sg-903004f8 --private-ip-address 10.0.2.17 |
8 |
| - |
9 |
| -Output:: |
10 |
| - |
11 |
| - { |
12 |
| - "NetworkInterface": { |
13 |
| - "Status": "pending", |
14 |
| - "MacAddress": "02:1a:80:41:52:9c", |
15 |
| - "SourceDestCheck": true, |
16 |
| - "VpcId": "vpc-a01106c2", |
17 |
| - "Description": "my network interface", |
18 |
| - "NetworkInterfaceId": "eni-e5aa89a3", |
19 |
| - "PrivateIpAddresses": [ |
20 |
| - { |
21 |
| - "Primary": true, |
22 |
| - "PrivateIpAddress": "10.0.2.17" |
23 |
| - } |
24 |
| - ], |
25 |
| - "RequesterManaged": false, |
26 |
| - "AvailabilityZone": "us-east-1d", |
27 |
| - "Ipv6Addresses": [], |
28 |
| - "Groups": [ |
29 |
| - { |
30 |
| - "GroupName": "default", |
31 |
| - "GroupId": "sg-903004f8" |
32 |
| - } |
33 |
| - ], |
34 |
| - "SubnetId": "subnet-9d4a7b6c", |
35 |
| - "OwnerId": "123456789012", |
36 |
| - "TagSet": [], |
37 |
| - "PrivateIpAddress": "10.0.2.17" |
38 |
| - } |
39 |
| - } |
| 1 | +**Example 1: To specify an IPv4 address for a network interface** |
| 2 | + |
| 3 | +The following ``create-network-interface`` example creates a network interface for the specified subnet with the specified primary IPv4 address. :: |
| 4 | + |
| 5 | + aws ec2 create-network-interface \ |
| 6 | + --subnet-id subnet-00a24d0d67acf6333 \ |
| 7 | + --description "my network interface" \ |
| 8 | + --groups sg-09dfba7ed20cda78b \ |
| 9 | + --private-ip-address 10.0.8.17 |
| 10 | + |
| 11 | +Output:: |
| 12 | + |
| 13 | + { |
| 14 | + "NetworkInterface": { |
| 15 | + "AvailabilityZone": "us-west-2a", |
| 16 | + "Description": "my network interface", |
| 17 | + "Groups": [ |
| 18 | + { |
| 19 | + "GroupName": "my-security-group", |
| 20 | + "GroupId": "sg-09dfba7ed20cda78b" |
| 21 | + } |
| 22 | + ], |
| 23 | + "InterfaceType": "interface", |
| 24 | + "Ipv6Addresses": [], |
| 25 | + "MacAddress": "06:6a:0f:9a:49:37", |
| 26 | + "NetworkInterfaceId": "eni-0492b355f0cf3b3f8", |
| 27 | + "OwnerId": "123456789012", |
| 28 | + "PrivateDnsName": "ip-10-0-8-18.us-west-2.compute.internal", |
| 29 | + "PrivateIpAddress": "10.0.8.17", |
| 30 | + "PrivateIpAddresses": [ |
| 31 | + { |
| 32 | + "Primary": true, |
| 33 | + "PrivateDnsName": "ip-10-0-8-17.us-west-2.compute.internal", |
| 34 | + "PrivateIpAddress": "10.0.8.17" |
| 35 | + } |
| 36 | + ], |
| 37 | + "RequesterId": "AIDA4Z3Y7GSXTMEXAMPLE", |
| 38 | + "RequesterManaged": false, |
| 39 | + "SourceDestCheck": true, |
| 40 | + "Status": "pending", |
| 41 | + "SubnetId": "subnet-00a24d0d67acf6333", |
| 42 | + "TagSet": [], |
| 43 | + "VpcId": "vpc-02723a0feeeb9d57b" |
| 44 | + } |
| 45 | + } |
| 46 | + |
| 47 | +**Example 2: To create a network interface with an IPv4 address and an IPv6 address** |
| 48 | + |
| 49 | +The following ``create-network-interface`` example creates a network interface for the specified subnet with an IPv4 address and an IPv6 address that are selected by Amazon EC2. :: |
| 50 | + |
| 51 | + aws ec2 create-network-interface \ |
| 52 | + --subnet-id subnet-00a24d0d67acf6333 \ |
| 53 | + --description "my dual stack network interface" \ |
| 54 | + --ipv6-address-count 1 \ |
| 55 | + --groups sg-09dfba7ed20cda78b |
| 56 | + |
| 57 | +Output:: |
| 58 | + |
| 59 | + { |
| 60 | + "NetworkInterface": { |
| 61 | + "AvailabilityZone": "us-west-2a", |
| 62 | + "Description": "my dual stack network interface", |
| 63 | + "Groups": [ |
| 64 | + { |
| 65 | + "GroupName": "my-security-group", |
| 66 | + "GroupId": "sg-09dfba7ed20cda78b" |
| 67 | + } |
| 68 | + ], |
| 69 | + "InterfaceType": "interface", |
| 70 | + "Ipv6Addresses": [ |
| 71 | + { |
| 72 | + "Ipv6Address": "2600:1f13:cfe:3650:a1dc:237c:393a:4ba7", |
| 73 | + "IsPrimaryIpv6": false |
| 74 | + } |
| 75 | + ], |
| 76 | + "MacAddress": "06:b8:68:d2:b2:2d", |
| 77 | + "NetworkInterfaceId": "eni-05da417453f9a84bf", |
| 78 | + "OwnerId": "123456789012", |
| 79 | + "PrivateDnsName": "ip-10-0-8-18.us-west-2.compute.internal", |
| 80 | + "PrivateIpAddress": "10.0.8.18", |
| 81 | + "PrivateIpAddresses": [ |
| 82 | + { |
| 83 | + "Primary": true, |
| 84 | + "PrivateDnsName": "ip-10-0-8-18.us-west-2.compute.internal", |
| 85 | + "PrivateIpAddress": "10.0.8.18" |
| 86 | + } |
| 87 | + ], |
| 88 | + "RequesterId": "AIDA4Z3Y7GSXTMEXAMPLE", |
| 89 | + "RequesterManaged": false, |
| 90 | + "SourceDestCheck": true, |
| 91 | + "Status": "pending", |
| 92 | + "SubnetId": "subnet-00a24d0d67acf6333", |
| 93 | + "TagSet": [], |
| 94 | + "VpcId": "vpc-02723a0feeeb9d57b", |
| 95 | + "Ipv6Address": "2600:1f13:cfe:3650:a1dc:237c:393a:4ba7" |
| 96 | + } |
| 97 | + } |
| 98 | + |
| 99 | +**Example 3: To create a network interface with connection tracking configuration options** |
| 100 | + |
| 101 | +The following ``create-network-interface`` example creates a network interface and configures the idle connection tracking timeouts. :: |
| 102 | + |
| 103 | + aws ec2 create-network-interface \ |
| 104 | + --subnet-id subnet-00a24d0d67acf6333 \ |
| 105 | + --groups sg-02e57dbcfe0331c1b \ |
| 106 | + --connection-tracking-specification TcpEstablishedTimeout=86400,UdpTimeout=60 |
| 107 | + |
| 108 | +Output:: |
| 109 | + |
| 110 | + { |
| 111 | + "NetworkInterface": { |
| 112 | + "AvailabilityZone": "us-west-2a", |
| 113 | + "ConnectionTrackingConfiguration": { |
| 114 | + "TcpEstablishedTimeout": 86400, |
| 115 | + "UdpTimeout": 60 |
| 116 | + }, |
| 117 | + "Description": "", |
| 118 | + "Groups": [ |
| 119 | + { |
| 120 | + "GroupName": "my-security-group", |
| 121 | + "GroupId": "sg-02e57dbcfe0331c1b" |
| 122 | + } |
| 123 | + ], |
| 124 | + "InterfaceType": "interface", |
| 125 | + "Ipv6Addresses": [], |
| 126 | + "MacAddress": "06:4c:53:de:6d:91", |
| 127 | + "NetworkInterfaceId": "eni-0c133586e08903d0b", |
| 128 | + "OwnerId": "123456789012", |
| 129 | + "PrivateDnsName": "ip-10-0-8-94.us-west-2.compute.internal", |
| 130 | + "PrivateIpAddress": "10.0.8.94", |
| 131 | + "PrivateIpAddresses": [ |
| 132 | + { |
| 133 | + "Primary": true, |
| 134 | + "PrivateDnsName": "ip-10-0-8-94.us-west-2.compute.internal", |
| 135 | + "PrivateIpAddress": "10.0.8.94" |
| 136 | + } |
| 137 | + ], |
| 138 | + "RequesterId": "AIDA4Z3Y7GSXTMEXAMPLE", |
| 139 | + "RequesterManaged": false, |
| 140 | + "SourceDestCheck": true, |
| 141 | + "Status": "pending", |
| 142 | + "SubnetId": "subnet-00a24d0d67acf6333", |
| 143 | + "TagSet": [], |
| 144 | + "VpcId": "vpc-02723a0feeeb9d57b" |
| 145 | + } |
| 146 | + } |
| 147 | + |
| 148 | +**Example 4: To create an Elastic Fabric Adapter** |
| 149 | + |
| 150 | +The following ``create-network-interface`` example creates an EFA. :: |
| 151 | + |
| 152 | + aws ec2 create-network-interface \ |
| 153 | + --interface-type efa \ |
| 154 | + --subnet-id subnet-00a24d0d67acf6333 \ |
| 155 | + --description "my efa" \ |
| 156 | + --groups sg-02e57dbcfe0331c1b |
| 157 | + |
| 158 | +Output:: |
| 159 | + |
| 160 | + { |
| 161 | + "NetworkInterface": { |
| 162 | + "AvailabilityZone": "us-west-2a", |
| 163 | + "Description": "my efa", |
| 164 | + "Groups": [ |
| 165 | + { |
| 166 | + "GroupName": "my-efa-sg", |
| 167 | + "GroupId": "sg-02e57dbcfe0331c1b" |
| 168 | + } |
| 169 | + ], |
| 170 | + "InterfaceType": "efa", |
| 171 | + "Ipv6Addresses": [], |
| 172 | + "MacAddress": "06:d7:a4:f7:4d:57", |
| 173 | + "NetworkInterfaceId": "eni-034acc2885e862b65", |
| 174 | + "OwnerId": "123456789012", |
| 175 | + "PrivateDnsName": "ip-10-0-8-180.us-west-2.compute.internal", |
| 176 | + "PrivateIpAddress": "10.0.8.180", |
| 177 | + "PrivateIpAddresses": [ |
| 178 | + { |
| 179 | + "Primary": true, |
| 180 | + "PrivateDnsName": "ip-10-0-8-180.us-west-2.compute.internal", |
| 181 | + "PrivateIpAddress": "10.0.8.180" |
| 182 | + } |
| 183 | + ], |
| 184 | + "RequesterId": "AIDA4Z3Y7GSXTMEXAMPLE", |
| 185 | + "RequesterManaged": false, |
| 186 | + "SourceDestCheck": true, |
| 187 | + "Status": "pending", |
| 188 | + "SubnetId": "subnet-00a24d0d67acf6333", |
| 189 | + "TagSet": [], |
| 190 | + "VpcId": "vpc-02723a0feeeb9d57b" |
| 191 | + } |
| 192 | + } |
| 193 | + |
| 194 | +For more information, see `Elastic network interfaces <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html>`__ in the *Amazon EC2 User Guide*. |
0 commit comments