Lesson 5

Dates: 6/5/2019
Linux networking
Linux System Administration


Exercises: Configuring network on Ubuntu 18.04 with Netplan


  • Shutdown kvm1 VM, and clone it into netplan VM:
    virsh shutdown kvm1 
    virt-clone --connect=qemu:///system -o kvm1 -n netplan -f /home/hostadm/KVM/netplan.qcow2
    
    Start netplan. Login to console of netplan:
    virsh console netplan 
    
  • Fix the hostname.
  • Reset the machine ID by running the following commands on netplan:
    rm -f /etc/machine-id
    rm /var/lib/dbus/machine-id
    dbus-uuidgen --ensure=/etc/machine-id
    dbus-uuidgen --ensure
    
  • Clear the DHCP leased IP settings:
    dhclient -r ens3
    
  • Execute command reboot on netplan:
    reboot
    

  • Check the IP address settings on netplan
    ip addr
    
  • Assign IP address 192.168.122.222 by modifying the content of /etc/netplan/01-netcfg.yaml as follows
    network:
     version: 2
     renderer: networkd
     ethernets:
       ens3:
         dhcp4: no
         addresses: [192.168.122.222/24]
         gateway4: 192.168.122.1
         nameservers:
           addresses: [192.168.122.1]
    
  • Have the settings applied:
    netplan apply
    
  • Check the IP address again:
    ip addr
    
    It should show 192.168.122.222 for ens3 interface now.


  • Take me to the Course Website