loading

Assign a Floating/additional IP to Your VPS/Server via SSH

Updated at
04/12/2023
Views
3975

Introduction: An Additional/Floating IP is a crucial component for ensuring high availability and failover for your server. In this guide, we'll walk you through the steps to assign a Floating IP to your server via SSH.

Prerequisites: Before you begin, ensure you have:

  1. Access to your server via SSH.
  2. An Additional/Floating IP address ready to be assigned.

Steps to assign an Additional/Floating IP via SSH:

Step 1: Access the Server via SSH, connect to your server via SSH using your preferred SSH client. Replace your-server-ip with your server's IP address. You can Also access via Putty, check this article from here.

ssh your-username@your-server-ip

Step 2: Create and Edit the Configuration File, Create a configuration file for the Additional/Floating IP. In this example, we'll use "60-addtioanl-ip.yaml," but you can choose any name you prefer.

nano /etc/netplan/60-addtioanl-ip.yaml

Step 3: Configure the Additional/Floating IP, Paste the following configuration into the editor. Replace your.addtioanl.ing.ip with your actual Additional/Floating IP address.

For IPv4:

    network:
        version: 2
        renderer: networkd
        ethernets:
            eth0:
                addresses:
                - your.addtioanl.ing.ip/32

For IPv6:

    network:
        version: 2
        renderer: networkd
        ethernets:
            eth0:
                addresses:
                - your.addtioanl.ing.ip/64

Step 4: Restart the Network, Caution: Restarting the network will briefly reset your network connection. Proceed with this step when you can afford a brief interruption.

sudo netplan apply

Conclusion: By following these steps, you've successfully assigned an Additional/Floating IP to your server via SSH. This provides flexibility and redundancy to your server configuration, ensuring it remains accessible even in case of hardware failures or planned maintenance.

YottaSrc footer

why choose us?

Better Pricing, Fast SSD Storage and Real 24/7
Technical Support.

control panel icon
cPanel

Managing Your Site Through CPanel With The Latest Version

security icon
FAST, RELIABLE & SECURE

99.8% Uptime Guarantee.
So Focus On Your Work!

support icon
24/7/365 Support

Day or night, rain or shine,
our team is here for you!

cloud backup icon
Daily Backup

Daily & Weekly Backup.
Your Files Are Safe!