{"id":7919,"date":"2019-11-16T13:49:46","date_gmt":"2019-11-16T05:49:46","guid":{"rendered":"http:\/\/rmohan.com\/?p=7919"},"modified":"2019-11-16T13:49:48","modified_gmt":"2019-11-16T05:49:48","slug":"how-to-configure-ip-address-in-ubuntu-18-04-lts","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=7919","title":{"rendered":"How To Configure IP Address In Ubuntu 18.04 LTS"},"content":{"rendered":"\n<p>Netplan has been introduced by Ubuntu developers in Ubuntu 17.10. In this new approach, we no longer use&nbsp;<strong>\/etc\/network\/interfaces<\/strong>&nbsp;file to configure IP address rather we use a YAML file. The default configuration files of Netplan are found under&nbsp;<strong>\/etc\/netplan\/<\/strong>&nbsp;directory. In this brief tutorial, we are going to learn to configure static and dynamic IP address in&nbsp;<strong>Ubuntu 18.04 LTS<\/strong>&nbsp;server and desktop editions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Configure Static IP Address In Ubuntu 18.04 LTS Server<\/h2>\n\n\n\n<p>Let us find out the default network configuration file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>$ ls \/etc\/netplan\/<\/strong>\n50-cloud-init.yaml<\/pre>\n\n\n\n<p>As you can see, the default network configuration file is&nbsp;<strong>50-cloud-init.yaml<\/strong>&nbsp;and it is obviously a YAML file.<\/p>\n\n\n\n<p>Now, let check the contents of this file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ cat \/etc\/netplan\/50-cloud-init.yaml<\/pre>\n\n\n\n<p>Add the configuration for available interfaces like eth0: and eth1:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>network:\n   ethernets:\n     eth0:          \n     addresses:\n     - 192.168.1.9\/24\n     dhcp: false\n     gateway4: 192.168.1.1\n     nameservers:\n        addresses:\n        - 192.168.1.1\n        - 8.8.8.8\n        - 8.8.4.4\n        search: []\n     eth0:\n     addresses:\n     - 192.168.1.9\/24\n     dhcp: false\n  version: 2  <\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"\n<p>Netplan has been introduced by Ubuntu developers in Ubuntu 17.10. In this new approach, we no longer use&nbsp;\/etc\/network\/interfaces&nbsp;file to configure IP address rather we use a YAML file. The default configuration files of Netplan are found under&nbsp;\/etc\/netplan\/&nbsp;directory. In this brief tutorial, we are going to learn to configure static and dynamic IP address in&nbsp;Ubuntu [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7919"}],"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=7919"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7919\/revisions"}],"predecessor-version":[{"id":7920,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7919\/revisions\/7920"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7919"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7919"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7919"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}