{"id":7219,"date":"2018-08-09T13:54:59","date_gmt":"2018-08-09T11:54:59","guid":{"rendered":"https:\/\/blog.unelink.es\/?p=7219"},"modified":"2019-11-22T11:40:29","modified_gmt":"2019-11-22T10:40:29","slug":"multiples-ips-en-una-misma-interfaz-de-red","status":"publish","type":"post","link":"https:\/\/hosting.airetech.es\/blog\/wiki\/multiples-ips-en-una-misma-interfaz-de-red\/","title":{"rendered":"M\u00faltiples IPs en una misma interfaz de red"},"content":{"rendered":"<p>En este manual te explicamos c\u00f3mo <strong>tener m\u00e1s de una IP funcionando en una misma tarjeta de red<\/strong>. El siguiente ejemplo est\u00e1 realizado en un <a href=\"https:\/\/www.unelink.es\/servidores-dedicados-32.html\" target=\"_blank\" rel=\"noopener noreferrer\">servidor<\/a> con CentOS 7 instalado, por lo que algunas rutas o comandos pueden ser distintos a otras distribuciones como Ubuntu o Debian.<\/p>\n<p>Primero dir\u00edjete a la ruta donde se encuentran los <strong>archivos de configuraci\u00f3n de red<\/strong>:<\/p>\n<pre>cd \/etc\/sysconfig\/network-scripts<\/pre>\n<p>Para tener m\u00faltiples IPs en una misma interfaz de red lo que tienes que hacer es <strong>copiar el fichero ifcfg-eth0 tantas veces como IPs quieras tener<\/strong>. El nuevo fichero tendr\u00e1 la siguiente forma:<\/p>\n<pre>ifcfg-eth0:X<\/pre>\n<p>D\u00f3nde \"x\" ser\u00e1 la \"subinterfaz\" o IP adicional. Ejemplos:<\/p>\n<pre>ifcfg-eth0:1\r\nifcfg-eth0:2\r\nifcfg-eth0:3<\/pre>\n<div id=\"attachment_7220\" style=\"width: 660px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/08\/1.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-7220\" class=\"wp-image-7220 \" title=\"Configuraci\u00f3n de m\u00faltiples IPs\" src=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/08\/1.jpg\" alt=\"Configuraci\u00f3n de m\u00faltiples IPs\" width=\"650\" height=\"403\" srcset=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/08\/1.jpg 666w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/08\/1-300x186.jpg 300w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/08\/1-600x372.jpg 600w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><\/a><p id=\"caption-attachment-7220\" class=\"wp-caption-text\">Configuraci\u00f3n de m\u00faltiples IPs<\/p><\/div>\n<p>Como ves en la imagen anterior, hemos accedido al directorio donde se encuentran los archivos de configuraci\u00f3n y hemos copiado el archivo ifcfg-eth0 al nuevo fichero llamado ifcfg-eth0:4 con el comando <strong>cp.<\/strong><\/p>\n<p>En el nuevo archivo de configuraci\u00f3n tienes que <strong>cambiar los par\u00e1metros<\/strong> \"DEVICE\" y \"IPADDR\". El primero sirve para darle nombre a la nueva interfaz, en este caso ser\u00e1 eth0:4. En IPADDR tienes que poner la nueva IP.<\/p>\n<div id=\"attachment_7225\" style=\"width: 661px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/08\/2.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-7225\" class=\"wp-image-7225\" src=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/08\/2.jpg\" alt=\"Archivo configuraci\u00f3n\" width=\"651\" height=\"172\" srcset=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/08\/2.jpg 665w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/08\/2-300x79.jpg 300w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/08\/2-600x159.jpg 600w\" sizes=\"auto, (max-width: 651px) 100vw, 651px\" \/><\/a><p id=\"caption-attachment-7225\" class=\"wp-caption-text\">Archivo configuraci\u00f3n<\/p><\/div>\n<p>Por \u00faltimo, para que se reflejen los cambios en la red, tienes que <strong>reiniciarla<\/strong> con el siguiente comando:<\/p>\n<pre>systemctl restart network<\/pre>\n<p>Al hacerlo, si todo est\u00e1 bien, ver\u00e1s las nuevas interfaces creadas, como en este ejemplo:<\/p>\n<div id=\"attachment_7226\" style=\"width: 676px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/08\/3.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-7226\" class=\"wp-image-7226 size-full\" title=\"Red\" src=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/08\/3.jpg\" alt=\"Red\" width=\"666\" height=\"413\" srcset=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/08\/3.jpg 666w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/08\/3-300x186.jpg 300w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2018\/08\/3-600x372.jpg 600w\" sizes=\"auto, (max-width: 666px) 100vw, 666px\" \/><\/a><p id=\"caption-attachment-7226\" class=\"wp-caption-text\">Red<\/p><\/div>\n<p>Para ver el listado anterior utiliza el comando:<\/p>\n<pre>ip address show<\/pre>\n<p>Esperamos que os sea de ayuda.<\/p>\n","protected":false},"excerpt":{"rendered":"En este manual te explicamos c\u00f3mo tener m\u00e1s de una IP funcionando en una misma tarjeta de red. El siguiente ejemplo est\u00e1 realizado en un servidor con CentOS 7 instalado, por lo que algunas rutas o comandos pueden ser distintos a otras distribuciones como Ubuntu o Debian. Primero dir\u00edjete a la ruta donde se encuentran los archivos de configuraci\u00f3n de&nbsp;<a href=\"https:\/\/hosting.airetech.es\/blog\/wiki\/multiples-ips-en-una-misma-interfaz-de-red\/\" class=\"read-more\">Seguir leyendo<\/a>","protected":false},"author":1,"featured_media":7220,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[10,7,8,515,507,6],"tags":[216,213,214],"class_list":["post-7219","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-servidores-dedicados","category-servidores-virtuales-vps","category-ssh-servidores-virtuales-vps","category-ssh-servidores-dedicados","category-wiki","tag-linux","tag-servidores-dedicados","tag-servidores-virtuales-vps","cat-10-id","cat-7-id","cat-8-id","cat-515-id","cat-507-id","cat-6-id"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts\/7219","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/comments?post=7219"}],"version-history":[{"count":4,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts\/7219\/revisions"}],"predecessor-version":[{"id":9058,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts\/7219\/revisions\/9058"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/media\/7220"}],"wp:attachment":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/media?parent=7219"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/categories?post=7219"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/tags?post=7219"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}