{"id":10322,"date":"2022-12-23T09:15:28","date_gmt":"2022-12-23T09:15:28","guid":{"rendered":"https:\/\/mainvps.net\/blog\/?p=10322"},"modified":"2026-07-07T09:44:22","modified_gmt":"2026-07-07T09:44:22","slug":"how-to-configure-an-ip-range-on-centos-in-linux","status":"publish","type":"post","link":"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/","title":{"rendered":"How to configure an IP range on CentOS 6\/7 OS"},"content":{"rendered":"\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/#A_guide_that_describes_how_to_configure_an_IP_range\" >A guide that describes how to configure an IP range.<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/#Step_1_Check_the_network_interface_and_assign_an_IP\" >Step 1: Check the network interface and assign an IP<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/#Step_2_Go_to_the_path_and_create_a_file\" >Step 2: Go to the path and create a file<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/#Step_3_Now_we_need_to_create_the_IP_range_file\" >Step 3: Now we need to create the IP range file.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/#Step_4_Check_the_create_file\" >Step 4: Check the create file<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/#Step_5_Lets_restart_the_network_service\" >Step 5: Let&#8217;s restart the network service.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/#Step_6_Add_IP_ranges_temporarily\" >Step 6: Add IP ranges temporarily.<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/#Step_7_Verify_the_IP_Range_Configuration\" >Step 7: Verify the IP Range Configuration<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/#Step_8_Test_Network_Connectivity\" >Step 8: Test Network Connectivity<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/#Common_Issues_and_Troubleshooting\" >Common Issues and Troubleshooting<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/#IP_Addresses_Not_Appearing\" >IP Addresses Not Appearing<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/#Network_Service_Fails_to_Restart\" >Network Service Fails to Restart<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/#Duplicate_IP_Address_Conflict\" >Duplicate IP Address Conflict<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/#Best_Practices\" >Best Practices<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/#Conclusion\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/#Frequently_Asked_Questions_FAQs\" >Frequently Asked Questions (FAQs)<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/#1_What_is_an_IP_range_in_CentOS_67\" >1. What is an IP range in CentOS 6\/7?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/#2_Why_would_I_configure_an_IP_range_on_CentOS\" >2. Why would I configure an IP range on CentOS?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/#3_Which_network_interface_should_I_use_for_an_IP_range\" >3. Which network interface should I use for an IP range?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/#4_Where_are_network_configuration_files_stored_in_CentOS_67\" >4. Where are network configuration files stored in CentOS 6\/7?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/#5_How_do_I_verify_that_the_IP_range_has_been_configured_successfully\" >5. How do I verify that the IP range has been configured successfully?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/#6_Can_I_add_multiple_IP_ranges_on_the_same_network_interface\" >6. Can I add multiple IP ranges on the same network interface?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/#7_Are_temporary_IP_addresses_permanent_after_a_reboot\" >7. Are temporary IP addresses permanent after a reboot?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/#8_Why_are_my_additional_IP_addresses_not_working\" >8. Why are my additional IP addresses not working?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/#9_How_do_I_restart_the_network_service_after_configuring_an_IP_range\" >9. How do I restart the network service after configuring an IP range?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-26\" href=\"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/#10_Is_configuring_an_IP_range_on_CentOS_67_safe\" >10. Is configuring an IP range on CentOS 6\/7 safe?<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-27\" href=\"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/#Suggestions\" >Suggestions:<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"A_guide_that_describes_how_to_configure_an_IP_range\"><\/span><strong>A guide that describes how to configure an IP range.<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The following tutorial will describe how to easily configure an IP range on CentOS 6\/7 operating systems.<\/p>\n\n\n\n<h4 class=\"wp-block-heading has-medium-font-size\"><span class=\"ez-toc-section\" id=\"Step_1_Check_the_network_interface_and_assign_an_IP\"><\/span>Step 1: Check the network interface and assign an IP<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><mark style=\"background-color: #ff6900;\" class=\"has-inline-color has-white-color\">&nbsp; #ifconfig &amp; ip a <\/mark><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">By default, all<a href=\"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/\" target=\"_blank\" data-type=\"link\" data-id=\"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/\" rel=\"noreferrer noopener\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\"> Linux <\/mark><\/strong><\/a>servers are provided with one main IP address, as we can see in the screenshot below using the <mark style=\"background-color: #ff6900;\" class=\"has-inline-color has-white-color\">\u201c<em>ip a\u201d <\/em><\/mark>command. Alternatively, you can use the <mark style=\"background-color: #ff6900;\" class=\"has-inline-color has-white-color\">\u201c<em>ifconfig\u201d <\/em><\/mark><em>\u00a0<\/em>command to see the output.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"635\" height=\"291\" src=\"https:\/\/mainvps.net\/blog\/wp-content\/uploads\/2022\/12\/1.png\" alt=\"\" class=\"wp-image-10323\" srcset=\"https:\/\/mainvps.net\/blog\/wp-content\/uploads\/2022\/12\/1.png 635w, https:\/\/mainvps.net\/blog\/wp-content\/uploads\/2022\/12\/1-300x137.png 300w\" sizes=\"auto, (max-width: 635px) 100vw, 635px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The IP range is configured on the main network interface. In this case, it\u2019s called <mark class=\"has-inline-color has-white-color\" style=\"background-color: #ff6900;\"> \u201ceth0\u201d <\/mark>, so we\u2019ll bond the IP range with it.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"642\" height=\"269\" src=\"https:\/\/mainvps.net\/blog\/wp-content\/uploads\/2022\/12\/2-e1671786707524.png\" alt=\"\" class=\"wp-image-10324\" srcset=\"https:\/\/mainvps.net\/blog\/wp-content\/uploads\/2022\/12\/2-e1671786707524.png 642w, https:\/\/mainvps.net\/blog\/wp-content\/uploads\/2022\/12\/2-e1671786707524-300x126.png 300w\" sizes=\"auto, (max-width: 642px) 100vw, 642px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading has-medium-font-size\"><span class=\"ez-toc-section\" id=\"Step_2_Go_to_the_path_and_create_a_file\"><\/span>Step 2: Go to the path and create a file<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><mark class=\"has-inline-color has-white-color\" style=\"background-color: #ff6900;\"> #vi\/etc\/sysconfig\/network-scritps\/ <\/mark><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In Linux, network configuration is located at\u00a0<em><mark style=\"background-color: #ff6900;\" class=\"has-inline-color has-white-color\">\/etc\/sysconfig\/network-scripts\/ <\/mark><\/em> The main network interface configuration file is called <em><mark style=\"background-color: #ff6900;\" class=\"has-inline-color has-white-color\">ifcfg-$NET-ADAPTER-NAME <\/mark><\/em> In this case, it\u2019s\u00a0<em><mark style=\"background-color: #ff6900;\" class=\"has-inline-color has-white-color\">ifcfg-eth0 <\/mark><\/em><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"644\" height=\"213\" src=\"https:\/\/mainvps.net\/blog\/wp-content\/uploads\/2022\/12\/3.png\" alt=\"\" class=\"wp-image-10325\" srcset=\"https:\/\/mainvps.net\/blog\/wp-content\/uploads\/2022\/12\/3.png 644w, https:\/\/mainvps.net\/blog\/wp-content\/uploads\/2022\/12\/3-300x99.png 300w\" sizes=\"auto, (max-width: 644px) 100vw, 644px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading has-medium-font-size\"><span class=\"ez-toc-section\" id=\"Step_3_Now_we_need_to_create_the_IP_range_file\"><\/span>Step 3: Now we need to create the IP range file.<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><mark class=\"has-inline-color has-white-color\" style=\"background-color: #ff6900;\">&nbsp;#vi ifcfg-range0 <\/mark><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To make the process easier, we\u2019ll create an IP range configuration CentOS file. This will allow us to configure multiple IP addresses with little work. Using your preferred text editor like <mark style=\"background-color: #ff6900;\" class=\"has-inline-color has-white-color\">\u201cvi or vim\u201d <\/mark>, in the path <em><mark style=\"background-color: #ff6900;\" class=\"has-inline-color has-white-color\">\/etc\/sysconfig\/network-scripts\u00a0<\/mark><\/em> directory, create a file called\u00a0<em><mark style=\"background-color: #ff6900;\" class=\"has-inline-color has-white-color\">ifcfg-eth0-range0 <\/mark><\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Keypoint\u00a0 &#8211; <\/em>To add the second range, you need to create another file called <mark style=\"background-color: #ff6900;\" class=\"has-inline-color has-white-color\">\u201cifcfg-eth0-range1\u201d <\/mark> with the CLONENUM_START start with 300 (setting up the number in CLONENUM_START is very important here to avoid the ip overwritten<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"595\" height=\"291\" src=\"https:\/\/mainvps.net\/blog\/wp-content\/uploads\/2022\/12\/4.png\" alt=\"\" class=\"wp-image-10326\" srcset=\"https:\/\/mainvps.net\/blog\/wp-content\/uploads\/2022\/12\/4.png 595w, https:\/\/mainvps.net\/blog\/wp-content\/uploads\/2022\/12\/4-300x147.png 300w\" sizes=\"auto, (max-width: 595px) 100vw, 595px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Using that information, let\u2019s configure the IP range file on our operating system:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"436\" height=\"193\" src=\"https:\/\/mainvps.net\/blog\/wp-content\/uploads\/2022\/12\/5.png\" alt=\"\" class=\"wp-image-10327\" style=\"width:648px;height:287px\" srcset=\"https:\/\/mainvps.net\/blog\/wp-content\/uploads\/2022\/12\/5.png 436w, https:\/\/mainvps.net\/blog\/wp-content\/uploads\/2022\/12\/5-300x133.png 300w\" sizes=\"auto, (max-width: 436px) 100vw, 436px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Save the changes and exit the text writer. If you\u2019ve done everything correctly, you\u2019ll see a new network configuration file has appeared in&nbsp;<em><mark class=\"has-inline-color has-white-color\" style=\"background-color: #ff6900;\"> \/etc\/sysconfig\/network-scripts\/ &nbsp;<\/mark><\/em>directory:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_4_Check_the_create_file\"><\/span>Step 4: Check the create file<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><mark class=\"has-inline-color has-white-color\" style=\"background-color: #ff6900;\"> #ls <\/mark><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"644\" height=\"283\" src=\"https:\/\/mainvps.net\/blog\/wp-content\/uploads\/2022\/12\/6.png\" alt=\"\" class=\"wp-image-10328\" srcset=\"https:\/\/mainvps.net\/blog\/wp-content\/uploads\/2022\/12\/6.png 644w, https:\/\/mainvps.net\/blog\/wp-content\/uploads\/2022\/12\/6-300x132.png 300w\" sizes=\"auto, (max-width: 644px) 100vw, 644px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading has-medium-font-size\"><span class=\"ez-toc-section\" id=\"Step_5_Lets_restart_the_network_service\"><\/span><strong>Step 5: Let&#8217;s restart the network service.<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, restart the\u00a0<em>network\u00a0<\/em>service using the command below and check the IP configuration again. The IP range is now fully configured:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><mark class=\"has-inline-color has-white-color\" style=\"background-color: #ff6900;\"> #service network restart <\/mark><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><mark class=\"has-inline-color has-white-color\" style=\"background-color: #ff6900;\"> #systemctl restart NetworkManager<\/mark><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"644\" height=\"389\" src=\"https:\/\/mainvps.net\/blog\/wp-content\/uploads\/2022\/12\/7.png\" alt=\"\" class=\"wp-image-10329\" srcset=\"https:\/\/mainvps.net\/blog\/wp-content\/uploads\/2022\/12\/7.png 644w, https:\/\/mainvps.net\/blog\/wp-content\/uploads\/2022\/12\/7-300x181.png 300w\" sizes=\"auto, (max-width: 644px) 100vw, 644px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading has-medium-font-size\"><span class=\"ez-toc-section\" id=\"Step_6_Add_IP_ranges_temporarily\"><\/span>Step 6: Add IP ranges temporarily.<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><mark class=\"has-inline-color has-white-color\" style=\"background-color: #ff6900;\"> #for i in {3..252}; do ip addr add 213.209.148.$i\/24 dev eth0; done <\/mark><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">KEY POINT &#8211;\u00a0There is also one shortcut available to add multiple IP ranges with the help of the script below. Using this script, configure any range in the main network interface of the server; in my case, the main interface is &#8220;eth0,&#8221; but this configuration is temporary; after the server reboots, it will not be there.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><mark class=\"has-inline-color has-white-color\" style=\"background-color: #ff6900;\"> #for i in {3..252}; do ip addr add 213.209.148.$i\/24 dev eth0; done <\/mark><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_7_Verify_the_IP_Range_Configuration\"><\/span>Step 7: Verify the IP Range Configuration<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">After restarting the network service or adding the IP range temporarily, verify that all IP addresses have been assigned successfully.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Run the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ip addr show eth0<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">or<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ifconfig eth0<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You should see the primary IP address along with the additional IP addresses configured on the <code>eth0<\/code> interface. If the IP range is not displayed, review your configuration files for syntax errors and restart the network service again.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_8_Test_Network_Connectivity\"><\/span>Step 8: Test Network Connectivity<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Once the IP addresses are configured, verify that they are reachable from the network.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can test connectivity using the <code>ping<\/code> command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ping &lt;IP_Address&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ping 213.209.148.3<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can also verify that the server is listening on the configured IP addresses using:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ss -tulnp<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">or<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>netstat -tulnp<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Successful responses indicate that the IP range has been configured correctly.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Common_Issues_and_Troubleshooting\"><\/span>Common Issues and Troubleshooting<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">While configuring an IP range on CentOS 6\/7, you may encounter some common problems.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"IP_Addresses_Not_Appearing\"><\/span>IP Addresses Not Appearing<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If the additional IP addresses do not appear after restarting the network service:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Verify that the configuration file is saved in <code>\/etc\/sysconfig\/network-scripts\/<\/code>.<\/li>\n\n\n\n<li>Check that the filename follows the correct format (for example, <code>ifcfg-eth0-range0<\/code>).<\/li>\n\n\n\n<li>Ensure there are no typing or syntax errors in the configuration file.<\/li>\n\n\n\n<li>Restart the network service.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Network_Service_Fails_to_Restart\"><\/span>Network Service Fails to Restart<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If the network service does not restart successfully:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Review the configuration files for invalid parameters.<\/li>\n\n\n\n<li>Check system logs using:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl -xe<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">or<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl status network<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Correct any reported errors before restarting the service.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Duplicate_IP_Address_Conflict\"><\/span>Duplicate IP Address Conflict<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If another device on the network is already using one of the assigned IP addresses, the server may experience connectivity problems.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Always verify that the IP addresses you assign are available and not already in use on your network.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Best_Practices\"><\/span>Best Practices<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To ensure a stable and reliable CentOS 6 network configuration, follow these recommendations:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Always create a backup of your existing network configuration files before making changes.<\/li>\n\n\n\n<li>Use static IP addresses provided by your hosting provider or network administrator.<\/li>\n\n\n\n<li>Keep your network configuration files well organized and properly documented.<\/li>\n\n\n\n<li>Restart the network service only during a maintenance window on production servers.<\/li>\n\n\n\n<li>Test the configuration after every change to avoid unexpected downtime.<\/li>\n\n\n\n<li>Avoid assigning overlapping IP ranges that may conflict with other devices on the network.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Configuring an IP range on <strong>CentOS 6\/7<\/strong> is a straightforward process when the network configuration files are set up correctly. By creating an IP range configuration file, restarting the network service, and verifying the assigned addresses, you can efficiently manage multiple IP addresses on a single network interface.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Whether you need additional IPs for <a href=\"https:\/\/mainvps.net\/web-hosting\" data-type=\"link\" data-id=\"https:\/\/mainvps.net\/web-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">web hosting<\/mark><\/strong><\/a>, virtualization, mail servers, or other network services, properly configuring IP ranges helps improve flexibility and resource management. Following the troubleshooting tips and best practices outlined in this guide will help ensure a reliable and stable CentOS 7 network configuration on your CentOS server.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Frequently_Asked_Questions_FAQs\"><\/span>Frequently Asked Questions (FAQs)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_What_is_an_IP_range_in_CentOS_67\"><\/span>1. What is an IP range in CentOS 6\/7?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">An IP range is a group of multiple IP addresses assigned to a single network interface. It allows a server to host multiple websites, applications, or services using different IP addresses.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Why_would_I_configure_an_IP_range_on_CentOS\"><\/span>2. Why would I configure an IP range on CentOS?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Configuring an IP range is useful for web hosting, virtualization, email servers, <a href=\"https:\/\/mainvps.net\/blog\/how-to-upgrade-openssl-3-1-in-ubuntu-22-04\/\" target=\"_blank\" data-type=\"post\" data-id=\"11134\" rel=\"noreferrer noopener\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">SSL certificates<\/mark><\/strong><\/a>, and applications that require multiple public or private IP addresses on the same server.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Which_network_interface_should_I_use_for_an_IP_range\"><\/span>3. Which network interface should I use for an IP range?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You should configure the IP range on your primary network interface, such as <code>eth0<\/code> or another active interface identified using the <code>ip a<\/code> or <code>ifconfig<\/code> command.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_Where_are_network_configuration_files_stored_in_CentOS_67\"><\/span>4. Where are network configuration files stored in CentOS 6\/7?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Network configuration files are located in:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/etc\/sysconfig\/network-scripts\/<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The primary interface configuration file is typically named <code>ifcfg-eth0<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"5_How_do_I_verify_that_the_IP_range_has_been_configured_successfully\"><\/span>5. How do I verify that the IP range has been configured successfully?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You can verify the assigned IP addresses by running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ip addr show<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">or<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ifconfig<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">These commands display all IP addresses configured on your network interfaces.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"6_Can_I_add_multiple_IP_ranges_on_the_same_network_interface\"><\/span>6. Can I add multiple IP ranges on the same network interface?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. To add another IP range, create an additional configuration file such as <code>ifcfg-eth0-range1<\/code> and assign a different <code>CLONENUM_START<\/code> Value to prevent IP conflicts.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"7_Are_temporary_IP_addresses_permanent_after_a_reboot\"><\/span>7. Are temporary IP addresses permanent after a reboot?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. IP addresses added using the <code>ip addr add<\/code> command are temporary and will be removed after the server restarts. To make them permanent, configure them in the appropriate network configuration files.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"8_Why_are_my_additional_IP_addresses_not_working\"><\/span>8. Why are my additional IP addresses not working?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This may happen due to incorrect configuration,<a href=\"https:\/\/en.wikipedia.org\/wiki\/Syntax\" target=\"_blank\" data-type=\"link\" data-id=\"https:\/\/en.wikipedia.org\/wiki\/Syntax\" rel=\"noreferrer noopener nofollow\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\"> syntax <\/mark><\/strong><\/a>errors, duplicate Configure Multiple IP addresses CentOS, or failure to restart the network service. Verify your configuration files and restart the network service before testing again.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"9_How_do_I_restart_the_network_service_after_configuring_an_IP_range\"><\/span>9. How do I restart the network service after configuring an IP range?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">On CentOS 6, use:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>service network restart<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">On CentOS 7, you can use:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl restart NetworkManager<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Or restart the network service if applicable.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"10_Is_configuring_an_IP_range_on_CentOS_67_safe\"><\/span>10. Is configuring an IP range on CentOS 6\/7 safe?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes, as long as you use valid<a href=\"https:\/\/en.wikipedia.org\/wiki\/IP_address\" target=\"_blank\" data-type=\"link\" data-id=\"https:\/\/en.wikipedia.org\/wiki\/IP_address\" rel=\"noreferrer noopener nofollow\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\"> IP addresses<\/mark><\/strong><\/a> assigned by your hosting provider or<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\"> <a href=\"https:\/\/mainvps.net\/blog\/restart-the-network-on-centos-stream-9\/\" target=\"_blank\" data-type=\"post\" data-id=\"11102\" rel=\"noreferrer noopener\">network<\/a> <\/mark><\/strong>administrator. Always back up your existing network configuration files before making changes and verify the settings after configuration.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Suggestions\"><\/span>Suggestions:<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"https:\/\/mainvps.net\/blog\/lifetime-web-hosting-2026\/\">https:\/\/mainvps.net\/blog\/lifetime-web-hosting-2026\/<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/mainvps.net\/blog\/windows-reseller-web-hosting\/\">https:\/\/mainvps.net\/blog\/windows-reseller-web-hosting\/<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/mainvps.net\/blog\/best-wordpress-hosting-providers\/\">https:\/\/mainvps.net\/blog\/best-wordpress-hosting-providers\/<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/mainvps.net\/blog\/linux-vps-hosting-india\/\">https:\/\/mainvps.net\/blog\/linux-vps-hosting-india\/<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/mainvps.net\/blog\/low-cost-windows-vps-hosting-in-india\/\">https:\/\/mainvps.net\/blog\/low-cost-windows-vps-hosting-in-india\/<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/mainvps.net\/blog\/cheap-dedicated-server-hosting-providers\/\">https:\/\/mainvps.net\/blog\/cheap-dedicated-server-hosting-providers\/<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/mainvps.net\/blog\/windows-server-guide-dde-dns-tls-1-2-uptime\/\">https:\/\/mainvps.net\/blog\/windows-server-guide-dde-dns-tls-1-2-uptime\/<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/mainvps.net\/blog\/dedicated-server-hosting-netherlands\/\">https:\/\/mainvps.net\/blog\/dedicated-server-hosting-netherlands\/<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/mainvps.net\/blog\/dedicated-server-low-price\/\">https:\/\/mainvps.net\/blog\/dedicated-server-low-price\/<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/mainvps.net\/blog\/vps-hosting-in-los-angeles-us\/\">https:\/\/mainvps.net\/blog\/vps-hosting-in-los-angeles-us\/<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/mainvps.net\/blog\/dedicated-server-in-nedzone-nl\/\">https:\/\/mainvps.net\/blog\/dedicated-server-in-nedzone-nl\/<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/mainvps.net\/blog\/buy-linux-vps-hosting\/\">https:\/\/mainvps.net\/blog\/buy-linux-vps-hosting\/<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/mainvps.net\/blog\/managed-windows-vps-hosting\/\">https:\/\/mainvps.net\/blog\/managed-windows-vps-hosting\/<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/mainvps.net\/blog\/what-is-wmi-provider-host-complete-guide\/\">https:\/\/mainvps.net\/blog\/what-is-wmi-provider-host-complete-guide\/<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/mainvps.net\/blog\/cloud-hosting-vs-vps-2026\/\">https:\/\/mainvps.net\/blog\/cloud-hosting-vs-vps-2026\/<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/mainvps.net\/blog\/vps-hosting-for-ecommerce-guide\/\">https:\/\/mainvps.net\/blog\/vps-hosting-for-ecommerce-guide\/<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/mainvps.net\/blog\/vps-hosting-for-saas-applications\/\">https:\/\/mainvps.net\/blog\/vps-hosting-for-saas-applications\/<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/mainvps.net\/blog\/vps-reseller-hosting-in-netherlands\/\">https:\/\/mainvps.net\/blog\/vps-reseller-hosting-in-netherlands\/<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/mainvps.net\/blog\/dedicated-server-hosting-in-us\/\">https:\/\/mainvps.net\/blog\/dedicated-server-hosting-in-us\/<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/mainvps.net\/blog\/linux-reseller-hosting\/\">https:\/\/mainvps.net\/blog\/linux-reseller-hosting\/<\/a><\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A guide that describes how to configure an IP range. The following tutorial will describe how to easily configure an IP range on CentOS 6\/7 operating <a class=\"read-more-link\" href=\"https:\/\/mainvps.net\/blog\/how-to-configure-an-ip-range-on-centos-in-linux\/\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":10337,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[122],"tags":[],"class_list":["post-10322","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-system-hardware"],"_links":{"self":[{"href":"https:\/\/mainvps.net\/blog\/wp-json\/wp\/v2\/posts\/10322","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mainvps.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mainvps.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mainvps.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mainvps.net\/blog\/wp-json\/wp\/v2\/comments?post=10322"}],"version-history":[{"count":15,"href":"https:\/\/mainvps.net\/blog\/wp-json\/wp\/v2\/posts\/10322\/revisions"}],"predecessor-version":[{"id":13032,"href":"https:\/\/mainvps.net\/blog\/wp-json\/wp\/v2\/posts\/10322\/revisions\/13032"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mainvps.net\/blog\/wp-json\/wp\/v2\/media\/10337"}],"wp:attachment":[{"href":"https:\/\/mainvps.net\/blog\/wp-json\/wp\/v2\/media?parent=10322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mainvps.net\/blog\/wp-json\/wp\/v2\/categories?post=10322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mainvps.net\/blog\/wp-json\/wp\/v2\/tags?post=10322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}