| 24 | |
| 25 | Now your VM should have an IP address assigned through DHCP. To view the IP address and network adapter details enter the following command. |
| 26 | |
| 27 | {{{ |
| 28 | ip addr show |
| 29 | }}} |
| 30 | |
| 31 | But we need to assign the correct IP address manually which is given in this [https://ws.learn.ac.lk/wiki/containerization2023Agenda/IPAllocation table]. To configure the IP address need to edit the configuration file in /etc/netplan directory. In this case file will be 00-installer-config.yaml. |
| 32 | |
| 33 | {{{ |
| 34 | sudo nano /etc/netplan/00-installer-config.yaml |
| 35 | }}} |
| 36 | |
| 37 | edit the file as below. Please be careful about correct indentation and to avoid tab characters and following spaces. Only use spacebar to get spaces from left. Here each line start have indentations of 2,4,6,8,.. etc from the left. |
| 38 | |
| 39 | {{{ |
| 40 | network: |
| 41 | renderer: networkd |
| 42 | ethernets: |
| 43 | enp0s3: |
| 44 | addresses: |
| 45 | - 192.248.X.Y/23 |
| 46 | nameservers: |
| 47 | addresses: [192.248.1.161,1.1.1.1] |
| 48 | routes: |
| 49 | - to: default |
| 50 | via: 192.248.111.254 |
| 51 | version: 2 |
| 52 | }}} |
| 53 | |
| 54 | Save the configuration file. Enter below to apply the changes. |
| 55 | |
| 56 | {{{ |
| 57 | sudo netplan apply |
| 58 | }}} |
| 59 | |
| 60 | check the IP address change and connectivity. |
| 61 | |
| 62 | {{{ |
| 63 | ip addr show |
| 64 | ping 192.248.1.161 |
| 65 | }}} |
| 66 | |
| 67 | Now the Ubuntu VM is ready and you can go ahead with Docker installation. |
| 68 | |