{"id":75,"date":"2010-01-15T11:19:00","date_gmt":"2010-01-15T11:19:00","guid":{"rendered":"http:\/\/zensonic.dk\/?p=75"},"modified":"2017-04-09T10:03:56","modified_gmt":"2017-04-09T10:03:56","slug":"virtual-interfaces-under-linux","status":"publish","type":"post","link":"https:\/\/zensonic.dk\/?p=75","title":{"rendered":"Virtual interfaces under linux."},"content":{"rendered":"<p>As with other operating systems it is possible to bring multiple service ip-addresses online under one physical NIC under linux. This is just at brief howto on doing it.<\/p>\n<h2>ubuntu:<\/h2>\n<pre>sudo vi \/etc\/network\/interfaces<\/pre>\n<pre># The primary network interface\r\nauto eth0\r\niface eth0 inet static\r\n address 192.168.1.2\r\n netmask 255.255.255.0\r\n network 192.168.1.0\r\n broadcast 192.168.1.255\r\n gateway 192.168.1.1<\/pre>\n<pre># The first virtual interface\r\n<\/pre>\n<pre>auto eth0:1\r\niface eth0:1 inet static\r\n\u00c2\u00a0address 192.168.1.100\r\n\u00c2\u00a0netmask 255.255.255.0\r\n\u00c2\u00a0broadcast 192.168.1.255\r\n gateway 192.168.1.1\r\n<\/pre>\n<p>After you have edited that file, issue<\/p>\n<pre>sudo \/etc\/init.d\/networking restart\r\n<\/pre>\n<h2>RHEL (Redhat)\/Centos:<\/h2>\n<pre>cd \/etc\/sysconfig\/network-scripts\r\n sudo cp ifcfg-eth0 ifcfg-eth0:0\r\n sudo vi ifcfg-eth0:0\r\n\r\n cat ifcfg-eth0:0\r\n\r\n &gt; DEVICE=eth0:0\r\n &gt; BOOTPROTO=none\r\n &gt; IPADDR=192.168.1.100\r\n &gt;\u00c2\u00a0 NETMASK=255.255.255.0\r\n &gt; GATEWAY=192.168.100\r\n &gt; ONBOOT=yes\r\n<\/pre>\n<p>After that, issue<\/p>\n<pre>sudo service network restart\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>As with other operating systems it is possible to bring multiple service ip-addresses online under one physical NIC under linux. This is just at brief howto on doing it. ubuntu: sudo vi \/etc\/network\/interfaces # The primary network interface auto eth0 iface eth0 inet static address 192.168.1.2 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255 gateway 192.168.1.1 # [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,6,3],"tags":[],"class_list":["post-75","post","type-post","status-publish","format-standard","hentry","category-linux","category-unix","category-work"],"_links":{"self":[{"href":"https:\/\/zensonic.dk\/index.php?rest_route=\/wp\/v2\/posts\/75"}],"collection":[{"href":"https:\/\/zensonic.dk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zensonic.dk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zensonic.dk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/zensonic.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=75"}],"version-history":[{"count":0,"href":"https:\/\/zensonic.dk\/index.php?rest_route=\/wp\/v2\/posts\/75\/revisions"}],"wp:attachment":[{"href":"https:\/\/zensonic.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=75"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zensonic.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=75"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zensonic.dk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=75"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}