{"id":870,"date":"2014-10-25T02:21:30","date_gmt":"2014-10-25T02:21:30","guid":{"rendered":"https:\/\/qbytes.cloud\/?p=870"},"modified":"2014-10-25T02:21:30","modified_gmt":"2014-10-25T02:21:30","slug":"add-additional-ips-ubuntu-server","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2014\/10\/25\/add-additional-ips-ubuntu-server\/","title":{"rendered":"Add additional IP&#8217;s to Ubuntu Server"},"content":{"rendered":"<p>Here is how to add additional IP&#8217;s to your Ubuntu server<\/p>\n<p>Add it to the server just on a temporary basis. A reboot will erase the changes.<\/p>\n<p><strong>Using ifconfig<\/strong><\/p>\n<p>If you want to add a secondary IP address to a NIC already in use in Linux, and have that change only temporary. Enter this command:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># ifconfig &#x5B;nic]:0 &#x5B;IP-Address] netmask &#x5B;mask] up\n\n<\/pre>\n<p><strong>Example:<\/strong><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">#ifconfig eth0:0 192.168.1.2 netmask 255.255.255.0 up\n\n<\/pre>\n<p>If you prefer to use the ip command instead of ifconfig<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># ip address add &#x5B;ip]\/&#x5B;mask-digits] dev &#x5B;nic]\n\n<\/pre>\n<p><strong>IP command example<\/strong><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">#ip address add 192.168.99.37\/24 dev eth0\n\n<\/pre>\n<p>With this command you can add more ip address to the same NIC, the second is considered as secondary.<\/p>\n<p><strong>Add a permanent IP address to the Server<\/strong><\/p>\n<p>For Ubuntu systems, edit the \/etc\/network\/interfaces file<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># nano \/etc\/network\/interfaces\n\n<\/pre>\n<p>Example:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\nauto eth0:1\niface eth0:1 inet static\naddress 192.168.0.1\ngateway 192.168.0.254\nnetmask 255.255.255.0\n\n<\/pre>\n<p>The restart networking for the changes to take effect<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n~# service networking restart\n * Reconfiguring network interfaces... \n<\/pre>\n<p>Check to see if the IP&#8217;s re enabled<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# ifconfig\n<\/pre>\n<p>You should see the additional IP&#8217;s here<\/p>\n<p>You can add What you need. Just change eth0:1 for eth0:2, eth0:3 etc. This can also be done for any other network cards like eth1, eth2, etc.<\/p>\n<p>If the network show this:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# nano \/etc\/network\/interfaces\n\n<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# This file describes the network interfaces available on your system\n# and how to activate them. For more information, see interfaces(5).\n\n# The loopback network interface\nauto lo\niface lo inet loopback\n\nauto em1\niface em1 inet static\naddress 162.xx.xx.xx\nnetmask 255.255.255.0\ngateway 162.xx.xx.1\nbroadcast 162.xx.xx.255\ndns-nameservers 8.8.4.4\n\n<\/pre>\n<p>Add this<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nauto em2\niface em1 inet static\naddress 10.156.1.xxx\nnetmask 255.255.255.224\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Here is how to add additional IP&#8217;s to your Ubuntu server Add it to the server just on a temporary basis. A reboot will erase the changes. Using ifconfig If you want to add a secondary IP address to a NIC already in use in Linux, and have that change only temporary. Enter this command: &#8230; <a title=\"Add additional IP&#8217;s to Ubuntu Server\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2014\/10\/25\/add-additional-ips-ubuntu-server\/\" aria-label=\"Read more about Add additional IP&#8217;s to Ubuntu Server\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[72,117],"tags":[],"class_list":["post-870","post","type-post","status-publish","format-standard","hentry","category-networking","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/870","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=870"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/870\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=870"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=870"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=870"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}