| « PreviousNext » | |
![]() ![]() | Did this page help you? Yes | No | Tell us about it... |
Describes one or more of your network interfaces.
The short version of this command is ec2dnic.
ec2-describe-network-interfaces --filter
FILTER
| Name | Description |
|---|---|
|
|
A filter for limiting the results. See the Supported Filters section for a list of supported filters. Use quotation marks if the value string has a space ("name=value example"). On a Windows system, use quotation marks even without a space in the value string ("name=value"). Type: String Default: None Required: No Example: -F "description=My ENI" |
You can specify filters so that the response includes information for only certain network interfaces. For example, you can use a filter to specify that you're interested in network interfaces launched in a specific Availability Zone. You can specify multiple values for a filter. The response includes information for a network interface only if it matches at least one of the filter values that you specified.
You can specify multiple filters; for example, specify network interfaces in a specific Availability Zone, and that have a specific owner ID. The response includes information for a network interface only if it matches all the filters that you specified. If there's no match, no special message is returned, the response is simply empty.
You can use wildcards in a filter value. An asterisk (*) matches zero or more characters, and a question mark (?) matches exactly one character. You can escape special characters using a backslash (\) before the character. For example, a value of \*amazon\?\\ searches for the literal string *amazon?\.
The following are the available filters.
addresses.private-ip-addressThe private IP addresses associated with the network interface.
Type: String
addresses.primaryWhether the private IP address is the primary IP address associated with the network interface.
Type: Boolean
Valid values: true | false
addresses.association.public-ipThe association ID returned when the network interface was associated with the Elastic IP address.
Type: String
addresses.association.owner-idThe owner ID of the addresses associated with the network interface.
Type: String
association.association-idThe association ID returned when the network interface was associated with an IP address.
Type: String
association.allocation-idThe allocation ID that AWS returned when you allocated the Elastic IP address for your network interface.
Type: String
association.ip-owner-idThe owner of the Elastic IP address associated with the network interface.
Type: String
association.public-ipThe address of the Elastic IP address bound to the network interface.
Type: String
attachment.attachment-idThe ID of the interface attachment.
Type: String
attachment.instance-idThe ID of the instance to which the network interface is attached.
Type: String
attachment.instance-owner-idThe owner ID of the instance to which the network interface is attached.
Type: String
attachment.device-indexThe device index to which the network interface is attached.
Type: Integer
attachment.statusThe status of the attachment.
Type: String
Valid values: attaching | attached | detaching | detached
attachment.attach.timeThe time that the network interface was attached to an instance.
Type: DateTime
attachment.delete-on-terminationIndicates whether the attachment is deleted when an instance is terminated.
Type: Boolean
availability-zoneThe Availability Zone of the network interface.
Type: String
descriptionThe description of the network interface.
Type: String
group-idThe ID of a security group associated with the network interface.
Type: String
group-nameThe name of a security group associated with the network interface.
Type: String
mac-addressThe MAC address of the network interface.
Type: String
network-interface-idThe ID of the network interface.
Type: String
owner-idThe AWS account ID of the network interface owner.
Type: String
private-ip-addressThe private IP address or addresses of the network interface.
Type: String
private-dns-nameThe private DNS name of the network interface.
Type: String
requester-idThe ID of the entity that launched the instance on your behalf (for example, AWS Management Console, Auto Scaling, and so on).
Type: String
requester-managedIndicates whether the network interface is being managed by an AWS service (for example, AWS Management Console, Auto Scaling, and so on).
Type: Boolean
source-dest-checkIndicates whether the network interface performs source/destination checking. A value of true means
checking is enabled, and false means checking is
disabled. The value must be false for the network interface
to perform Network Address Translation (NAT) in your VPC.
Type: Boolean
statusThe status of the network interface. If the network interface is not attached to an instance, the status shows available;
if a network interface is attached to an instance the status shows in-use.
Type: String
Valid values: available | in-use
subnet-idThe ID of the subnet for the network interface.
Type: String
tag-keyThe key of a tag assigned to the resource. This filter is independent of the tag-value filter. For example, if you use both the filter "tag-key=Purpose" and the filter "tag-value=X", you get any resources assigned both the tag key Purpose (regardless of what the tag's value is), and the tag value X (regardless of what the tag's key is). If you want to list only resources where Purpose is X, see the tag: filter.key
For more information about tags, see Tagging Your Resources in the Amazon Elastic Compute Cloud User Guide.
Type: String
tag-valueThe value of a tag assigned to the resource. This filter is independent of the tag-key filter.
Type: String
tag:keyFilters the response based on a specific tag/value combination.
Example: To list just the resources that have been assigned tag Purpose=X, specify:
--filter tag:Purpose=X
Example: To list just resources that have been assigned tag Purpose=X OR Purpose=Y, specify:
--filter tag:Purpose=X --filter tag:Purpose=Y
vpc-idThe ID of the VPC for the network interface.
Type: String
| Option | Description |
|---|---|
|
|
Overrides the region specified by the Default: The value of the Example: |
|
|
The uniform resource locator (URL) of the Amazon EC2 web service entry point. Default: The value of the Example: |
|
|
The private key that identifies you to Amazon EC2. For more information, see Tell the Tools Who You Are. Default: The value of the Example: |
|
|
The X.509 certificate that identifies you to Amazon EC2. Default: The value of the Example: |
|
|
The access key ID associated with your AWS account. For more information, see Tell the Tools Who You Are. Default: The value of the Example: Note For more information, see the following section, Deprecated Options. |
|
|
The secret access key associated with your AWS account. Default: The value of the Example: Note For more information, see the following section, Deprecated Options. |
|
|
The AWS delegation token. Default: The value of the environment variable (if set). |
|
|
The connection timeout, in seconds. Example: |
|
|
The request timeout, in seconds. Example: |
|
|
Displays verbose output, including the API request and response on the command line. This is useful if you are building tools to talk directly to our Query API. |
|
|
Includes column headers in the command output. |
|
|
Shows empty columns as |
|
|
Omits tags for tagged resources. |
|
|
Displays internal debugging information. This can assist us when helping you troubleshooting problems. |
|
|
Displays usage information for the command. |
|
|
Reads arguments from standard input. This is useful when piping the output from one command to the input of another. Example: |
For a limited time, you can still use the private key and X.509 certificate instead of your access key ID and secret access key. However, we recommend that you start using your access key ID (-O, --aws-access-key) and secret access key (-W, --aws-secret-key) now, as the private key (-K, --private-key) and X.509 certificate (-C, --cert) won't be supported after the transition period elapses. For more information, see Tell the Tools Who You Are.
| Option | Description |
|---|---|
|
|
The private key to use when constructing requests to Amazon EC2. Default: The value of the Example: |
|
|
The X.509 certificate to use when constructing requests to Amazon EC2. Default: The value of the Example: |
The command returns a table that contains the following information for each network interface.
The NETWORKINTERFACE identifier
The ID of the network interface
The ID of the subnet
The ID of the VPC
The Availability Zone
A description
The ID of the account that created the network interface
The ID of the entity that launched the instance on your behalf
Whether the network interface is being managed by AWS
The status (available, attaching, in-use, detaching)
The MAC address
The private IP address
The private DNS name
Whether traffic to or from the instance is validated
The GROUP identifier
The ID of the security group
The name of the security group
The ATTACHMENT identifier
The ID of the instance
The ID of the attachment
The ASSOCIATION identifier
The Elastic IP address
The ID of the owner of the Elastic IP address
The ID of the account that created the network association
The ID of the association
The private IP address
The PRIVATEIPADDRESS identifier
The private IP address
Amazon EC2 command line tools display errors on stderr.
This example lists all network interfaces that you own.
PROMPT>ec2-describe-network-interfacesNETWORKINTERFACE eni-5e318a37 subnet-c53c87ac vpc-cc3c87a5 ap-southeast-1b 053230519467 false in-use 02:81:60:c7:15:3d 10.0.0.79 true GROUP sg-084b5664 quick-start-4 ATTACHMENT i-5a0f6b0e eni-attach-59bf7430 attached true PRIVATEIPADDRESS 10.0.0.79 PRIVATEIPADDRESS 10.0.0.183 PRIVATEIPADDRESS 10.0.0.184 NETWORKINTERFACE eni-236dd74a My ENI subnet-c88a35a1 vpc-f28a359b ap-southeast-1a 053230519467 false available 02:78:d7:32:3f:ba 10.0.0.117 true GROUP sg-854954e9 LinuxGroup PRIVATEIPADDRESS 10.0.0.117 NETWORKINTERFACE eni-69ce7500 Primary network interface subnet-c d8a35a4 vpc-f28a359b ap-southeast-1b 053230519467 false in-use 02:78:d7:18:ad:f0 10.0.1.152 true GROUP sg-dc4c51b0 quick-start-2 ATTACHMENT i-e0841fb4 eni-attach-696ba300 attached true PRIVATEIPADDRESS 10.0.1.152 PRIVATEIPADDRESS 10.0.1.12 NETWORKINTERFACE eni-f25de69b subnet-c88a35a1 vpc-f28a359b ap-southeast-1a 053230519467 false in-use 02:78:d7:2d:16:5b 10.0.0.133 true
This example filters for a network interface with the private IP address of 10.0.0.26.
PROMPT>ec2-describe-network-interfaces --filter "addresses.private-ip-address=10.0.0.26"NETWORKINTERFACE eni-4cba0725 subnet-73ba071a vpc-6bba0702 ap-southeast-1b 013274050172 false available 02:75:3f:8e:3a:d3 10.0.0.26 true GROUP sg-8fb3a1e3 default ASSOCIATION 203.0.113.12 013274050172 eipassoc-f008b799 10.0.0.26 PRIVATEIPADDRESS 10.0.0.26