This article will provide you with an information on how to configure a static IP address on Ubuntu 19.04 Disco Dingo Linux

In this tutorial you will learn:
  • How to configure static IP address using netplan
  • How to configure static IP address from Graphical User interface ( GUI )
Configuring Static IP Address on Ubuntu 19.04 Disco Dingo Linux Desktop
Configuring Static IP Address on Ubuntu 19.04 Disco Dingo Linux Desktop

Software Requirements and Conventions Used

Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Ubuntu 19.04 Disco Dingo Linux
Software N/A
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # - requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ - requires given linux commands to be executed as a regular non-privileged user

Configure static IP address using DHCP

Most likely your current Ubuntu system uses DHCP server to configure its networking settings. Hence, the configuration of your IP address is dynamic. In many scenarios, simply configuring your router or local DHCP server is a preferred way to set a static address to any host regardless of the operating system in use. Check your router manual and assign the static IP address to your host based on its MAC address using the DHCP service.

Configure static IP address from command line using netplan

  1. Locate current network configuration file.

    Navigate to /etc/netplan/ directory and locate your current network congratulation file:
    $ cd /etc/netplan/
    $ ls
    01-network-manager-all.yaml
    
  2. Edit the current configuration file.

    For example to set Ubuntu 19.04 system with static IP address 192.168.1.224, netmask 255.255.255.0, gateway 192.168.1.1 and two DNS servers 8.8.8.8 and 8.8.4.4 open the current configuration file with administrative privileges and change its content to:
    # This file describes the network interfaces available on your system
    # For more information, see netplan(5).
    network:
      version: 2
      renderer: networkd
      ethernets:
        enp0s3:
         dhcp4: no
         addresses: [192.168.1.224/24]
         gateway4: 192.168.1.1
         nameservers:
           addresses: [8.8.8.8,8.8.4.4]
    
  3. Apply changes.

    Next, apply changes to set your system with a new static IP address:
    WARNING
    If you are connected via SSH your session will be terminated!
    $ sudo netplan apply
    
  4. All done. Use ip command to confirm your new static IP address:
    $ ip a
    

Configuring static IP address from GUI



  1. Click on the top right Network icon and Wired/Wireless settings
    Click on the top right Network icon and Wired/Wireless settings


  2. Click on the network configuration gear
    Click on the network configuration gear


  3. Select Manual IPv4 radio box and set desired static IP address and relevant network configuration.
    Select Manual IPv4 radio box and set desired static IP address and relevant network configuration. Once ready hit Apply button.


  4. Restart network
    Restart network
ARE YOU LOOKING FOR A LINUX JOB?
Submit your RESUME, create a JOB ALERT or subscribe to RSS feed on LinuxCareers.com.
LINUX CAREER NEWSLETTER
Subscribe to NEWSLETTER and receive latest news, jobs, career advice and tutorials.
DO YOU NEED ADDITIONAL HELP?
Get extra help by visiting our LINUX FORUM or simply use comments below.

You may also be interested in:



Comments and Discussions