April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

Categories

April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

How To Configure IP Address In Ubuntu 18.04 LTS

Netplan has been introduced by Ubuntu developers in Ubuntu 17.10. In this new approach, we no longer use /etc/network/interfaces file to configure IP address rather we use a YAML file. The default configuration files of Netplan are found under /etc/netplan/ directory. In this brief tutorial, we are going to learn to configure static and dynamic IP address in Ubuntu 18.04 LTS server and desktop editions.

Configure Static IP Address In Ubuntu 18.04 LTS Server

Let us find out the default network configuration file:

$ ls /etc/netplan/
50-cloud-init.yaml

As you can see, the default network configuration file is 50-cloud-init.yaml and it is obviously a YAML file.

Now, let check the contents of this file:

$ cat /etc/netplan/50-cloud-init.yaml

Add the configuration for available interfaces like eth0: and eth1:

network:
   ethernets:
     eth0:          
     addresses:
     - 192.168.1.9/24
     dhcp: false
     gateway4: 192.168.1.1
     nameservers:
        addresses:
        - 192.168.1.1
        - 8.8.8.8
        - 8.8.4.4
        search: []
     eth0:
     addresses:
     - 192.168.1.9/24
     dhcp: false
  version: 2  

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>