{"id":16549,"date":"2023-10-19T12:55:24","date_gmt":"2023-10-19T12:55:24","guid":{"rendered":"https:\/\/cloudpap.com\/?post_type=docs&#038;p=16549"},"modified":"2023-10-19T12:55:26","modified_gmt":"2023-10-19T12:55:26","password":"","slug":"how-to-configure-an-additional-ip-on-a-centos-7-cloudpap-vm","status":"publish","type":"docs","link":"https:\/\/cloudpap.com\/blog\/docs\/how-to-configure-an-additional-ip-on-a-centos-7-cloudpap-vm\/","title":{"rendered":"How to Configure an Additional IP on a CentOS 7 Cloudpap VM"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p>In the realm of cloud computing, the need for additional IP addresses on your virtual machine (VM) can arise for various purposes. Whether you want to host multiple websites or improve network segmentation, this article will guide you through the process of configuring an extra IP address on a CentOS 7 Cloudpap VM.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p>Before you start, ensure you have the following:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>A Cloudpap VM running CentOS 7.<\/li>\n\n\n\n<li>SSH access to your VM. We will assume you have root access and your VM IP is 10.10.245.3<\/li>\n\n\n\n<li>An additional IP address, such as 102.212.245.5 (your specific address may differ).<\/li>\n<\/ol>\n\n\n\n<p>Let&#8217;s get started:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Login to your server via SSH<\/li>\n<\/ol>\n\n\n\n<p>Begin by establishing an SSH connection to your VM. Use a terminal application on your local computer to log in.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh root@10.10.245.3<\/code><\/pre>\n\n\n\n<p>You will be prompted to enter your password or provide your SSH key for authentication.<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\">\n<li>Add an extra IP address<\/li>\n<\/ol>\n\n\n\n<p>To add an additional IP address to a CentOS 7 VM, you&#8217;ll need to modify the network configuration. CentOS 7 typically uses the NetworkManager service for this purpose.<\/p>\n\n\n\n<p>Open the network configuration file using a text editor. In this example, we&#8217;ll use <code>vi<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vi \/etc\/sysconfig\/network-scripts\/ifcfg-enp1s0<\/code><\/pre>\n\n\n\n<p>Inside the configuration file, add the following lines:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>IPADDR=102.212.245.5<\/code><\/pre>\n\n\n\n<p>Your final configuration file will look like this<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>DEVICE=enp1s0\nBOOTPROTO=static\nONBOOT=yes\nIPADDR=102.212.245.3\nNETMASK=255.255.255.0\nIPADDR=102.212.245.5<\/code><\/pre>\n\n\n\n<p>Ensure that you replace the values with your specific configuration.<\/p>\n\n\n\n<p>Save your changes and exit the text editor.<\/p>\n\n\n\n<p>Now, you need to restart the network service to apply the changes:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart network<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\">\n<li>Test the additional IP<\/li>\n<\/ol>\n\n\n\n<p>Before using the new IP, verify its functionality by pinging it from an external network or performing other tests.<\/p>\n\n\n\n<p>On your VM, open a terminal and execute the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ping 102.212.245.5<\/code><\/pre>\n\n\n\n<p>If the ping is successful you will get an output as below<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>root@vm-xo:\/etc\/netplan# ping -c 4102.212.246.88\nping: invalid argument: '4102.212.246.88'\nroot@vm-0a790c31:\/etc\/netplan# ping -c 4 102.212.246.88\nPING 102.212.246.88 (102.212.246.88) 56(84) bytes of data.\n64 bytes from 102.212.246.88: icmp_seq=1 ttl=64 time=0.018 ms\n64 bytes from 102.212.246.88: icmp_seq=2 ttl=64 time=0.056 ms\n64 bytes from 102.212.246.88: icmp_seq=3 ttl=64 time=0.069 ms\n64 bytes from 102.212.246.88: icmp_seq=4 ttl=64 time=0.031 ms\n\n--- 102.212.246.88 ping statistics ---\n4 packets transmitted, 4 received, 0% packet loss, time 3058ms\nrtt min\/avg\/max\/mdev = 0.018\/0.043\/0.069\/0.020 ms\n<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In the realm of cloud computing, the need for additional IP addresses on your virtual machine (VM) can arise for various purposes. Whether you want to host multiple websites or improve network segmentation, this article will guide you through the process of configuring an extra IP address on a CentOS 7 Cloudpap VM. Prerequisites&#8230;<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"doc_category":[127],"doc_tag":[],"class_list":["post-16549","docs","type-docs","status-publish","hentry","doc_category-servers"],"year_month":"2026-04","word_count":370,"total_views":"0","reactions":{"happy":"2","normal":"2","sad":"0"},"author_info":{"name":"Wallace","author_nicename":"wallace","author_url":"https:\/\/cloudpap.com\/blog\/author\/wallace\/"},"doc_category_info":[{"term_name":"Servers","term_url":"https:\/\/cloudpap.com\/blog\/docs-category\/servers\/"}],"doc_tag_info":[],"_links":{"self":[{"href":"https:\/\/cloudpap.com\/blog\/wp-json\/wp\/v2\/docs\/16549","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudpap.com\/blog\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/cloudpap.com\/blog\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/cloudpap.com\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudpap.com\/blog\/wp-json\/wp\/v2\/comments?post=16549"}],"version-history":[{"count":0,"href":"https:\/\/cloudpap.com\/blog\/wp-json\/wp\/v2\/docs\/16549\/revisions"}],"wp:attachment":[{"href":"https:\/\/cloudpap.com\/blog\/wp-json\/wp\/v2\/media?parent=16549"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/cloudpap.com\/blog\/wp-json\/wp\/v2\/doc_category?post=16549"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/cloudpap.com\/blog\/wp-json\/wp\/v2\/doc_tag?post=16549"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}