--- title: "Attach a reserved IP to a VM" description: "Give a TIR Virtual Machine a reserved IP, keep its current public IP by converting it to a reserved IP, and detach an IP when you are done with it." content_type: "how-to" product: "tir-vm" platform: "TIR" url: "/tir/tir-vm/how-to/attach-a-reserved-ip-to-a-vm/" topic: ["network"] --- # Attach a reserved IP to a VM Give a TIR Virtual Machine a reserved IP when users, SSH clients, DNS records, or firewall allow lists need an address that stays yours. By default a VM gets a public IP, unless you attach a reserved IP at launch. That default address is a floating IP, marked **Floating**; a reserved IP is marked **Reserved**. A VM's addresses are under **Network & Security** > **Network**. A floating IP can be a different address after you stop and start the VM, although a restart keeps it. A reserved IP is an address you reserve and attach to a VM. ## Before you begin - A VM in your TIR project. See [Create a VM](/tir/tir-vm/how-to/create-a-vm/). - Permission to update VMs in the project. See [TIR Access Control](/tir/tir-iam/). - A reserved IP that the VM's project still holds in the same region, if you want to attach an existing one. To make one, see [Reserve an IP](/tir/tir-reserved-ip/how-to/reserve-an-ip-address/). - Permission to create reserved IPs, if you want to convert a floating IP. A reserved IP has a monthly fee of its own. For prices, see [E2E's pricing page](https://www.e2enetworks.com/pricing). ## Attach a reserved IP when you create the VM On the **Create VM** form, pick the address under **Reserve IP Address** in **Network & Security**. To reserve a new one from the form, select **Click here**. The field attaches a reserved IP when you launch a single VM. When you launch several, attach an address to each VM once it runs. See [Create a VM](/tir/tir-vm/how-to/create-a-vm/) for the rest of the form. ## Attach a reserved IP to a VM that exists 1. In **Manage VMs**, select the VM's name, then go to **Network & Security** > **Network**. 2. Select **Add Reserved IP**. 3. In **Select a reserved IP**, pick an available reserved IP, then select **Attach**. To reserve a new one instead, select **Reserve a new IP**, which needs permission to create reserved IPs. The address joins the VM's public IPs, marked **Reserved**. ## Keep the public IP by converting it To keep the address a VM already has, select **Convert to reserved** on its floating IP. Check the monthly fee, tick "Are you sure you want to proceed?", and select **Convert**. The floating IP is now a reserved IP, so it stays assigned to you and can be attached again even after the VM is stopped or deleted. You can also keep the IP when you delete the VM. If the VM has a public IP and you have permission to create reserved IPs, the **Delete VM** dialog lets you reserve the VM's address before it goes. See [Delete a VM](/tir/tir-vm/how-to/delete-a-vm/). If you leave that box clear when you delete the VM, its floating IP is released. A reserved IP attached to the VM returns to your project's pool. ## Detach an IP Select **Detach** next to the address under **Public IP**. Tick "Are you sure you want to proceed?" and select **Detach**. Two cases need care: - While SSH is on, **Detach** on the VM's only IP becomes available once you attach a reserved IP or a VPC. - When you detach the floating IP and only a VPC address remains, the VM loses its public access, and a new public IP has a monthly fee. ## Sign in on the reserved IP SSH reaches a VM through its public IP, a reserved IP, or a VPC address. The SSH command in **Connection Details** on the **Overview** tab uses the first address the VM has in this order: its public IP, its first reserved IP, its first VPC IP. While the VM still has its floating IP, the command uses that address. To sign in on the reserved IP, run `ssh -i root@`. Replace `` with the path of the private key file that matches a key on the VM, and `` with the reserved address. See [Connect to a VM over SSH](/tir/tir-vm/how-to/connect-to-a-vm-over-ssh/). To give a CPU VM a private address as well, [attach a VPC to the VM](/tir/tir-vm/how-to/attach-a-vpc-to-a-vm/). If a reserved IP will not attach, see [Troubleshooting TIR Virtual Machines](/tir/tir-vm/troubleshooting/tir-vm/#a-reserved-ip-will-not-attach-or-detach-is-greyed-out).