Servers

How to Install KVM on Ubuntu 20.04 LTS Server (Focal Fossa)

KVM is a free and open source virtualization tool for Linux like operating systems. When we install KVM on a Ubuntu Server then it becomes Type-2 KVM hypervisor. Minimum requirement for KVM is that server should have CPU virtualization extensions like Intel-VT and AMD-V. KVM is also known as Kernel based virtual machine because during KVM installation a kernel module (kvm-intel.ko / kvm-amd.ko) is loaded into the kernel.

In this article, we will demonstrate how to install and configure KVM hypervisor on Ubuntu 20.04 LTS server. We are assuming you already have freshly installed Ubuntu 20.04 LTS Server. Let’s deep dive into the KVM installation steps:

Step 1) Confirm Whether Server Support Hardware Virtualization

Login to your Ubuntu 20.04 LTS server and run following grep command,

[email protected]:~$ grep -E -c "vmx|svm" /proc/cpuinfo
2
[email protected]:~$

Above output confirms that server supports hardware virtualization. If the output is not greater than zero then reboot your server, go to its bios settings and enable VT technology.

If you wish to verify whether your server is capable of running KVM virtual machines then install “kvm-ok” utility using below apt command,

[email protected]:~$ sudo apt install -y cpu-checker

Once the “cpu-checker” package is installed, run “kvm-ok” command and verify its output

[email protected]:~$ kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used
[email protected]:~$

Above output confirms that KVM based virtual machines can be installed on our server.

Step 2) Install KVM, virt-manager and bridge-utils

Run the beneath apt command to install KVM, bridge-utils, virt-manager and other kvm dependencies.

[email protected]:~$ sudo apt install -y qemu qemu-kvm libvirt-daemon bridge-utils virt-manager virtinst

Once all the packages have been installed successfully, verify whether KVM module is loaded into loaded or not using lsmod command,

[email protected]:~$ lsmod | grep -i kvm
kvm_intel             286720  0
kvm                   663552  1 kvm_intel
[email protected]:~$

Step 3) Start and verify libvirtd service

When we install KVM then libvirtd service get started automatically, run below command to verify its status,

[email protected]:~$ sudo systemctl status libvirtd.service

Output above command would look like below,

Libvirtd-service-status-ubuntu-20-04-lts-server

In case libvirtd service is not started by any reason then run following command to start and enable it

[email protected]:~$ sudo systemctl enable libvirtd --now

Step 4) Setup Network Bridge for KVM Virtual Machines

In this step, we will configure a network bridge for KVM VMs so that VMs can be accessed from outside. Though a virtual bridge “virbr0” is created automatically when we install KVM, but this is only used for testing purpose.

To create a network bridge, we need edit the file “/etc/netplan/00-installer-config.yaml” Following is the content of my server’s file before making the changes.

[email protected]04:~$ cat /etc/netplan/00-installer-config.yaml

net-installer-config-file-before-bridge

Add network bridge entries, remove IP from enp0s3 interface and assign the same IP to the network bridge(br0). After making the changes, content of the file would look like below:

[email protected]:~$ sudo vi /etc/netplan/00-installer-config.yaml

# This is the network config written by 'subiquity'
network:
  ethernets:
    enp0s3:
      dhcp4: no
      dhcp6: no
  version: 2
  bridges:
    br0:
      interfaces: [enp0s3]
      addresses: [172.20.10.9/28]
      gateway4: 172.20.10.1
      nameservers:
        addresses: [4.2.2.2, 8.8.8.8]

Network-Bridge-netplanner-config-ubuntu20-04-server

Run “netplan apply” command to activate the bride br0 and to make above changes into the effect.

[email protected]:~$ sudo netplan apply
[email protected]:~$

Run below commands to …

0
Read More

Samsung’s Updated Flip Phone Gets Teased in the Oscars

The Oscars on February 9 was one for the books. For the first time in its award giving history, the Academy gave the Best Picture recognition to a movie that is not in the English language and produced outside the USA. Parasite, a South Korean film about a poor family trying to infiltrate the lives of a rich family also took home trophies for Best Director, Best Original Screenplay, and Best International Feature Film.

But then, that wasn’t all South Korea’s appearances during the televised (and streamed) ceremonies. During one of the commercial gaps, another South Korean brand claimed the spotlight, none other than phone maker Samsung. To tease its upcoming unboxing event, Unpacked 2020, to be held on the 10th in San Francisco, the phone giant showed off its next foldable phone to the delight of the TV viewers. Not to say that Samsung still doesn’t have foldable phones, as it already has. Looking back, their first release of the foldable phone in September last year, had people wax nostalgic, although a lot were still unimpressed with their fragility.  But whether you’re a Samsung-stan or not, the ad sure got a lot of people talking!

Did the ad show anything new?

From the 20-second ad, we saw the device’s homage to retro fashion. The clamshell clicks are there, but there also seems to be the addition of new things like the degree of opening that would allow for facetime-style chatting.

The ad shows the flip phones from all angles, opening and closing while the Comic Strip sounds of Serge Gainsbourg and Brigitte Bardot pop and crackle in the background.

(Via: https://techcrunch.com/2020/02/10/samsung-teases-videocalling-on-its-next-foldable-during-the-oscars/)

 

But wait… what was that?

So basically, the ad tried to make retro-chic again, and that for sure appeals to a lot of people on the lookout for a phone that brings them back to both the 1906s (Bardot and the quirky soundtrack allude to that) and the glorious 2000s when everybody had a clamshell phone. But then, eagle-eyed viewers of the commercial were able to spot a disclaimer.

One thing that became clearer though is what will happen to Samsung’s Galaxy Z Flip’s screens across the globe: They’re gonna get fucked up fast.

https://thenextweb.com/plugged/2020/02/10/samsung-galaxy-z-flip-phone-oscars-trailer-had-some-weird-small-print/)

 

One tall phone

Other than the ad, some pictures of the Galaxy Z Flip (yes, that’s what the phone is called) were also leaked and the first impressions centered on how long the model is and how there’s a crease in the center where the phone folds (pretty much the point of the second entry here).

Now, considering that plenty of renders and even a brief video claiming to be a hands-on with the Galaxy Z Flip have already surfaced, a few new pictures may not seem like much of a big deal. But they do appear to clear up a few rumors, including what a monster of a phone this guy is.

(Via: https://gizmodo.com/leaked-photos-confirm-samsungs-new-flippable-phone-is-o-1841533311)

 

Sizing up the competition  

Of course, when we talk about foldable phones, it cannot be helped that people will mention the brand that is almost synonymous with clamshell phones – Motorola. With this trend of flip phones re-emerging, Motorola’s new Razr has been touted as the more durable option, especially with complaints …

0
Read More

Ready to Go (Windows 10) Pro?

When Windows 10 was released in the middle of 2015, it came out with three versions – Windows 10 Home, Windows 10 Pro, and Windows Pro 10 for Workstations. Like previous Windows release, the public was quick to conclude that the Home version is, as its name implies, best for household use by the family. Individual contributors and office workers will benefit from the Pro release, and large working groups is the obvious target for the Pro 10 for Workstations.

But then, people that have been using the Pro version have been singing it praises, this despite the constant bugs to updates. So now, people who want more than what the Windows 10 Home provides and even those who still have Windows 7 (which has been de-supported in the middle of January 2020), ask, “Is updating to the Windows 10 Pro worth it?” and “What would the differences be between Windows 10 Home and pro?

 

Remote Desktop

Take note that all versions of Windows 10 can remotely connect to another Windows 10 PC. However, if you’re looking for remote access, only Windows 10 Pro has that. Staying with Windows 10 Home edition will not let you find settings to enable remote desktop connection, although you can connect to another PC, if that PC runs on Windows 10 Pro.

The Remote Desktop or RDP feature is disabled by default so you will need to enable it in the settings.

(Via: https://www.groovypost.com/howto/setup-use-remote-desktop-windows-10/)

 

Bitlocker

For those who prioritize their security and keep their data safe from possible intruders, it’s time to consider switching to Windows 10 Pro even with its extra cost. Also, for those who have gotten used to Filevault of MacOS’, the Bitlocker found in Windows 10 Pro is the most similar to that service you’re looking for.

BitLocker is the name given to the full disk encryption software that’s built into Windows. First introduced with Windows 7 Ultimate Edition, BitLocker is now available with the Pro editions of Windows 8 and Windows 10.

(Via: https://www.onmsft.com/how-to/getting-started-with-bitlocker-windows-10s-built-in-full-disk-encryption-tool)

Trusted and Secured Boot

Working in tandem Secure Boot and Trusted Boot aids in keeping your system away from malware and rootkits, allowing you full control of it. Trusted and Secured Boot, as their names suggest, works by checking each component of the startup process before it is loaded.

By working with Windows 10 device manufacturers, Microsoft hopes to make firmware security compromises, those that happen before Windows itself boots, a thing of the past.

(Via: https://www.forbes.com/sites/daveywinder/2019/10/25/windows-10-security-microsoft-announces-a-new-before-windows-boots-strategy/#2a5ff5056f26)

 

Hyper-V

Virtual machine fans, rejoice! Hyper-V on Windows 10 Pro allows you to run virtual machines on CPUs that support virtualization.

There are many reasons to use a virtual machine. In most cases, they are used to run software that does not work on your OS. Whether you’re using a Windows, Mac or Linux OS, a VM will remove its limitations. For example, if you have a Windows machine and want to install an application that is only available for Mac, you can run a macOS instance on your Windows laptop to install it.

(Via: https://www.cloudwards.net/hyper-v/)

 

Windows Sandbox

Anyone active on the World Wide Web will, at one point in their online lives, get a suspicious file. Whether your suspicions about …

0
Read More

How to Manage Linux Log Files Using Logrotate

In a Linux system and pretty much all systems – log files are crucial when it comes to examining and troubleshooting errors. They provide important clues as to what could have gone wrong with various system services prior to failure.

Any service installed on your Linux systems such as Apache web server or MySQL database server generates log files that are usually stored in the /var/log directory. If you check the contents of this directory, you will see contents similar to what we have below:

Over time, as additional information gets logged, the log files increase in size and take up more space on your hard drive. Before you even know it, the log files will have ballooned in size, gobbling up much of your hard drive space, and if you are not careful, you can easily run out of disk space.

With that in mind, it becomes prudent to keep the log files to a manageable size and delete old log entries that hog precious disk space. And this is where the log rotation comes in.

What is log rotation ?

Log rotation is a process that creates new log files and archives & removes old ones to save on disk space. The process renames a current log file. For example, apport.log becomes apport.log.1 and a new apport.log log file is created to log new log entries. Older log files are usually compressed and appear as  apport.log.2.gz, apport.log.3.gz, apport.log.4.gz, and so on.

The log rotation process is facilitated using a utility called logrotate. This is a tool that facilitates the rotation of log files and archival & removal of old ones to free up disk space. In summary, logrotate accomplishes the following:

  • Creation of new log files after rotating old ones.
  • Archival of old log files.
  • Purging of older log files that have been rotated to save on space.

Log rotation is usually activated when the size of log files grows and exceeds a certain limit.

How logrotate utility works

Before we examine the workings of the logrotate utility, ensure that logrotate is installed on your system. To do that, issue the command:

For Debian / Ubuntu System:

$ sudo apt-get install logrotate -y

For CentOS / RHEL / Fedora System:

$ sudo yum install logrotate -y
or 
$ sudo dnf  install logrotate -y

Run below command to check logrotate version,

[email protected]:~$ logrotate --version
logrotate 3.14.0
    Default mail command:       /usr/bin/mail
    Default compress command:   /bin/gzip
    Default uncompress command: /bin/gunzip
    Default compress extension: .gz
    Default state file path:    /var/lib/logrotate/status
    ACL support:                yes
    SELinux support:            yes
[email protected]:~$

From the output, we can clearly see that we have logrotate version 3.14.0. By default, logrotate comes preinstalled in modern Linux distributions and hence no need to install it.

Logrotate configuration files

Logrotate runs daily as a cron job, going through various log files, rotating them, and purging older log files as defined in the configuration file. There are two main configuration sources that you need to pay close attention to:

/etc/logrotate.conf – This is the main configuration file for the logrotate tool. It contains default settings and facilitates log rotation for non-system package logs. More notably, it uses an ‘include‘ directive for pulling configurations located in the ‘…

0
Read More

Is Windows 10X a Threat to iPadOS?

When the iPadOS was released in September 2019, a lot of people believed that this might already be the endgame for mobile operating systems. People were impressed with the iPadOS, claiming that it has made iPads that powerful to the point that iPad owners can already consider their Apple tablets as their main computer. The addition of new capabilities may have been overwhelming at first, but as the users got used to it, it only became a testament to how Apple has incorporated a lot of improvements to it, particularly in the areas of touch gestures and multitasking.

But then comes Microsoft with Windows 10X. Windows 10X is not really something new; it is a version of Windows 10X that is, as of February 2020, still a work in progress. This reengineering of Windows 10 has so far (at least according to those who have experienced it through an emulator for developers) resulted in a sleeker look and a system that is specifically catered for dual-screen devices, such as Microsoft’s own Surface Neo and Lenovo’s ThinkPad X1 Fold. And by the looks of it, Windows 10X may give iPadOS a run for its money.

 

What you see when you boot it up   

While Windows 10X is indeed a new “expression” of Windows X, you won’t necessarily get tiles and a taskbar when you open it just like what you see when you turn on a device running on Windows 10. What you’ll see is a Start menu that is centered and a thicker Taskbar, which feels like the dock on iPads.

Windows 10X is designed exclusively for foldable and dual-screen hardware, and Microsoft has customized it as a result. One of the biggest noticeable changes is the new Windows 10X Start menu. It no longer includes the animated Live Tiles found on Windows 10, Windows 8, and Windows Phone, and it now includes a more simplified look.

(Via: https://www.theverge.com/2020/2/11/21132826/microsoft-windows-10x-features-dual-screen-foldable-hands-on-developers)

 

Multitasking gestures  

One of the current selling points of the iPadOS is making multitasking and its associated gestures easier for users. This is one area that Windows 10X also wants to also be recognized in, and so far, reviews on how multitasking can be done with it are promising.

Gestures for multitasking also exist, where you swipe up from the bottom of the display to access the Start menu or list of running apps on the taskbar. You can also access an updated Action Centre from the taskbar that includes quick access to settings like volume, brightness, Bluetooth, rotation lock, and more.

(Via: https://www.criticalhit.net/technology/emulators-give-a-glimpse-of-what-windows-10x-will-be-like/)

 

Notifications

Microsoft has reportedly made controls and notifications look better by not making it as heavy as what is currently seen on Windows 10. Although there’s been an improvement in its looks for Windows 10X, the iPadOS may still be better in not letting controls and notifications be too distracting and allowing them to be more accessible through gestures.

Notifications are now separated in their own dialog, each displaying the name of the app that generated it, along with the typical message included in a notification.

(Via: https://news.softpedia.com/news/a-closer-look-at-notifications-in-windows-10x-529204.shtml)

 

Apps

In this regard, it is obviously iPadOS on the advantage, with its plethora of apps available in Apple’s App Store. The …

0
Read More

How to Setup Django Python Framework on CentOS 8

Django is an opensource, fully loaded, and versatile Python-based framework that enables developers to build and deploy scalable and robust web applications that can meet the high demands of end-users. The main objective of Django is to simplify the deployment of complex web applications and take care of crucial aspects of application development such as content administration, authentication, and security.

With Django, you can build any sort of web and chat applications such as social networking sites Some of the popular applications built on Django include Instagram, Spotify, and Eventbrite. In this guide, we will walk you through the installation and configuration of Django on CentOS 8.

Step 1) Install Python3 and pip on CentOS 8

Given that Django is a Python-based toolkit, we need to ensure that Python is installed. Right off the bat, we are going to install Python3 and pip package manager. To achieve this, run the command below on the terminal.

$ sudo dnf install -y python36 python3-pip

Once the installation is completed successfully, you can verify the version of Python3 installed by running:

[[email protected] ~]$ python3 -V
Python 3.6.8
[[email protected] ~]$

To check the pip version, execute:

[[email protected] ~]$ pip3 -V
pip 9.0.3 from /usr/lib/python3.6/site-packages (python 3.6)
[[email protected] ~]$

Step 2)  Install Django via pip3

With the prerequisites installed, proceed and install Django web framework using the command:

$ sudo pip3 install django

pip3-install-django-centos8

This takes a few seconds and in no time, the installation of Django will be complete. To check the version of Django installed on your system, run the command below:

[[email protected] ~]$ django-admin --version
3.0.6
[[email protected] ~]$

From the output, you can see that we have installed Django version 3.0.6

Now copy django-admin binary from /usr/local/bin to /usr/bin,

[[email protected] ~]$ sudo cp /usr/local/bin/django-admin /usr/bin/

Step 3) Creating a Django project

We have just installed Django in the previous and in this step, we are going to create a sample Django project. For this guide, we will name our project linuxtechi.

We are going to create a new project within the /opt directory using the django-admin command. So switch to root user and run the commands below:

$ cd /opt
$ sudo django-admin startproject linuxtechi

Output of above commands would be the following

[[email protected] ~]$ cd /opt/
[[email protected] opt]$ sudo django-admin startproject linuxtechi
[[email protected] opt]$ ls -l linuxtechi/
total 4
drwxr-xr-x. 2 root root  89 May 18 07:07 linuxtechi
-rwxr-xr-x. 1 root root 630 May 18 07:07 manage.py
[[email protected] opt]$

Inside the newly created project directory, be sure to find another directory with the same name and a manage.py Python file. Once you have created the new project folder, navigate into it, and migrate the changes using the command:

$ cd linuxtechi
$ sudo python3 manage.py migrate

Your output should be similar to what we have below:

python3-migrate-centos8-django

Step 4) Create a Django Admin account user

Next, we need to create an admin user account for logging in to Django on the front-end. Therefore, run the command below:

$ sudo python3 manage.py createsuperuser

You will be prompted for the username, email address, and the password which you will thereafter confirm.

[[email protected] linuxtechi]$ sudo python3 manage.py createsuperuser
Username (leave blank to use 'root'): sysadmin
Email address: sysadmin@linuxtechi.com
Password:
Password (again):
0
Read More

Free Yourself From AirPod Woes

Do you still remember the time when everybody made fun of AirPods as early as when Apple teased it in late 2016? One of the most scathing and funny commentaries about it was Saturday Night Live’s little skit about it, when it ridiculed the way Apple promoted these cordless earphones as the best device to jam to your favorite songs. How are you supposed to dance and jump to your heart’s content when they will most likely fall out from you ear with all the movement?

Fast forward to three years, AirPods and wireless earbuds have become almost ubiquitous as their wired counterparts. Everyone suddenly wants the convenience of listening to music from your smartphone without being bothered by cords getting in your way. Somehow, no one seems to be laughing at how popular AirPods are, that people want to own one despite their steep price tag. But then, as the technology is still relatively new, there are still problems users must deal with when enjoying wireless earbuds. What are these problems and are there fixes to them already?

The most common problem: Lost AirPods

They may not be directly related to the device itself, but then users would consider misplaced earbuds the most common problem they encounter. May it be because of an earbud popping out of the user’s ear while in use (which is actually not as common as a lot of people might think) or because it rolled over from where the user placed it last, there are a good number of solutions.

Your iPhone will show you the last known location where they connected to your iPhone, right on a map. This will let you know if you accidentally left them at work or if they’re still cruising around in an Uber you rode in.

(Via: https://www.cnbc.com/2020/01/17/how-to-find-lost-airpods-and-make-them-ring-if-theyre-hiding.html)

 

Problem pairing?

Another common problem AirPod users experience is difficulty connecting the device to your iPad, iPhone, or other Mac devices. Experts advice putting them back in the charging case, let it stay there for ten seconds, then try using them again. If that doesn’t work, look deeper.

If you’ve never connected these AirPods to your iPhone or iPad before, make sure that the devices meet the minimum system requirements. If you have first generation AirPods, your iOS device must be running iOS 10 or later; for the second generation AirPods, you need at least iOS 12.2.

(Via: https://www.businessinsider.com/why-wont-my-airpods-connect)

 

Uneven connection

Another issue that’s common among AirPod users is an uneven connection. The left side may play the music while you can’t hear anything on the right. As with the pairing problem, it is advised that you put both in the charging case and try them after 10 seconds.

There is no one definite cause but there is one definite suspect and that’s Bluetooth. We might suspect this anyway because Bluetooth is startlingly wobbly, but in this case we always seem to get it soon after we’ve changed a connection.

(Via: https://appleinsider.com/articles/19/12/07/how-to-fix-one-airpod-not-working)

 

Continuous disconnection

Of course, there’s also the issue of AirPods that keep disconnecting from the device you’re supposed to be listening to. Although bad Bluetooth connection is the common culprit, there may be other factors.

Fixing AirPods connection issues isn’t a

0
Read More

How to Host a Website on a cPanel VPS

When surfing to buy a web host, the first thing that catches your eye on some sites is the cPanel VPS. But what exactly is a cPanel host? cPanel is not a host, but like other control panels, it is only a web application that is installed on Linux servers, especially the CentOS distribution, and […]

Source

from ThisHosting.Rocks https://thishosting.rocks/how-to-host-a-website-on-a-cpanel-vps/…

0
Read More

The Case of Bad Love: Getting Scammed on Romance

With thousands (if not millions) of people getting into the digital and online economy every single day, it is not surprising to see the rise in cybercrimes as well. Scams, frauds, and hacks have victimized internet users by the thousands every year, making everyone susceptible, even those who don’t consider themselves as risky.

There are victims of extortion, where cybercriminals take money or other material objects from their victims who they have coerced. Extortionists online can employ methods such as ransomware, bomb threats, and even sextortion conditions.

There are also victims of phishing scams that have not only taken the form of emails but also SMS and instant messages. The scammers usually pretend to be established and legitimate business and persuade customers to make their account information updated. Of course, when updates are done, personal information is provided.

Finally, there is a rise in what has been termed as love scams. In these online dating scenarios, virtual relationships blossom between a fraudster and the unsuspecting victim. Armed only with a fake profile on one or more dating sites, these scammers earn their victims’ trust and before they know it, the latter would already get swindled to the tune of tens of thousands of dollars. Let’s look deeper into this and see if there are any solutions.

 

How do romance scams begin?

Here’s the deal: According to the Better Business Bureau, victims of online romance scams in the US and Canada have lost more than $1 billion. What’s worse, because of embarrassment and other personal reasons, victims tend to not report these scams. As a result, cybercriminals get more emboldened, gathering more victims who they scam hundreds of dollars until everything piles up and they end up getting thousands.

Romance scammers use dating websites, apps, Facebook, and other social media. Many use stolen credit cards to join the sites and post fake profiles. They meet victims, interact with them, and quickly try to get them to move to a different form communication such as email or texting. This way, if the dating site identifies the scammer as being bogus and shuts them down, they are already in contact with their victims elsewhere. The scammers will often make fake Facebook pages for their aliases to help bolster their fake identity.

(Via: https://www.augustachronicle.com/news/20200219/bbb-beware-of-online-romance-scams)

 

Are senior citizens at the most risk?

Here’s an extreme case: an elderly (80 years old, to be exact) widower in Oregon lost $200,000 to an online romance scam. That’s how grave these situations can go.

The elaborate con job started with an unidentified person stealing a Florida’s woman identity, the Oregon Division of Financial Regulation said in a statement. The scammer then used the stolen identity to befriend the 80-year-old widower through an online dating service, and worked to steal his heart and his money.

(Via: https://edition.cnn.com/2020/02/14/us/happy-valentines-dont-fall-for-romance-scams-trnd/index.html)

 

How romance scammers work

So, how do these scammers operate? They build a pretty believe profile for themselves. However, there are tell-tale signs of a romance scammer. They are not agreeable to meet-ups even if there are no inconveniences, they almost always have physically attractive profiles, their English isn’t on a native speaker level despite them claiming that they have university degrees and have traveled around the …

0
Read More

How to Assign Static IP Address on Ubuntu 20.04 LTS

It is always recommended to assign a static IP address to a Linux system because static ip address will be persistent across the reboots. Recently canonical has released its stable operating system “Ubuntu 20.04 LTS (Focal Fossa)” for both desktop and servers. In this article we will demonstrate how to assign a static ip address on Ubuntu 20.04 LTS Server and desktop.

Assign Static IP Address On Ubuntu 20.04 LTS Server

In Ubuntu 20.04 LTS server, network configuration is controlled and managed by netplan utility. But during the installation, cloud-init configure a dynamic ip to interface on server if the dhcp server is available. so, to configure a static ip, first we must make sure and confirm that network interface is not managed by cloud-init.

Open cloud-init file “/etc/cloud/cloud.cfg.d/subiquity-disable-cloudinit-networking.cfg” and make sure entry “network: {config: disabled}” is there. In case this entry is missing, then add it manually.

[email protected]:~$ cat /etc/cloud/cloud.cfg.d/subiquity-disable-cloudinit-networking.cfg
network: {config: disabled}
[email protected]:~$

Use “ip addr show” command from the console to view ip address,

[email protected]:~$ ip add show

ip-addr-show-dynamic-ip-ubuntu-20-04-server

As we can see above, a dynamic ip is assigned automatically on interface card “enp0s3”. So, to make this ip address static, we must edit the netplan configuration file “/etc/netplan/00-installer-config.yaml”.

[email protected]:~$ sudo vi /etc/netplan/00-installer-config.yaml
# This is the network config written by 'subiquity'
network:
  ethernets:
    enp0s3:
      dhcp4: true
  version: 2

Above are the default entries, which shows that interface “enp0s3” is getting the IP from DHCP server. As it is an yaml file, so while making the changes in the file we must follow correct indentation. Add the following lines to the yaml file,

network:
  ethernets:
    enp0s3:
      addresses: [192.168.1.3/24]
      gateway4: 192.168.1.1
      nameservers:
        addresses: [4.2.2.2, 8.8.8.8]
  version: 2

save and close the file.

Updated-netplan-yaml-ubuntu-20-04-server

Run the following “netplan apply” command to make the above changes into the effect.

[email protected]:~$ sudo netplan apply
[email protected]:~$

Now run “ip addr show” and “ip route show” command to view ip address and route details.

[email protected]:~$ ip add show
[email protected]:~$ ip route show

Output of above command would look like below,

ip-addr-show-route-ubuntu-20-04-server

Perfect, output confirms that Static IP has been assigned successfully on interface ‘enp0s3‘. Even if we reboot the server, this ip address will be consistent.

Now, let’s move to Ubuntu 20.04 LTS desktop.

Assign Static IP Address on Ubuntu 20.04 LTS Desktop

Network configuration in Ubuntu desktop is controlled by network manager. Configuring a static ip address on Ubuntu 20.04 desktop is very easy. Login to your desktop environment and click on network icon and then choose wired settings.

network-icon-ubuntu-20-04-lts-desktop

In the next window, Click on ‘gear box’ icon under wired option,

Gear-box-icon-Ubuntu-network-icon

In the next window, Choose IPV4 Tab and then select Manual and specify the IP details like IP address, netmask, gateway and DNS Server IP.

Static-IP-Ubuntu-20-04-LTS-Desktop

Click on Apply to save these changes and we must disable and enable interface once to assign the ip address to interface.

Enable-Disable-Interface-Ubuntu-20-04-desktop

Once you enable and disable the interface then static IP should be assigned to the interface, we can verify by looking at the Details Tab from Wired Settings.

IP-Details-Ubuntu-Desktop-Ubuntu-20-04-LTS

Perfect, above confirms that static ip address has been assigned to the interface …

0
Read More