Detaching an Internet Service from a Net
You can detach an internet gateway from a Net to remove its connection to the internet.
This action also removes routes using the internet gateway as target.
Unlinking an Internet Service Using Cockpit v2
Before you begin: Unlink all public IPs that are linked with virtual machines (VMs) running in the Net. For more information, see Unlinking a Public IP from a VM or a Network Interface. |
-
In the Internet Services dashboard, check the box of the internet service you want to unlink from the Net.
The internet service is selected. -
Click Unlink Net.
A confirmation dialog box appears. -
Click Unlink.
The internet service is unlinked from the Net.
Unlinking an Internet Service Using OSC CLI
Before you begin: Unlink all public IPs from your running virtual machines (VMs) in the Net. For more information, see Unlinking a Public IP from a VM or a Network Interface. |
The UnlinkInternetService command detaches an internet service from a Net.
This action disables and detaches an internet service from a Net. The Net must not contain virtual machines (VMs) using public IPs nor internet-facing load balancers.
$ osc-cli api UnlinkInternetService --profile "default" \
--InternetServiceId "igw-12345678" \
--NetId "vpc-12345678"
This command contains the following attributes that you need to specify:
-
DryRun
: (optional) If true, checks whether you have the required permissions to perform the action. -
InternetServiceId
: The ID of the internet service you want to detach. -
NetId
: The ID of the Net from which you want to detach the internet service.
The UnlinkInternetService command returns the following elements:
-
ResponseContext
: Information about the context of the response.-
RequestId
: The ID of the request.
-
{
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
}
}
Unlinking an Internet Service Using oapi-cli
Before you begin: Unlink all public IPs from your running virtual machines (VMs) in the Net. For more information, see Unlinking a Public IP from a VM or a Network Interface. |
The UnlinkInternetService command detaches an internet service from a Net.
This action disables and detaches an internet service from a Net. The Net must not contain virtual machines (VMs) using public IPs nor internet-facing load balancers.
$ oapi-cli --profile "default" UnlinkInternetService \
--InternetServiceId "igw-12345678" \
--NetId "vpc-12345678"
This command contains the following attributes that you need to specify:
-
DryRun
: (optional) If true, checks whether you have the required permissions to perform the action. -
InternetServiceId
: The ID of the internet service you want to detach. -
NetId
: The ID of the Net from which you want to detach the internet service.
The UnlinkInternetService command returns the following elements:
-
ResponseContext
: Information about the context of the response.-
RequestId
: The ID of the request.
-
{
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
}
}
Detaching an Internet Gateway Using AWS CLI
Before you begin:
|
To detach an internet gateway from a VPC, use the detach-internet-gateway command following this syntax:
$ aws ec2 detach-internet-gateway \
--profile YOUR_PROFILE \
--internet-gateway-id igw-12345678 \
--vpc-id vpc-12345678 \
--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. -
internet-gateway-id
: The ID of the internet gateway. -
vpc-id
: The ID of the VPC. -
endpoint
: The endpoint corresponding to the Region you want to send the request to. For more information, see Installing and Configuring AWS CLI.
The internet gateway is detached from the specified VPC.
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.