Modifying a NIC Attribute
You can modify an attribute of a network interface card (NIC).
Using Cockpit, you can only modify the security groups associated with a NIC.
Using the APIs, you can modify other attributes of a NIC.
You can specify only one attribute at a time.
Modifying the Security Groups Associated with a NIC Using Cockpit v2
-
In the NICs dashboard, check the box of the NIC you want to manage the security groups for.
The NIC is selected. -
Click Update Security Groups.
The UPDATE SECURITY GROUPS dialog box appears. -
Click in the field to make the list of security groups appear.
From the list, select the security group(s) you want to associate with the NIC. -
To disassociate a security group from the NIC, click next to the name of the security group.
The NIC must be associated with at least one security group.
-
Click Update.
The security groups of the NIC are modified.
Modifying a NIC Attribute Using OSC CLI
The UpdateNic command modifies the specified network interface card (NIC). You can specify only one attribute at a time.
$ osc-cli api UpdateNic --profile "default" \
--NicId "eni-12345678" \
--LinkNic '{
"DeleteOnVmDeletion": False,
"LinkNicId": "eni-attach-12345678"
}'
$ osc-cli api UpdateNic --profile "default" \
--NicId "eni-12345678" \
--SecurityGroupIds '["sg-12345678"]'
$ osc-cli api UpdateNic --profile "default" \
--NicId "eni-12345678" \
--Description "Example of description"
This command contains the following attributes that you need to specify:
-
Description
: (optional) A new description for the NIC. -
DryRun
: (optional) If true, checks whether you have the required permissions to perform the action. -
LinkNic
: (optional) Information about the NIC attachment. If you are modifying theDeleteOnVmDeletion
attribute, you must specify the ID of the NIC attachment.-
DeleteOnVmDeletion
: (optional) If true, the NIC is deleted when the VM is terminated. If false, the NIC is detached from the VM. -
LinkNicId
: (optional) The ID of the NIC attachment.
-
-
NicId
: The ID of the NIC you want to modify. -
SecurityGroupIds
: (optional) One or more IDs of security groups for the NIC.
You must specify at least one group, even if you use the default security group in the Net.
The UpdateNic command returns the following elements:
-
Nic
: Information about the NIC.-
AccountId
: The account ID of the owner of the NIC. -
Description
: The description of the NIC. -
IsSourceDestChecked
: (Net only) If true, the source/destination check is enabled. If false, it is disabled. -
LinkNic
: Information about the NIC attachment.-
DeleteOnVmDeletion
: If true, the NIC is deleted when the VM is terminated. -
DeviceNumber
: The device index for the NIC attachment (between1
and7
, both included). -
LinkNicId
: The ID of the NIC to attach. -
State
: The state of the attachment (attaching
|attached
|detaching
|detached
). -
VmAccountId
: The account ID of the owner of the VM. -
VmId
: The ID of the VM.
-
-
LinkPublicIp
: Information about the public IP association.-
LinkPublicIpId
: (Required in a Net) The ID representing the association of the public IP with the VM or the NIC. -
PublicDnsName
: The name of the public DNS. -
PublicIp
: The public IP associated with the NIC. -
PublicIpAccountId
: The account ID of the owner of the public IP. -
PublicIpId
: The allocation ID of the public IP.
-
-
MacAddress
: The Media Access Control (MAC) address of the NIC. -
NetId
: The ID of the Net for the NIC. -
NicId
: The ID of the NIC. -
PrivateDnsName
: The name of the private DNS. -
PrivateIps
: The private IPs of the NIC.-
IsPrimary
: If true, the IP is the primary private IP of the NIC. -
LinkPublicIp
: Information about the public IP association.-
LinkPublicIpId
: (Required in a Net) The ID representing the association of the public IP with the VM or the NIC. -
PublicDnsName
: The name of the public DNS. -
PublicIp
: The public IP associated with the NIC. -
PublicIpAccountId
: The account ID of the owner of the public IP. -
PublicIpId
: The allocation ID of the public IP.
-
-
PrivateDnsName
: The name of the private DNS. -
PrivateIp
: The private IP of the NIC.
-
-
SecurityGroups
: One or more IDs of security groups for the NIC.-
SecurityGroupId
: The ID of the security group. -
SecurityGroupName
: The name of the security group.
-
-
State
: The state of the NIC (available
|attaching
|in-use
|detaching
). -
SubnetId
: The ID of the Subnet. -
SubregionName
: The Subregion in which the NIC is located. -
Tags
: One or more tags associated with the NIC.-
Key
: The key of the tag, with a minimum of 1 character. -
Value
: The value of the tag, between 0 and 255 characters.
-
-
-
ResponseContext
: Information about the context of the response.-
RequestId
: The ID of the request.
-
{
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
},
"Nic": {
"SubregionName": "eu-west-2a",
"SubnetId": "subnet-12345678",
"State": "in-use",
"LinkNic": {
"VmId": "i-12345678",
"LinkNicId": "eni-attach-12345678",
"VmAccountId": "123456789012",
"DeleteOnVmDeletion": false,
"DeviceNumber": 0,
"State": "attached"
},
"IsSourceDestChecked": true,
"PrivateDnsName": "ip-10-0-0-4.eu-west-2.compute.internal",
"Tags": [],
"Description": "Primary network interface",
"AccountId": "123456789012",
"SecurityGroups": [
{
"SecurityGroupName": "default",
"SecurityGroupId": "sg-12345678"
}
],
"MacAddress": "A1:B2:C3:D4:E5:F6",
"NetId": "vpc-12345678",
"NicId": "eni-12345678",
"PrivateIps": [
{
"PrivateDnsName": "ip-10-0-0-4.eu-west-2.compute.internal",
"PrivateIp": "10.0.0.4",
"IsPrimary": true
}
]
}
}
{
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
},
"Nic": {
"SubregionName": "eu-west-2a",
"SubnetId": "subnet-12345678",
"State": "in-use",
"LinkNic": {
"VmId": "i-12345678",
"LinkNicId": "eni-attach-12345678",
"VmAccountId": "123456789012",
"DeleteOnVmDeletion": true,
"DeviceNumber": 0,
"State": "attached"
},
"IsSourceDestChecked": true,
"PrivateDnsName": "ip-10-0-0-4.eu-west-2.compute.internal",
"Tags": [],
"Description": "Primary network interface",
"AccountId": "123456789012",
"SecurityGroups": [
{
"SecurityGroupName": "security-group-example",
"SecurityGroupId": "sg-12345678"
}
],
"MacAddress": "A1:B2:C3:D4:E5:F6",
"NetId": "vpc-12345678",
"NicId": "eni-12345678",
"PrivateIps": [
{
"PrivateDnsName": "ip-10-0-0-4.eu-west-2.compute.internal",
"PrivateIp": "10.0.0.4",
"IsPrimary": true
}
]
}
}
{
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
},
"Nic": {
"SubregionName": "eu-west-2a",
"SubnetId": "subnet-12345678",
"State": "in-use",
"LinkNic": {
"VmId": "i-12345678",
"LinkNicId": "eni-attach-12345678",
"VmAccountId": "123456789012",
"DeleteOnVmDeletion": true,
"DeviceNumber": 0,
"State": "attached"
},
"IsSourceDestChecked": true,
"PrivateDnsName": "ip-10-0-0-4.eu-west-2.compute.internal",
"Tags": [],
"Description": "Example of description",
"AccountId": "123456789012",
"SecurityGroups": [
{
"SecurityGroupName": "default",
"SecurityGroupId": "sg-12345678"
}
],
"MacAddress": "A1:B2:C3:D4:E5:F6",
"NetId": "vpc-12345678",
"NicId": "eni-12345678",
"PrivateIps": [
{
"PrivateDnsName": "ip-10-0-0-4.eu-west-2.compute.internal",
"PrivateIp": "10.0.0.4",
"IsPrimary": true
}
]
}
}
Modifying a NIC Attribute Using oapi-cli
The UpdateNic command modifies the specified network interface card (NIC). You can specify only one attribute at a time.
$ oapi-cli --profile "default" UpdateNic \
--NicId "eni-12345678" \
--LinkNic '{
"DeleteOnVmDeletion": False,
"LinkNicId": "eni-attach-12345678"
}'
$ oapi-cli --profile "default" UpdateNic \
--NicId "eni-12345678" \
--SecurityGroupIds '["sg-12345678"]'
$ oapi-cli --profile "default" UpdateNic \
--NicId "eni-12345678" \
--Description "Example of description"
This command contains the following attributes that you need to specify:
-
Description
: (optional) A new description for the NIC. -
DryRun
: (optional) If true, checks whether you have the required permissions to perform the action. -
LinkNic
: (optional) Information about the NIC attachment. If you are modifying theDeleteOnVmDeletion
attribute, you must specify the ID of the NIC attachment.-
DeleteOnVmDeletion
: (optional) If true, the NIC is deleted when the VM is terminated. If false, the NIC is detached from the VM. -
LinkNicId
: (optional) The ID of the NIC attachment.
-
-
NicId
: The ID of the NIC you want to modify. -
SecurityGroupIds
: (optional) One or more IDs of security groups for the NIC.
You must specify at least one group, even if you use the default security group in the Net.
The UpdateNic command returns the following elements:
-
Nic
: Information about the NIC.-
AccountId
: The account ID of the owner of the NIC. -
Description
: The description of the NIC. -
IsSourceDestChecked
: (Net only) If true, the source/destination check is enabled. If false, it is disabled. -
LinkNic
: Information about the NIC attachment.-
DeleteOnVmDeletion
: If true, the NIC is deleted when the VM is terminated. -
DeviceNumber
: The device index for the NIC attachment (between1
and7
, both included). -
LinkNicId
: The ID of the NIC to attach. -
State
: The state of the attachment (attaching
|attached
|detaching
|detached
). -
VmAccountId
: The account ID of the owner of the VM. -
VmId
: The ID of the VM.
-
-
LinkPublicIp
: Information about the public IP association.-
LinkPublicIpId
: (Required in a Net) The ID representing the association of the public IP with the VM or the NIC. -
PublicDnsName
: The name of the public DNS. -
PublicIp
: The public IP associated with the NIC. -
PublicIpAccountId
: The account ID of the owner of the public IP. -
PublicIpId
: The allocation ID of the public IP.
-
-
MacAddress
: The Media Access Control (MAC) address of the NIC. -
NetId
: The ID of the Net for the NIC. -
NicId
: The ID of the NIC. -
PrivateDnsName
: The name of the private DNS. -
PrivateIps
: The private IPs of the NIC.-
IsPrimary
: If true, the IP is the primary private IP of the NIC. -
LinkPublicIp
: Information about the public IP association.-
LinkPublicIpId
: (Required in a Net) The ID representing the association of the public IP with the VM or the NIC. -
PublicDnsName
: The name of the public DNS. -
PublicIp
: The public IP associated with the NIC. -
PublicIpAccountId
: The account ID of the owner of the public IP. -
PublicIpId
: The allocation ID of the public IP.
-
-
PrivateDnsName
: The name of the private DNS. -
PrivateIp
: The private IP of the NIC.
-
-
SecurityGroups
: One or more IDs of security groups for the NIC.-
SecurityGroupId
: The ID of the security group. -
SecurityGroupName
: The name of the security group.
-
-
State
: The state of the NIC (available
|attaching
|in-use
|detaching
). -
SubnetId
: The ID of the Subnet. -
SubregionName
: The Subregion in which the NIC is located. -
Tags
: One or more tags associated with the NIC.-
Key
: The key of the tag, with a minimum of 1 character. -
Value
: The value of the tag, between 0 and 255 characters.
-
-
-
ResponseContext
: Information about the context of the response.-
RequestId
: The ID of the request.
-
{
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
},
"Nic": {
"SubregionName": "eu-west-2a",
"SubnetId": "subnet-12345678",
"State": "in-use",
"LinkNic": {
"VmId": "i-12345678",
"LinkNicId": "eni-attach-12345678",
"VmAccountId": "123456789012",
"DeleteOnVmDeletion": false,
"DeviceNumber": 0,
"State": "attached"
},
"IsSourceDestChecked": true,
"PrivateDnsName": "ip-10-0-0-4.eu-west-2.compute.internal",
"Tags": [],
"Description": "Primary network interface",
"AccountId": "123456789012",
"SecurityGroups": [
{
"SecurityGroupName": "default",
"SecurityGroupId": "sg-12345678"
}
],
"MacAddress": "A1:B2:C3:D4:E5:F6",
"NetId": "vpc-12345678",
"NicId": "eni-12345678",
"PrivateIps": [
{
"PrivateDnsName": "ip-10-0-0-4.eu-west-2.compute.internal",
"PrivateIp": "10.0.0.4",
"IsPrimary": true
}
]
}
}
{
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
},
"Nic": {
"SubregionName": "eu-west-2a",
"SubnetId": "subnet-12345678",
"State": "in-use",
"LinkNic": {
"VmId": "i-12345678",
"LinkNicId": "eni-attach-12345678",
"VmAccountId": "123456789012",
"DeleteOnVmDeletion": true,
"DeviceNumber": 0,
"State": "attached"
},
"IsSourceDestChecked": true,
"PrivateDnsName": "ip-10-0-0-4.eu-west-2.compute.internal",
"Tags": [],
"Description": "Primary network interface",
"AccountId": "123456789012",
"SecurityGroups": [
{
"SecurityGroupName": "security-group-example",
"SecurityGroupId": "sg-12345678"
}
],
"MacAddress": "A1:B2:C3:D4:E5:F6",
"NetId": "vpc-12345678",
"NicId": "eni-12345678",
"PrivateIps": [
{
"PrivateDnsName": "ip-10-0-0-4.eu-west-2.compute.internal",
"PrivateIp": "10.0.0.4",
"IsPrimary": true
}
]
}
}
{
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
},
"Nic": {
"SubregionName": "eu-west-2a",
"SubnetId": "subnet-12345678",
"State": "in-use",
"LinkNic": {
"VmId": "i-12345678",
"LinkNicId": "eni-attach-12345678",
"VmAccountId": "123456789012",
"DeleteOnVmDeletion": true,
"DeviceNumber": 0,
"State": "attached"
},
"IsSourceDestChecked": true,
"PrivateDnsName": "ip-10-0-0-4.eu-west-2.compute.internal",
"Tags": [],
"Description": "Example of description",
"AccountId": "123456789012",
"SecurityGroups": [
{
"SecurityGroupName": "default",
"SecurityGroupId": "sg-12345678"
}
],
"MacAddress": "A1:B2:C3:D4:E5:F6",
"NetId": "vpc-12345678",
"NicId": "eni-12345678",
"PrivateIps": [
{
"PrivateDnsName": "ip-10-0-0-4.eu-west-2.compute.internal",
"PrivateIp": "10.0.0.4",
"IsPrimary": true
}
]
}
}
Modifying an FNI Attribute Using AWS CLI
Before you begin: Install and configure AWS CLI. For more information, see Installing and Configuring AWS CLI. |
To modify an attribute of the network interface, use the modify-network-interface-attribute command following this syntax:
$ aws ec2 modify-network-interface-attribute \
--profile YOUR_PROFILE \
--network-interface-id eni-12345678 \
--description NOT_SPECIFIED \
--groups NOT_SPECIFIED \
--attachment "AttachmentId=eni-attach-12345678,DeleteOnTermination=false" \
--endpoint https://fcu.eu-west-2.outscale.com
This command contains the following attributes that you need to specify:
-
(optional)
profile
: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI. -
network-interface-id
: The ID of the FNI. -
(optional)
description
: A new description for the FNI. -
(optional)
groups
: One or more IDs of security groups to associate with the FNI.The FNI must be associated with at least one security group.
-
(optional)
attachment
: A new configuration for the attachment. This attribute contains the following elements that you need to specify:-
AttachmentId
: The ID of the FNI attachment. For more information about how to retrieve it, see Getting Information About Your NICs. -
DeleteOnTermination
: By default or if set tofalse
, the FNI is detached from the instance when the instance is terminated. Iftrue
, the FNI is deleted.
-
-
endpoint
: The endpoint corresponding to the Region you want to send the request to. For more information, see Installing and Configuring AWS CLI.
The specified attribute of the FNI is modified.
Related Pages
Corresponding API Methods
AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.