{"id":117,"date":"2015-03-26T17:22:57","date_gmt":"2015-03-26T17:22:57","guid":{"rendered":"https:\/\/www.nonamehosts.com\/blog\/?p=117"},"modified":"2015-03-26T17:22:57","modified_gmt":"2015-03-26T17:22:57","slug":"how-to-add-a-second-ip-address-on-linux","status":"publish","type":"post","link":"https:\/\/www.nonamehosts.com\/blog\/tutorials\/how-to-add-a-second-ip-address-on-linux\/","title":{"rendered":"How to add a second IP address on Linux"},"content":{"rendered":"<p>In case you need to add a second IP address on Linux, here&#8217;s a simple manual how to do it.<\/p>\n<p><!--more--><\/p>\n<p>First you need to become root on your system. You can do it either by logging into that account or using the su command. Then change your current directory to the \/etc\/sysconfig\/network-scripts directory with the command:<\/p>\n<pre title=\"Change directory\" class=\"lang:sh decode:true \">cd \/etc\/sysconfig\/network-scripts<\/pre>\n<p>Check for existing network adapters with the command:<\/p>\n<pre class=\"lang:sh decode:true\">ls ifcfg-*<\/pre>\n<p>In most instances, you will see the files ifcfg-eth0 and ifcfg-lo. So to create the new interface, you will copy <em>ifcfg-eth0<\/em> to <em>ifcfg-eth0:0<\/em> with the command:<\/p>\n<pre title=\"Copy\" class=\"lang:sh decode:true \">cp ifcfg-eth0 ifcfg-eth0:0<\/pre>\n<p>Now\u00a0edit <em>icfg-eth0:0<\/em> and change the DEVICE line to be similar to:<\/p>\n<pre title=\"Device\" class=\"lang:sh decode:true\">DEVICE=eth0:0<\/pre>\n<p>and change the IPADDR line to be similiar to:<\/p>\n<pre title=\"IP\" class=\"lang:sh decode:true\">IPADDR=192.168.10.1<\/pre>\n<p>Depending on your distribution, one of these commands will activate the new IP address:<\/p>\n<pre class=\"lang:sh decode:true\">ifconfig eth0:0 up\nifconfig eth0:0 192.168.10.1 up\n\/etc\/init.d\/networking restart\nservice network restart<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In case you need to add a second IP address on Linux, here&#8217;s a simple manual how to do it.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[59,62,112],"class_list":["post-117","post","type-post","status-publish","format-standard","hentry","category-tutorials","tag-interface","tag-ip","tag-second"],"_links":{"self":[{"href":"https:\/\/www.nonamehosts.com\/blog\/wp-json\/wp\/v2\/posts\/117","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nonamehosts.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nonamehosts.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nonamehosts.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nonamehosts.com\/blog\/wp-json\/wp\/v2\/comments?post=117"}],"version-history":[{"count":0,"href":"https:\/\/www.nonamehosts.com\/blog\/wp-json\/wp\/v2\/posts\/117\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.nonamehosts.com\/blog\/wp-json\/wp\/v2\/media?parent=117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nonamehosts.com\/blog\/wp-json\/wp\/v2\/categories?post=117"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nonamehosts.com\/blog\/wp-json\/wp\/v2\/tags?post=117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}