= Session-(1.4) Preparing the Workstation for the Lab / OS Installation = Session-(1.4) Preparing the Workstation for the Lab / OS Installation (1.4.1) Hardware Recommendation. (1.4.2) Operating System Installation. (1.4.3) First login & connecting the host to Internet. (1.4.4) Restore classic network configuration option. (1.4.5) Using local apt-cache-server & modify apt-mirror. (1.4.6) Tuning some system parameters & configure ssh. related video link -:- https://youtu.be/pmvacxbaoco =1= Documentation By, Rezaul Karim (rkarim@redskybd.com)
= Session-(1.4) Preparing the Workstation for the Lab / OS Installation = (1.4.1) = Hardware Recommendation for Lab Laptop/Workstation with, Intel Core-i3/i5/i7 processor, 4GB RAM, 200GB free HDD partition for installing 64-bit Linux based on Ubuntu 18.04. note: if you do not have 200GB free HDD partition, please arrange/manage it, otherwise you will not be able to do the lab-works properly. (1.4.2) = Operating System Installation Recommended Operating System for the lab; (a) Ubuntu Desktop 18.04 Mate Edition. (Our lab/documentation is based on it.) note: for production environment you are strongly recommended to use Ubuntu 18.04 Server version. Now, you have to install the operating system using the following partition-scheme. We are guessing that, - Most of you already have Linux installation experience. - You will install OS by dual-booting with pre-installed Windows operating system. - You got the Ubuntu Live ISO USB-stick at your hand. (if not, collect it). - You have 200GB free HDD partition & 4GB RAM in your laptop. Boot your laptop from that USB-stick and proceed to installation. If you have Windows7/8/10 pre-installed laptops, then you have to create the following partitions; 1. / # 36 GB 2. swap # 8 GB 3 additional partition # 1 50 GB 4 additional partition # 2 50 GB 5 additional partition # 3 50 GB note: please take extra caution to follow the partition-scheme, take help from us as you need. =2= Documentation By, Rezaul Karim (rkarim@redskybd.com)
= Session-(1.4) Preparing the Workstation for the Lab / OS Installation = If you want to do a clean install and your BIOS is UEFI compatible, then you have to create the following partitions; 0. esp # 200 MB 1. / # 36 GB 2. swap # 8 GB 3 additional partition # 1 50 GB 4 additional partition # 2 50 GB 5 additional partition # 3 50 GB While installation, you have to create a user for the lab-works, you have to create the user-name as abc with password 123789_pw also set hostname as groupx-nodey Complete the installation, remove USB-stick & reboot you laptop. note: to follow the partition scheme is very important to practice the lab-works. (1.4.3) = First login & connecting the host to Internet. After Reboot, Login; and you have to do the followings, -Goto power option and modify all time related settings Never /maximum Value. -Disable screen saver. (We will uninstall it later). note: please keep in mind that, from now on, whatever commands we will apply in the terminal, we will do it as root (#). to become the root you have to apply the command sudo su after opening the terminal application. When you will apply sudo su it will ask for password; apply the password that you have provided while installation. Open Terminal and apply the following commands; sudo su /etc/init.d/network-manager stop apt remove -y --purge network-manager* mate-screensaver* systemctl stop NetworkManager.service systemctl disable NetworkManager.service Now find your network interface, ip addr networkctl Suppose, your interface name is enp1s0, apply following commands to set the ip address temporarily, please collect your node ip address from instructor. ifconfig enp1s0 0 ifconfig enp1s0 192.168.108.11/24 up ip route add default via 192.168.108.1 ip link set enp1s0 up echo 'nameserver 192.168.108.1'> /etc/resolv.conf networkctl status systemd-resolve --status =3= Documentation By, Rezaul Karim (rkarim@redskybd.com)
= Session-(1.4) Preparing the Workstation for the Lab / OS Installation = Now make sure your are connected to the internet, check by the following command, ping 8.8.8.8 ping google.com (1.4.4) = Restore classic network configuration option Install packages which will restore classic network options, apt update apt install -y ifupdown vim net-tools resolvconf In Ubuntu 18.04 classic network configuration option (ifupdown) is disabled with a new network configuration tool named netplan. But netplan lacks some features like post-up script, which is require to start some service after network is up. For our lab-setup we need that feature (post-up), To restore the classic network option (disable netplan and install/configure ifupdown), we have to complete the following steps. vim /etc/default/grub Change the line -into- GRUB_CMDLINE_LINUX="netcfg/do_not_use_netplan=true" sudo update-grub Configure the ip address in the classic way; vim /etc/network/interfaces Add the following lines; auto enp1s0 iface enp1s0 inet static address 192.168.108.11 netmask 255.255.255.0 gateway 192.168.108.1 Use our local caching dns server; echo 'nameserver 192.168.108.1'> /etc/resolvconf/resolv.conf.d/head reboot =4= Documentation By, Rezaul Karim (rkarim@redskybd.com)
= Session-(1.4) Preparing the Workstation for the Lab / OS Installation = After reboot check that your ip configuration is working properly and your are connected to the internet. (1.4.5) = Using local apt-cache-server & modify apt-mirror Replace the default apt-mirror with Bangladeshi mirror site (like mirror.amberit.com.bd); vim /etc/apt/sources.list Apply the following vim command in ESC (By pressing esc key first) mode; :%s/archive.ubuntu.com/mirror.amberit.com.bd/g Or by the the following sed command; sed -i 's/us.archive.ubuntu.com/mirror.amberit.com.bd/g' /etc/apt/sources.list Now activate local apt-cache-server for faster package installation; echo 'Acquire::http { Proxy "http://192.168.108.8:4444"; };' \ > /etc/apt/apt.conf.d/50apt-cacher apt update =5= Documentation By, Rezaul Karim (rkarim@redskybd.com)
= Session-(1.4) Preparing the Workstation for the Lab / OS Installation = (1.4.6) = Tuning some system parameters & configure ssh. Make some other important changes/tuning, which we will require for the practice; In the following line replace X with group number given to you. echo 'groupx-node1' > /etc/hostname Some system tuning; echo 'fs.file-max = 1024000' >> /etc/sysctl.conf echo 'root soft nofile 1024000' >> /etc/security/limits.conf echo 'root hard nofile 1024000' >> /etc/security/limits.conf echo 'performance' > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor In Ubuntu 18.04 /etc/rc.local file is depreciated which was used to execute start-up program/services, So now here we have to make use of post-up script to perform the same task. In the network configuration file add the following line as follows; vim /etc/network/interfaces auto enp1s0 iface enp1s0 inet static address 192.168.108.11 netmask 255.255.255.0 gateway 192.168.108.1 post-up /etc/network/if-up.d/startup-script.sh Create the the post-up script; vim /etc/network/if-up.d/startup-script.sh And add the following lines; #!/bin/bash echo 'performance' > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor echo 'nameserver 192.168.108.1'> /etc/resolv.conf Make the script executable; chmod 755 /etc/network/if-up.d/startup-script.sh =6= Documentation By, Rezaul Karim (rkarim@redskybd.com)
= Session-(1.4) Preparing the Workstation for the Lab / OS Installation = Now install some important system packages, activate root & configure ssh-server apt update apt install -y vim openssh-server htop tasksel mtr gparted pv vim /etc/ssh/sshd_config In the file sshd_config Change ssh port for security --> Set Port 22 Permit root login --> Set PermitRootLogin yes Add UseDNS no at the end of the configuration file /etc/init.d/ssh restart passwd root ; set the password 123789_pw for this lab In production change ssh port to any other port like 7979 In production use strong root password combining alpha-numeric characters. = Getting Gbps Local Lan Speed Now we have to do a final check to ensure that every participant got the Gbps-Speed, in their workstation/laptop. We can check that with any of the following two commands, Syntax1 : mii-tool <interface name> Syntax2 : ethtool <interface name> grep Speed mii-tool enp1s0 Output > enp1s0: negotiated 1000baseT-FD flow-control, link ok ethtool enp1s0 grep speed Output > Speed: 1000Mb/s If the speed is not 1000Mb/s, we have to do some troubleshoot (mainly cable connection) to achieve Gbps Speed. Now reboot the workstation/laptop. reboot Also after reboot check that you got Gbps Speed or not. =7= Documentation By, Rezaul Karim (rkarim@redskybd.com)
Session-(1.4) Preparing the Workstation for the Lab / OS Installation (1.4.7) Installation Screenshots.