{"id":1966,"date":"2024-01-24T00:37:28","date_gmt":"2024-01-23T22:37:28","guid":{"rendered":"https:\/\/upcloud.com\/global\/us\/resources\/tutorials\/configure-floating-ip-almalinux-9\/"},"modified":"2024-01-24T00:37:28","modified_gmt":"2024-01-23T22:37:28","slug":"configure-floating-ip-almalinux-9","status":"publish","type":"tutorial","link":"https:\/\/upcloud.com\/global\/resources\/tutorials\/configure-floating-ip-almalinux-9\/","title":{"rendered":"How to add Floating IP on AlmaLinux 9"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">When you <a href=\"https:\/\/upcloud.com\/global\/resources\/tutorials\/floating-ip-addresses\">attach a new floating IP<\/a>, you can find it listed to one of the servers at your UpCloud Control Panel that the floating IP currently points to. However, using the new floating IP will require some manual setup. Follow the steps below on how to get this done on Cloud Servers running AlmaLinux 9.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As an example, we have a Cloud Server with the public IP address 185.20.139.167 and a floating IP 185.20.139.29 with a netmask 255.255.255.255. These are highlighted below in <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">red<\/mark>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before making changes to your network configuration, it\u2019s always a good idea to <a href=\"https:\/\/upcloud.com\/global\/resources\/tutorials\/taking-backups\">take a backup<\/a>. Also, note that if your network configuration becomes inoperable, remember that you can always log in to your Cloud Server using <a href=\"https:\/\/upcloud.com\/global\/resources\/tutorials\/connecting-to-your-server\">the console connection<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Configuring Floating IP<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Firstly, you\u2019ll need to configure the servers at the OS level. So start up your Cloud Server at your <a href=\"https:\/\/hub.upcloud.com\/\">UpCloud Control Panel<\/a> and <a href=\"https:\/\/upcloud.com\/global\/resources\/tutorials\/connecting-to-your-server\/\">log in<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For AlmaLinux we will use NMCLI to check your current network settings with the following command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">nmcli con show<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">A typical response from the command would look something like the example below.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">NAME         UUID                                  TYPE      DEVICE \nSystem eth0  5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03  ethernet  eth0   \nSystem eth2  3a73717e-65ab-93e8-b518-24f5af32dc0d  ethernet  eth2   \nSystem eth1  9c92fad9-6ecb-3e6c-eb4d-8a47c6f50c04  ethernet  eth1   \neth0         813e7c7a-dfa6-4004-9249-8938da0245a5  ethernet  --<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Since our floating IP address is attached to the <strong>eth0<\/strong> adapter we will want to use the following command to add this to our existing adapter configuration. We can do this with the following command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">nmcli con mod \"System eth0\" +ipv4.addresses \"<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">185.20.139.29<\/mark>\/32\"<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then to apply the changes and re-initialise the adapter we run the command below.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u200bnmcli con up \"System eth0\"<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Reactivating the public network interface should not cause you to disconnect even if you were connected over SSH. In case you do lose connection and are unable to reconnect, you can always use the web <em>Console<\/em> at the <a href=\"https:\/\/hub.upcloud.com\/\">UpCloud Control Panel<\/a> under your <em>Server settings<\/em> to go through the setup again to make sure everything is entered correctly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Repeat the process to add the alias on any other servers you wish to use the floating IP on.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Testing the configuration<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Your configuration is now complete. You can test that it works by transferring the floating IP from one server to another.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First, ping the Cloud Server or attempt to connect to your server through the floating IP via SSH. Alternatively, if you have a web server configured, open the floating IP on your web browser.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then <a href=\"https:\/\/upcloud.com\/global\/resources\/tutorials\/floating-ip-addresses\">transfer the floating IP<\/a> to another Cloud Server you\u2019ve configured. This can be done either at your <a href=\"https:\/\/hub.upcloud.com\/networks\/floating-ips\">UpCloud Control Panel<\/a> or by using the <a href=\"https:\/\/upcloud.com\/global\/resources\/tutorials\/managing-floating-ips-upcloud-api\">UpCloud API<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Test the floating IP again with any method you prefer. When you get a connection you have successfully transferred your floating IP.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When you get a reply, the floating IP works on that server and you can continue. If it didn\u2019t work, make sure you entered the IP address and the command correctly, and that your firewall isn\u2019t blocking your connections, or try another method to connect.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Using your new Floating IP<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You can now transfer the floating IP between your Cloud Servers at your <a href=\"https:\/\/hub.upcloud.com\/networks\/floating-ips\">UpCloud Control Panel<\/a> or by using the <a href=\"https:\/\/upcloud.com\/global\/resources\/tutorials\/managing-floating-ips-upcloud-api\">UpCloud API<\/a>!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Depending on your intended use case for the floating IP you may wish to continue by setting up automated load balancing, but it\u2019s always possible to manually transfer the traffic between your servers.<\/p>\n","protected":false},"author":71,"featured_media":36857,"comment_status":"open","ping_status":"closed","template":"","community-category":[259,247],"class_list":["post-1966","tutorial","type-tutorial","status-publish","has-post-thumbnail","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/tutorial\/1966","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/tutorial"}],"about":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/types\/tutorial"}],"author":[{"embeddable":true,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/users\/71"}],"replies":[{"embeddable":true,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/comments?post=1966"}],"version-history":[{"count":0,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/tutorial\/1966\/revisions"}],"wp:attachment":[{"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/media?parent=1966"}],"wp:term":[{"taxonomy":"community-category","embeddable":true,"href":"https:\/\/upcloud.com\/global\/wp-json\/wp\/v2\/community-category?post=1966"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}