{"id":2115,"date":"2016-06-28T16:34:08","date_gmt":"2016-06-28T20:34:08","guid":{"rendered":"https:\/\/www.globo.tech\/learning-center\/?p=2115"},"modified":"2017-12-12T15:57:34","modified_gmt":"2017-12-12T20:57:34","slug":"bind-multiple-ip-centos-7-linux-server","status":"publish","type":"post","link":"https:\/\/www.globo.tech\/learning-center\/bind-multiple-ip-centos-7-linux-server\/","title":{"rendered":"How to Bind Multiple IP Addresses on a CentOS 7 Linux Server"},"content":{"rendered":"<h1>How to Bind Multiple IP Addresses on a CentOS 7 Linux Server<\/h1>\n<p>Many complex network setups require that multiple IP addresses be bound to a single server. This might happen if you have presences on both public and private networks, or need to support multiple servers that expect to bind the same port. It is also useful to secure services by binding them on private IPs, or by creating firewall rules that keep traffic quarantined. Here is how you would go about assigning multiple IP addresses to your CentOS 7 server.<\/p>\n<h2>Getting Started<\/h2>\n<p>To complete this guide, you will need the following:<br \/>\n\u2022 1 Node (<a href=\"https:\/\/www.globo.tech\/cloud-server-pricing\" target=\"_blank\">Cloud Server<\/a> or <a href=\"http:\/\/www.globo.tech\/dedicated-server-hosting\" target=\"_blank\">Dedicated Server<\/a>) with CentOS 7. <\/p>\n<p><H2>Tutorial<\/H2><\/p>\n<p>In this guide, we&#8217;ll be working with a network with this configuration:<br \/>\n<code class=\"gris\">\u2022\tNetwork CIDR:: 192.168.0.1\/29<br \/>\n\u2022\tFirst usable IP: 192.168.0.3<br \/>\n\u2022\tLast usable IP: 192.168.0.7<br \/>\n\u2022\tGateway: 192.168.0.2<br \/>\n\u2022\tNetmask: 255.255.255.248<\/code><\/p>\n<p>With those basic specifications established, let&#8217;s set up your server to respond accordingly.<\/p>\n<p>We start by configuring the eth0 interface. This is done by editing the interface script.<\/p>\n<p><code>nano \/etc\/sysconfig\/network-scripts\/ifcfg-eth0<\/code><\/p>\n<p>Insert this block of text:<\/p>\n<p><code class=\"gris\">DEVICE=\"eth0\"<br \/>\nBOOTPROTO=\"static\"<br \/>\nDNS1=\"8.8.8.8\"<br \/>\nDNS2=\"8.8.4.4\"<br \/>\nGATEWAY=\"192.168.0.2\"<br \/>\nIPADDR=\"192.168.0.3\"<br \/>\nIPV6INIT=\"no\"<br \/>\nNETMASK=\"255.255.255.248\"<br \/>\nONBOOT=\"yes\"<br \/>\nTYPE=\"Ethernet\"<\/code><\/p>\n<p>We&#8217;ll now need another configuration file for the other IP.<\/p>\n<p><code>nano \/etc\/sysconfig\/network-scripts\/ifcfg-eth0-range0<\/code><\/p>\n<p><code class=\"gris\">IPADDR_START=192.168.0.4<br \/>\nIPADDR_END=192.168.0.7<br \/>\nCLONENUM_START=0<br \/>\nNETMASK=255.255.255.248<\/code><\/p>\n<p><code>service network restart<\/code><\/p>\n<p>With the above configuration in place, your server should now respond to all of the IPs specified in this example. Traffic will route out through the configured gateway. You can now set up arbitrary servers bound to the IPs on your newly-created network.<\/p>\n<p>Because each server is on its own IP, they can also bind the same ports. You could, for instance, have two separate Apache instances configured distinctly, each answering port 80 on any of the IPs you&#8217;ve just created.<\/p>\n<p><H2>Conclusion<\/H2><\/p>\n<p>While this example was quite simplistic, the basic principles are the same regardless of complexity. If you can understand the above, it is simple to scale the configuration up to arbitrarily complex networks, each with separate gateways, and to allocate ranges of IP addresses separately to programs and services on the same CentOS server. If this guide was helpful to you, kindly share it with others who may also be interested. <\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>How to Bind Multiple IP Addresses on a CentOS 7 Linux Server Many complex network setups require that multiple IP addresses be bound to a single server. This might happen if you have presences on both public and private networks, or need to support multiple servers that expect to bind the same port. It is<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[74],"tags":[],"class_list":["post-2115","post","type-post","status-publish","format-standard","hentry","category-networking","operating_system-centos-7"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Bind Multiple IP Addresses on a CentOS 7 Linux Server - Globo.Tech<\/title>\n<meta name=\"description\" content=\"This tutorial will show you how to bind multiple IP adresses on your CentOS 7 Linux Server. Read now to learn how it could help you!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.globo.tech\/learning-center\/bind-multiple-ip-centos-7-linux-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Bind Multiple IP Addresses on a CentOS 7 Linux Server - Globo.Tech\" \/>\n<meta property=\"og:description\" content=\"This tutorial will show you how to bind multiple IP adresses on your CentOS 7 Linux Server. Read now to learn how it could help you!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.globo.tech\/learning-center\/bind-multiple-ip-centos-7-linux-server\/\" \/>\n<meta property=\"og:site_name\" content=\"Globo.Tech\" \/>\n<meta property=\"article:published_time\" content=\"2016-06-28T20:34:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-12-12T20:57:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/09\/GloboTech-Logo.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"963\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"GloboTech Communications\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"GloboTech Communications\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/bind-multiple-ip-centos-7-linux-server\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/bind-multiple-ip-centos-7-linux-server\\\/\"},\"author\":{\"name\":\"GloboTech Communications\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#\\\/schema\\\/person\\\/e17784b37f4a4f49b7bc611847912e87\"},\"headline\":\"How to Bind Multiple IP Addresses on a CentOS 7 Linux Server\",\"datePublished\":\"2016-06-28T20:34:08+00:00\",\"dateModified\":\"2017-12-12T20:57:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/bind-multiple-ip-centos-7-linux-server\\\/\"},\"wordCount\":331,\"commentCount\":0,\"articleSection\":[\"Networking\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/bind-multiple-ip-centos-7-linux-server\\\/\",\"url\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/bind-multiple-ip-centos-7-linux-server\\\/\",\"name\":\"How to Bind Multiple IP Addresses on a CentOS 7 Linux Server - Globo.Tech\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#website\"},\"datePublished\":\"2016-06-28T20:34:08+00:00\",\"dateModified\":\"2017-12-12T20:57:34+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#\\\/schema\\\/person\\\/e17784b37f4a4f49b7bc611847912e87\"},\"description\":\"This tutorial will show you how to bind multiple IP adresses on your CentOS 7 Linux Server. Read now to learn how it could help you!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/bind-multiple-ip-centos-7-linux-server\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/bind-multiple-ip-centos-7-linux-server\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/bind-multiple-ip-centos-7-linux-server\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Bind Multiple IP Addresses on a CentOS 7 Linux Server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#website\",\"url\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/\",\"name\":\"Globo.Tech\",\"description\":\"Welcome to the Official Globo.Tech Learning Center\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.globo.tech\\\/learning-center\\\/#\\\/schema\\\/person\\\/e17784b37f4a4f49b7bc611847912e87\",\"name\":\"GloboTech Communications\",\"sameAs\":[\"http:\\\/\\\/www.gtcomm.net\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Bind Multiple IP Addresses on a CentOS 7 Linux Server - Globo.Tech","description":"This tutorial will show you how to bind multiple IP adresses on your CentOS 7 Linux Server. Read now to learn how it could help you!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.globo.tech\/learning-center\/bind-multiple-ip-centos-7-linux-server\/","og_locale":"en_US","og_type":"article","og_title":"How to Bind Multiple IP Addresses on a CentOS 7 Linux Server - Globo.Tech","og_description":"This tutorial will show you how to bind multiple IP adresses on your CentOS 7 Linux Server. Read now to learn how it could help you!","og_url":"https:\/\/www.globo.tech\/learning-center\/bind-multiple-ip-centos-7-linux-server\/","og_site_name":"Globo.Tech","article_published_time":"2016-06-28T20:34:08+00:00","article_modified_time":"2017-12-12T20:57:34+00:00","og_image":[{"width":1920,"height":963,"url":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2016\/09\/GloboTech-Logo.png","type":"image\/png"}],"author":"GloboTech Communications","twitter_misc":{"Written by":"GloboTech Communications","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.globo.tech\/learning-center\/bind-multiple-ip-centos-7-linux-server\/#article","isPartOf":{"@id":"https:\/\/www.globo.tech\/learning-center\/bind-multiple-ip-centos-7-linux-server\/"},"author":{"name":"GloboTech Communications","@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87"},"headline":"How to Bind Multiple IP Addresses on a CentOS 7 Linux Server","datePublished":"2016-06-28T20:34:08+00:00","dateModified":"2017-12-12T20:57:34+00:00","mainEntityOfPage":{"@id":"https:\/\/www.globo.tech\/learning-center\/bind-multiple-ip-centos-7-linux-server\/"},"wordCount":331,"commentCount":0,"articleSection":["Networking"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.globo.tech\/learning-center\/bind-multiple-ip-centos-7-linux-server\/","url":"https:\/\/www.globo.tech\/learning-center\/bind-multiple-ip-centos-7-linux-server\/","name":"How to Bind Multiple IP Addresses on a CentOS 7 Linux Server - Globo.Tech","isPartOf":{"@id":"https:\/\/www.globo.tech\/learning-center\/#website"},"datePublished":"2016-06-28T20:34:08+00:00","dateModified":"2017-12-12T20:57:34+00:00","author":{"@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87"},"description":"This tutorial will show you how to bind multiple IP adresses on your CentOS 7 Linux Server. Read now to learn how it could help you!","breadcrumb":{"@id":"https:\/\/www.globo.tech\/learning-center\/bind-multiple-ip-centos-7-linux-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.globo.tech\/learning-center\/bind-multiple-ip-centos-7-linux-server\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.globo.tech\/learning-center\/bind-multiple-ip-centos-7-linux-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.globo.tech\/learning-center\/"},{"@type":"ListItem","position":2,"name":"How to Bind Multiple IP Addresses on a CentOS 7 Linux Server"}]},{"@type":"WebSite","@id":"https:\/\/www.globo.tech\/learning-center\/#website","url":"https:\/\/www.globo.tech\/learning-center\/","name":"Globo.Tech","description":"Welcome to the Official Globo.Tech Learning Center","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87","name":"GloboTech Communications","sameAs":["http:\/\/www.gtcomm.net"]}]}},"_links":{"self":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/2115","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/comments?post=2115"}],"version-history":[{"count":7,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/2115\/revisions"}],"predecessor-version":[{"id":4006,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/2115\/revisions\/4006"}],"wp:attachment":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/media?parent=2115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/categories?post=2115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/tags?post=2115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}