تحميل

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

Updated at
04/12/2023
Views
4079

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

لماذا تختارنا؟

أفضل الأسعار, تخزين SSD سريع و دعم فني
24/7 حقيقي

control panel icon
cPanel

إدارة موقعك من خلال CPanel بأحدث إصدار

security icon
سريع وموثوق وآمن

ضمان وقت تشغيل بنسبة 99.8٪.
لذا ركز على عملك!

support icon
دعم 24/7/365

ليلاً أو نهارًا ، مطر أو شمس ،
فريقنا هنا من أجلك!

cloud backup icon
نسخ احتياطي يومي

نسخ احتياطي يومي وأسبوعي.
ملفاتك آمنة!