{"id":2174,"date":"2013-07-07T14:04:44","date_gmt":"2013-07-07T06:04:44","guid":{"rendered":"http:\/\/rmohan.com\/?p=2174"},"modified":"2013-07-07T14:10:03","modified_gmt":"2013-07-07T06:10:03","slug":"assign-virtual-ips-to-your-nic","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=2174","title":{"rendered":"Assign Virtual IPs to your NIC"},"content":{"rendered":"<p><strong>Edit file \/etc\/sysconfig\/network-scripts\/ifcfg-eth0. <\/strong><\/p>\n<pre>DEVICE=eth0<\/pre>\n<p>BOOTPROTO=static<\/p>\n<p>BROADCAST=192.168.0.255<\/p>\n<p>HWADDR=00:00:00:00:00:00<\/p>\n<p>IPADDR=192.168.10.2<\/p>\n<p>NETMASK=255.255.255.0<\/p>\n<p>NETWORK=192.168.10.0<\/p>\n<p>ONBOOT=yes<\/p>\n<p>TYPE=Ethernet<\/p>\n<p>GATEWAY=192.168.10.1<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Make a copy of this in the same directory naming the new file\u00a0ifcfg-eth0:1<\/strong><\/p>\n<p># cp ifcfg-eth0 ifcfg-eth0\\:1<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Modify \/etc\/sysconfig\/network-scripts\/ifcfg-eth0:1 file. Modification are in bold<\/strong><\/p>\n<p>DEVICE=<strong>eth0:1<\/strong><\/p>\n<p>BOOTPROTO=static<\/p>\n<p>BROADCAST=192.168.0.255<\/p>\n<p>HWADDR=00:00:00:00:00:00<\/p>\n<p>IPADDR=<strong>192.168.10.101<\/strong><\/p>\n<p>NETMASK=255.255.255.0<\/p>\n<p>NETWORK=192.168.10.0<\/p>\n<p>ONBOOT=yes<\/p>\n<p>TYPE=Ethernet<\/p>\n<p>GATEWAY=192.168.10.1<\/p>\n<pre><\/pre>\n<p># cp ifcfg-eth0\\:1 \/etc\/sysconfig\/networking\/devices\/<\/p>\n<p># cp ifcfg-eth0\\:1 \/etc\/sysconfig\/networking\/profiles\/default\/<\/p>\n<p>&nbsp;<\/p>\n<p>Now, bring up the new interface using the\u00a0<strong>ifup<\/strong>\u00a0script:<\/p>\n<p># ifup eth0\\:1<\/p>\n<p>Running\u00a0<strong>ifconfig<\/strong>, the new interface should be listed. You can also check it by pinging:<\/p>\n<p># ping 192.168.10.101<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Edit file \/etc\/sysconfig\/network-scripts\/ifcfg-eth0. <\/p>\n<p> DEVICE=eth0 <\/p>\n<p>BOOTPROTO=static<\/p>\n<p>BROADCAST=192.168.0.255<\/p>\n<p>HWADDR=00:00:00:00:00:00<\/p>\n<p>IPADDR=192.168.10.2<\/p>\n<p>NETMASK=255.255.255.0<\/p>\n<p>NETWORK=192.168.10.0<\/p>\n<p>ONBOOT=yes<\/p>\n<p>TYPE=Ethernet<\/p>\n<p>GATEWAY=192.168.10.1<\/p>\n<p>&nbsp;<\/p>\n<p>Make a copy of this in the same directory naming the new file ifcfg-eth0:1<\/p>\n<p># cp ifcfg-eth0 ifcfg-eth0\\:1<\/p>\n<p>&nbsp;<\/p>\n<p>Modify \/etc\/sysconfig\/network-scripts\/ifcfg-eth0:1 file. Modification are in bold<\/p>\n<p>DEVICE=eth0:1<\/p>\n<p>BOOTPROTO=static<\/p>\n<p>BROADCAST=192.168.0.255<\/p>\n<p>HWADDR=00:00:00:00:00:00<\/p>\n<p>IPADDR=192.168.10.101<\/p>\n<p>NETMASK=255.255.255.0<\/p>\n<p>NETWORK=192.168.10.0<\/p>\n<p>ONBOOT=yes<\/p>\n<p>TYPE=Ethernet<\/p>\n<p>GATEWAY=192.168.10.1<\/p>\n<p># cp ifcfg-eth0\\:1 \/etc\/sysconfig\/networking\/devices\/<\/p>\n<p> [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/2174"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2174"}],"version-history":[{"count":4,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/2174\/revisions"}],"predecessor-version":[{"id":2176,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/2174\/revisions\/2176"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2174"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2174"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2174"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}