Linux Network Administration | Imran Afzal | Skillshare

Playback Speed

  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Linux Network Administration

teacher avatar Imran Afzal, Systems Manager / Instructor

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

21 Lessons (2h 46m)
    • 1. 1 Linux Network Administration Intro

    • 2. 2 Linux Network Administration Course overview

    • 3. 1 Download and Install VirtualBox

    • 4. 2 Creating First Virtual Machine

    • 5. 3 Linux Installation

    • 6. 4 Linux CentOS8 Installation

    • 7. 1 Enabling Internet in Linux VM

    • 8. 2 Network Components

    • 9. 3 Network Files and Commands

    • 10. 4 NIC Information

    • 11. 5 NIC Bonding

    • 12. 6 Downloading Files and Apps

    • 13. 7 curl and ping

    • 14. 8 File Transfer Commands

    • 15. 9 SCP Secure Copy Protocol

    • 16. 10 rsync Remote Synchronization

    • 17. 11 SSH and Telnet

    • 18. 12 Hostname and IP lookup

    • 19. 13 Network Time Protocol NTP

    • 20. 14 chronyd Newer Version of NTP

    • 21. 15 Tracing Network Traffic traceroute

  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.





About This Class

Welcome to Linux Network Administration course which is designed for students who want to learn everything about the networking components within a Linux system.  Without proper understanding of Linux networking a system administrator will not be able to manage Linux servers.  It is very important for anyone dealing with Linux to have a deep comprehension of networking.  We will cover basic to advance networking which will be very helpful for anyone who wants to pursue his/her career in Linux 


What will I learn? 

  • Networking components 
  • Network files and commands 
  • NIC bonding 
  • Curl and ping commands 
  • File transfer command 
  • SCP and rsync 
  • SSH and telnet 
  • NTP and chronyd 
  • Tracing traffic  


Who is the target audience? 

  • Anyone who wants to learn Linux networking 
  • People that have Linux experience but would like to learn about the Linux command line interface. 
  • Existing Linux users that want to become power users. 


Meet Your Teacher

Teacher Profile Image

Imran Afzal

Systems Manager / Instructor




Hello, I'm Imran Afzal and here is my education and experience:



About Me:

Imran Afzal



Bachelors in Computer Information Systems (Baruch College, City University of New York)

Master of Business Administration (New York Institute of Technolgy)



- Over 20 Years of IT Infrastructure experience

- 7 years of training experience in Linux, VMWare, Windows and many other IT technologies

- 5 years of IT Infrastructure management experience



- Linux Systems Management (New York University, NY)

- UNIX Operating Systems

- Linux System Administration and System Internals<... See full profile

Class Ratings

Expectations Met?
  • Exceeded!
  • Yes
  • Somewhat
  • Not really
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.


1. 1 Linux Network Administration Intro: Hello, beautiful people. I'm so glad that you're here. Welcome to my course on Linux and network administration. Now this is a part where you're going to learn everything about the operating system network administration. In this course, you're going to learn how, what is a DHCP, what is a static IP? How you could assign those static IP, how you could do neck bonding, and many, many other things that you need to know when you're working in a corporate environment. My name is Enron absolute, and I've been in IT since 2000. I had been teaching thousands and thousands of students worldwide. I have helped so many of my students getting a job of their dream. When I teach, I make sure you understand every single concept of that topic. I actually graduated from Baruch College City University of New York, and my concentration was computers, Information Systems. I did my master's in business administration from New York Institute of Technology. I have worked for Fortune 500 companies in New York City. So all I'm telling you, once you're going to take my course, at the end of the course, you're going to learn everything you need to know about that specific topic. So what are you waiting for? Let's go ahead and enroll. 2. 2 Linux Network Administration Course overview: Hello folks and welcome to our course overview. For the course linux network administration. Please do spend a few minutes with me to go over what are we going to cover exactly in this course? So where the very first thing is section 1, introduction and course overview introduction I have already gone through. I have given you my background courses that I teach and a quick introduction of this course itself. Now about the course overview which I'm doing right now. And you will have the option to download this syllabus at the end of this video. Then you have Section 2 for lab setup. If you have already a Linux machine running, then you could skip this video. But I will skip this entire section I meant to say. But I'll highly recommend that you do go through the Linux installation. So you have a better understanding how to install and configure Linux, especially CentOS. What I'm covering in this entire section is how we could download and install Oracle VirtualBox. Virtual Box is a software that allows you to run multiple virtual machines on a single host or a single hardware. Then we'll go into Create a first virtual machine and do the Linux installation. And for the Linux installation, as I said before, I have covered CentOS installation. If you wanted to go with a different flavor, that is perfectly fine. But I would recommend you to stick with CentOS. Then the actual content, then the fun begins in section three where we're going to cover the actual network administration. On. Next, we're going to cover how you can enable internet on a Linux machine. The Never components were, are and what should we know? What are the components of network will cover network files and commands. The neck information next stands for Network Information Card. And we could cover how we could pull information of the neck will cover the neck bonding meaning one and neck. And you have a second neck. You could actually put them together to create a redundancy. So we'll cover that in this video. We'll go through the downloading files and applications. I want to cover curl and ping commands which will help you connect to other machines. Also file transfer commands like SCP, which is a secure copy protocol, arcing for remote synchronization. I also wanted to call it the difference between SSH and a Telnet. Which one should you use and which one is more secure? Host name and IP lookup. Then moving on to the Network Time Protocol, NTP insured, which allows you to synchronize your Linux machine, a client, to a server for the time synchronization. I also wanted to cover the newer version or newer package of NTP, which is chronically which is also a time protocol. Then we'll go into the tracing the network traffic like trace route, et cetera. In this course I have also covered are added as some of the homework that I want you to do and I want you to read the handouts as well. Good luck. I'll see you in the next lecture. 3. 1 Download and Install VirtualBox: In this lecture, we are going to cover the Oracle Virtual Box. We will go through the download and installation of virtual box. Now, as I said previously, the Oracle Virtual Box is, Is a virtual environment which allows you to run multiple operating system on the same hardware. There are other virtual platform that is available out there that you could use. You don't have to go with VirtualBox if you don't like it, you could use VMware player B and player workstation as well as other open source virtual environment. But anyway, I would prefer if you stick with Oracle VirtualBox. So this way we could go through the course together. Alright, so we'll go open up Maya Firefox browser. So I could download the VirtualBox software. Could use any browser you like. Then I'm going to the Google page. And in the Google page I'm searching for Oracle VirtualBox. When you click on it, you're going to see the first link as Oracle VM VirtualBox. So you could click on it and then go to download. Or you could go straight to the download page. On the download page you're going to see the section versus VirtualBox version platform packages. Now depending on when you are downloading this VirtualBox, the version will be higher, maybe 12 or whichever the version at that time you're downloading. It doesn't matter. Don't be confused. Oh, the one I am showing you is 6 dot o and the one you're seeing is a different version. Basically what we wanted the end is a virtual platform that we could run our guess instances or guest operating system on it. Anyway, if you are using Windows, adds your main host wherever you will run the Linux CentOS as a VM. Then pick Windows host. If you are using OSX host, meaning if you are using Apple, then you could use this one. For Linux, for Solaris, for other operating systems, you could pick depending on your requirement of your actual operating system. Go ahead and click on Windows host. Because I am running Windows host and that's where I'm going to run my virtual box. Now here it is asking me to save the file. And you can click, but I'm now going to click the save file because I have already saved it to save some time. So if you have not saved previously, so go ahead and click on this. And it will ask you to the location to save it. So I'm going to cancel it since as I said, I have already saved it. I have my virtual box executable saved on my desktop. And here is the executable. All I have to do is go ahead and double-click so it could start the installation. Once you double-click on it, it will ask you, do you want to run this file? Click on run. Okay, Now the visit has started. It says Welcome to the Oracle VM VirtualBox 6 dot 0 dot 14 setup a virtual setup wizard. This setup wizard will install Oracle VM VirtualBox on your computer. Click Next to continue or cancel to exit the setup visit. Go ahead and click Next. Select it the way you want features to be installed. So by default, Virtual Box application has been selected and the other features that comes with it, I'm going to leave everything default. And this also tells you the version installing the feature requires 227 megabyte that you should have on your desk. So go ahead and click Next. Choose, please choose from the options below. Create Start menu entry. Create a shortcut on desktop. Create a shortcut on quick launch, bar, register file Association. I like them all leave them default except I don't like create a shortcut in quick launch bar. So I'm going to uncheck it again. That's my preference. You can leave all of them selected. Click Next. Now, Warning Network Interface installing the Oracle VM VirtualBox networking feature will reset your network connection and temporarily disconnect you from the network. Proceed with the installation. So that's fine. So make sure you are not connected to the Internet or if you are, make sure you're not doing any type of work that you will lose. So go ahead and click Yes. And click Install to begin the installation. Installed. I am going to fast forward at this part because I don't want you wait, I don't want to waste your time. So I'm going to just simplify it fast forward. Okay, so the Oracle VM VirtualBox installation is complete. You can lead the checkmarks will start a backup. Backup, and you can click on Finish. Congratulations, you have completed the download and installation of Oracle VirtualBox. Now the next step is to create a test virtual machine. And then of course, we will go ahead and do the actual operating system installed on that Virtual Machine. 4. 2 Creating First Virtual Machine: Hello everyone. In this lecture we are going to create a virtual machine on our virtual box, the VirtualBox application that we have downloaded in the previous lecture. And now I'm going to show you how you could create a virtual machine. So I'm going to start up the word Fill box. This is what I have it open already. And the version that I'm using for the virtual box is when you go to Help and click on about VirtualBox. We're VirtualBox 6 dot o. If you're using a little later version or updated version, that is perfectly fine, every version would just work fine. Now, as an example, as a test, we are going to create a new virtual machine. So I want you to go ahead and click on a new. And here I want you to type for example, my Linux VM. So now as you type this, it's going to tell you where it's going to save the information of the Linux machine. So it picked up this location by default. Next one it says the type. The type is Linux, of course, because I have typed the name, it automatically picked it up that it's, it's assuming there is a Linux machine and the version is Linux six, 2006, 3, 4 or whichever version, and it says 64 bit. Now, if your computer right now or your virtual machine settings showing 32-bit, which is this. And you do have 64 bit operating system, then you, what you need to do is you need to enable virtualization technology in your bios settings. So again, if it is showing 32-bit, then first thing you need to confirm is that your computer that where you're running this virtual box actually is 64. So I could confirm by going into my computer. I could go into my computer right here, right-click on it. Go to properties. And in my computer properties, you're going to see that I have a system type, a 64 bit operating system. So if this is your system type showing right now 64 bit operating system and you still seeing this aversion showing up as 32-bit, then it means that you have to go into your computer bios setting to enable virtualization and how to do that. I have included an article in this lecture and the description that will make, make you go through how you can enable that anyway. So once you have it enabled, good a reboot your machine and it will show up as 64 bit. Now the next thing is you need to define the memory. Memory is the memory of your virtual machine. It's just like if you are going to store, right? Let's say if you're going to Best Buy or any computer store, and you pick up the laptop and your computer when you ask how much memory it has, this exact same way that you are doing. But the difference is that now you are the manufacturer. You are the one who is putting in the memory inside of your computer. By default, I'm going to leave it as 12 or 24 megabyte, which is one gig. The next part is hard disk. Create a virtual hard disk. Now, leave that as default and click on Create. Then it says the file size here is eight gate by default, it's picking it up. I want you to pick 10 gig just to make sure we have enough space when we are going through all the exercises of our training. All right, so then hard disk file type is VDI virtual Box disk image, which is by default, is the right file type. So leave that as is storage on physical hard disk dynamically allocated. Leave that as default as well. If you need to know more about it, what's the difference between each one of them? I'm sure you could go and click on guided mode or you could also look it up online on the difference of each of these hard this time. Go ahead and click Create. And now you're going to see right here it's going to show you my Linux VM and its configuration or specification of that VM. The job information showing up here, the system information is up here, the displayed storage or your network or USB shared folders, all that. It is just like as if you have an actual machine. So anyway, you have created your virtual machine. This is, this is the lecture I wanted to go through how you could create a virtual machine. When I am going to go through the next lecture where we will do the actual CentOS or Linux installation. Then I will ask you to create the virtual machine again. So for this lab purposes, I just, just go ahead, click on the machine, then right-click and click on Remove, and then just click on Delete all files. Beautiful. All right, so that was just an exercise. Let's move on. 5. 3 Linux Installation: Hello everyone. Let's get into the fun part where you will do the Linux download and installation. And for the installation that I have picked is a CentOS operating system. Centos operating system is just like a Red Hat operating system and it's free. And I will definitely recommend you using CentOS for this course. Because a lot of companies out there, their user Red Hat for the corporate environment. Now for the version part I am using CentOS 7. There's also a version 8 that is out there already. If you want to use Version 8, you can. That is perfectly fine because my course follow both 78. But my recommendation is that you stick with seven because a lot of companies, I would say 95 to 99 percent of them are still using older versions like 567. So it will take them at least 34 years to get onto eight. So if you're in the job market or you want to get into the market, I would recommend you that you stick to seven. Now for those who wants to go with the Red, Red Hat aid or centralized eight. Perfectly fine. You could skip this lecture and go to the very next lecture which has CentOS 8 instructions for download installation. All right, without further ado, let me get into the download part. For the download which you have to do, you have to go into your browser, whichever browsers July go to Google or any search engine and type Central CentOS download ISO. Now by default, will give you the first page which will have the link to CentOS 8. We don't want aid. Again, we want seven. So let's go back and I want you to type specifically CentOS 7, download ISO, and go to the second link which says index of CentOS 7. Click on that. Now click on X86 underscore 64-bit. Now again, every image, if you click on it, you probably going to get different links. The marriage, you could pick any one that gives you the CentOS 7, but it doesn't really matter. I'll go to the second one, and I'll click on the 64-bit. Your architecture has to be 64-bit. If you're 30 to search for 32-bit, then click on any mirror that you like and it will start to download it. So you go into this ISO CentOS 7 X86 1908, doesn't matter which version or which build it has. Maybe you have a later one, maybe you have an older one. It doesn't really matter. What matters is it's CentOS 7. So go ahead and click on ISO and Save. I will not save it because I have already saved it earlier to save time, save your time and save my time. So I'm gonna go ahead and cancel. So anyway, for, in your case, once you, once you click, you click on, Okay, it will start downloading and it will show up here. If you're using Firefox. Once it's downloaded completed, then you need to go to your Oracle VM VirtualBox. Now if you do not have virtual box, that is the latest version. This one, the one I have a six Dato. If you do not have saddle, I would recommend that you upgraded to the new version. So now I will go ahead and create a new virtual machine. I'll click on New. And a name that I will pick is my first Linux VM. That's just the name of this virtual machine on the Virtual Box. You could pick any name, but if you wanted to go along with me, pick that name by default you see is picking up Linux type because I typed in the name as Linux. And the version is giving up as Linux 2.63 dot x for x or 64. If you do not see 64 here, you see 32-bit, then you'd need to change your bias configuration of when you go to, when you start up your own laptop or PC, you have to go to your bios settings and enable virtualization. You need instructions. I have included instruction. I have given the, the link to an article which you will walk you through one-by-one as how you could enable that virtualization and your bias. So anyway, if you, if it is showing 64-bit perfect, Go ahead and click next. The memory size is one gig, 1024 megabyte, which equates to one gigabyte. That's good to leave as default. Next, create a virtual hard disk. By default, it's telling me the recommended size is eight gig. You could leave a gig or you could change it. We will change in the next one in the next slide. So create a virtual disk, click Create VDI, which is the default one. Leave a default click Next. Dynamically allocated, yes, leave a default click Next. And now the size by default is set. It's clear that gave you eight. But for, for this lab, I want you to type 10 and click on Create. Now, our virtual machine is created, as you can see, it's right here saying my first Linux VM. So let me go back in here, and this way I have a clear background. All right, so now what you need to do is once your VM is created, go ahead and click on start. So once you started by default, it will ask you, I do not have any operating system, of course, this is just an empty shell or empty virtual machine. Now I need to attach an ISO image to it, and that ISO image is the same ISA amazed that we downloaded earlier. That is CentOS 7 ISO image. So go ahead and click on this little folder. And now it will ask you where is your ISO image located? My ISO image is located in my personal folder and in my ISO and I have right here is a CentOS 7. So go ahead and select that and now click on start. Okay, and on this page by default, it will come on this option which says test this media and install CentOS. I do not want to test. Sometimes this option is good if you are installing with the actual CD ROM, the physical one, the CD because sometimes it has scratches and it could impact your installation. So that's why you should always test that media before you do the installation. But since we did the ISO image download, and I am very hopeful and I'm sure that the installation or sorry, the download was not corrupted. So I'm going to use my up and down arrow key and I'm going to select the first one which says install CentOS 7, and I'm going to hit enter. Now what it's going to do now is it's going to read the content of the ISO. It will copy the content of the eyes. So the ones that it needs to start the installation, it will bring it into the memory. And then it will start an installation wizard that's called Anaconda. That's, that's just a name of the visit that CentOS uses. And it will start, and it will help us going through the installer process from one step to another. All right, So right here you're gonna see it is the virtual machine reports that the guest OS supports mouse pointer integration. This means that you do not need to capture the mouse pointer. That is fine. You could go ahead and cancel that. By the way, if you are, if your mouse is stuck inside of this window, then you could use the right-click. You see right here this little thing says the right control key. This is a control key on your key, keypad, and that is on your right-hand side. So once you press that key, then it will release your mouse. But if it is your mouses really going outside, perfect. Anyway, let's get into it. Now. What language would you like to use during the installation process? I am in United States and of course English speaker. So I'm gonna go ahead and pick English and the English for the United States. If you are in a different country, depending on your preferred language, you could go ahead and select the desired language. Now go ahead and click on Continue. In the next page it says installation a summary. And this is US is basically the keyboard that has been selected. You don't need to click on that. The first thing you need to click is date and time. So date and time is by default. For me, it is already selected. My US time. I am in New York, it's already it actually, I didn't actually recognize that, so I'm going to leave that as default. And I'm going to click on Done. Then it's gonna say language support. And as I said previously, the selected English and for the English United States. Go ahead and click Done. If you wanted to change it, you could change it here as well. By default, it picks up my keyboard as United States English keyboard. If you are again in different country, you could pick according to your requirement. Now comes to the part. Let's scroll down on the right-hand side by grabbing the scroll bar. And then it says The next one is a software installation source, which is local media, which is our ISO image that is attached to this virtual box. So you can leave that as is software selection. It says minimal install. When you pick minimal installed, it will not install the GUI. It will only install the text way or command line on your operating system. But for this lab, I want you to go ahead and click on it. And I want you to select server with GUI. This way you have the server with the graphical user interface. And you will see a certain things that you could add remove using the GUI. But again, I would say about 80% of the corporate environment do not use Goofy's. They always use a command line interface because GUI takes a lot of resources. It could also make your system little vulnerable for the security threats. So if you are in production or corporate environment, check with your company policy and then you should select the software selection. Also. If you are building a server for different purposes, you're going to see that the servers has a lot of add-ons that you could do. So when you go to minimal install, you're gonna see it has security tools, smart card support system administration tools, and you go to compute node. It has all the other add-on selected tools and software that are available to you. Again, it depends on what kind of application you will run on this operating system. Based on that, you could select any tools or any add-ons, tools or applications that you want. Similarly, when you go to infrastructure server, you probably heard of many of the servers like FTP server, NFS server, DNS server, all that stuff. If you wanted to have them installed, you could actually select them here. So it will install that package. But anyway, if you do not select any package right now at this point, and you remember later on that you need to install, Not to worry about, you could just simply do the yum install command, which we will cover later in other lectures that I will show you how you could install the ad on selected add on packages. Again, file and print server will give you different options. Basic server, web servers. I do want you to go through them one by one. I don't want you to select any of them. But again, if you want to select, that's perfectly fine. But I just want you to get familiar with what are the options that are available on this menu. But for this lab purposes, for this training, I just want you to select this server with GUI. And now I want you to go ahead and click Done. Now it's actually checking the software from the eyes though it is basically the software selection is going to the ISO and has an asking, Hey, I, so I've been asked to select server with GUI. Do you have the required package? So that's what it's kinda like going back and forth and checking. So anyway, wireless checking will go into the next one where it says system and it says installation destination. By the way, it's finished and it worked. It came back and says, Yes, I do. The next one is installation destination may wear, meaning where do you want to install this operating system? Which disk? You remember we picked ten gig of disk. So we'll go ahead and select this one. And by default, it has already selected ten gig. Then it has checkmark on it and other storage options. It says petitioning. It says automatically configure partitioning. So we are not going to put Titian it ourself. We will let Linux pick the partitions for its own, which is a default partition for the 10 gig disk. And now we go ahead and click on Done. Now installation destination is done. K dump is when there's something goes wrong with your system and it crashes, it hats to log something that why it crashes. And that kind of kernel dump is when you, if you have it enabled, then it will actually spit out all the information to a log file. So when you have it enabled, That's only when you have it and it will spit out logs only when you have it enabled. Okay? So network and host name. So that's where we need to define the network and the host name of the operating system. So you go ahead and click on it. And a host name right here you see the host name dot local domain. I want you to highlight the entire entry and type in my first Linux VM, and click on apply. As soon as you click on Apply, you see right here says current host name, which is local host, which it had before. So once you click on Apply, it will change it right here, my first Linux VM. So you probably notice that I put an uppercase, the first letters, and it changed it to lowercase. Because remember, Linux is case sensitive operating system, meaning it matters if you put it in uppercase and lowercase, but it prefers that you always use lowercase letters. All right, so now let's go into the network. Is Ethernet, E&P 0, S3. Right now, this is the network port that is assigned on your virtual box. So right now you see it has a hardware which is a MAC address. It has a speed of one gig and a subnet mask is, by default, is picking up its local IP. So what do we need to do is we need to click on Configure because you see right now it's turned off. Let's go ahead and click on Configure. And the only thing I want you to pick in configure is guru general and click on automatically connect to this network when it is available. Now what this does is it actually Start your network or pick up an IP whenever your computer or your operating system restarts. So go ahead and click on Save. And you're going to see right away it picked up. And by the way, this is going to be your WiFi network adapters that is given to you by your virtual box. So now go ahead and click on Done. All right, the last part is security profile. So we do not have any security profile, but if you are doing this installation for your company, check with your company and check with your security folks, see if they have any security that they use or any template, then you could attach it here, which will apply all the security settings. But anyway, this is lab and this is something we're going to be learning later on. So now I want you to go ahead and click on Begin installation. All right, In this next page, you're going to get two options while it's going to run the reconfiguration or pre installation checks and stuff. It has asking It's asking us to create a root password. So go ahead and click on root password. By default route is a system administrator password in Linux. So I want you to pick a root password. I picked a weak password that it's saying this yellow thing at the bottom, it says the password you have provided this week. Password fails that the dictionary check. It is based on a dictionary word. You will have to press Done a twice to confirm. So if your password is weak right now as what I have, my password is weak. So you'd have to select it done. And another time you have to click done twice. Second option is your user creation. I want you to go ahead and click on user creation. And this is a regular user, not a root or not an administrative user. So I am going to create my account. I'm going to pick my name, Enron upsell, and the username by default, it'll pick my first initial followed by the last name, and the password. Leave the the setting as default. Again, my password is weak, so now I have to select done twice, 12. All right, so now you notice that right here it's saying installing genome user dogs and installing this and that these are all the packages that it needs to install to complete my installation. And the package is total packages it needs to install is 1353. And so far it has installed 58. Now, this whole process could take anywhere from 10 minutes to half an hour or 45 minutes, depending on the speed of your computer where you are running this virtual box. What I will do is from this point on, I'm going to fast-forward this entire installation. So if you are sitting now, I will ask you to go ahead and take a break, take a coffee break, or get something to eat. And once it's done, we'll start right from there. So I'm going to fast forward right away and see you. All right. Congratulations, the installation has been completed. As you can see at the bottom right here says CentOS is now successfully installed and ready for you to use, go ahead and reboot to start using it. And also a little messy at the bottom it says use of this product is subject to license agreement found at this location. But anyway, you will get the license confirmation that you can read through an accepted in the next ones it reboots. So go ahead and click on reboot. Okay, in this message appears, you can go ahead and close this. Since it is starting the first time your operating system is starting the first time, it could take us a little while for it to start back again, but that's fine, perfectly fine. Now let's licensing part. I want you to go ahead and click on licensing information. It says license not accepted. Go ahead and click on it. And right here, read through it and click, I accept the license agreement and click Done network and host name. We already configured that earlier, so you don't need to configure that again. Now click on Finish configuration. Now it is going to start the GUI, the CentOS operating system GUI now. Alright, perfect. So now you see it hashes you on the top, it shows you the time some network information. Speaker powered off from here, just like as if you see on the Windows environment. Now go ahead and click on your name because this is the account that you created. I hope you did not pick M1 Absolutely. Because I hope you pick your own name while you're going through the installation. So anyway, go ahead and click on it. Now provide the password. And once you provide the password, click sign in, it will log you in. But going back again, if you wanted to log in as root, then you could click on simply not listed and put in the username as root and put in the password. But anyway, I wanted to login as myself. I'll put my password in and I'll hit Enter. Okay, now we have this a desktop looking type of environment that has two icon on it. One is my home folder, one is the trash can. The pretty big. I usually keep them smaller so you could go ahead and right-click on it. And you could do resize icon. And then you could drag and make it smaller, just like that right-click, resize icon and drag and make it smaller. You can also move them around up and down, left and right. So this is your desktop environment now if you wanted to start your terminal. Now by the way, if you are doing this for the first time, this is the first welcome screen after the installation, you could just leave it as welcome. And it's going to say English is for the United States. I have that selected. I'm going to click Next typing. It's already selected for me English. If you want to change that now, you could change it as well. I'll click next. Location services like to keep it disabled. So click on, off and next, connect to your online accounts. I don't like that. I want to keep my Linux machine private secure, so I'll click Skip. And I wanted to click Next is star to using my CentOS Linux. Once I click on that, it will bring me back to my desktop. On the desktop, as I was explaining earlier, you could right-click and click on open terminal. By the way, this help getting started genome helps opened up again. I don't need that. So what I'm gonna do is I'm going to close that. Again. This, there's, these windows are popping up because I am using this operating system for the very first time. So I could go ahead and close that and we'll start the terminal back again. So anyway, how you can close that window, anything that shows up like software updates available, you don't have to get it now you can click, click on not now. And this is the terminal that what you wanted to see, and this is your command line terminal where you could run all the commands. And that's where this is our platform where we will learn everything about Linux. So you're ready, Let's go. 6. 4 Linux CentOS8 Installation: Hello folks, This is where we going to do the CentOS installation version a. Now as I said earlier, that if you do not want to go through with CentOS 7 and you wanted to go to with CentOS 8. Perfectly fine at this entire training or this entire course covers both 78 new feature or feature, everything. And if you, again, if you want, if you prefer, you want to go with eight. Let's go ahead and do it now. First thing first, we need to have the CentOS 8 ISO downloaded on our computer. We could attach it to your virtual machine and then we could do the installation. So I will go ahead and open up my Firefox, and I already have my Google open, and I will type CentOS, download ISO. The very first link. Again, I will take me to the latest version of CentOS. So the first one I'll pick a CentOS IS so Linux, DVD, ISO. And it will take me to all the mirrors that actually has sent OS version. And I could pick the first one is second one. It doesn't really matter. And I would prefer you go with the first one. If it doesn't work, then you go to the second one. Anyway, I pick the first and now it is asking me to save that file. Now, I have already saved the file previously to save some time. So that is why I'm going to cancel. But if you have not saved it, I would like you to go ahead and click on Okay, and it will actually save it to your default location of your downloads. I'll go ahead and cancel this point. And now once it's downloaded, I want you to go to your Oracle Virtual Box. And one important thing is if you are downloading and installing CentOS 8, please make sure you have Oracle VirtualBox 6 and above. This is the one that is mostly compatible with the CentOS 8. If you do not have 6 dot o, you could go into the file and click on check for updates. And it will take you to the right link where you could actually upgrade your Oracle VirtualBox. Anyway. Now we are doing CentOS 8. I want you to go ahead and click on Add New and type in cent OS or Linux, CentOS 8, or any name you decide the name is not important. Anything that you could remember or you could relate to. And by default, it will pick type Linux version Red Hat 64. You could pick 64 Red Hat, or you could actually pick the one that you picked. Or if it shows up as other 64 doesn't really matter. So I will leave it as default that it picked red Hat 64 and click on Next. The memory one gig, leave that default. The storage create virtual disk Creek, click on Create, leave a default VDI, default dynamic allocated, and now the size of the disk, I will recommend that you pick 20 gig. Go ahead and click Create. And now it has created a yearling CentOS 8. Go ahead and click on power on. Once the window opens up, it will ask you to, to check where is your ISO image file is located. My ISO image file Is, and the location when you click on this little folder, click on that. And if you have your ISO image file downloaded on your desktop and you go to your desktop or wherever the location is. My location is my personal folder in ISO folder. And here is the ISO image for me, CentOS 8. Click on Open, and now go ahead and click on start. Okay, So this is the page where it gives you two options. The first option it gives you install CentOS Linux 8 dot 0. Second option is test this media and install CentOS Linux dot eight. Now, if you have the physical disk, I'm attached to your virtual machine or your physical machine, then it's always good idea to test the media because many times that physical media has scratches on it. So it will, it will create problems during the installation. But since we have downloaded the ISO, then its best. And it's perfectly fine if you pick the first option. So you go ahead and hit the up arrow key, and it will highlight install CentOS Linux, the very first option. Go ahead and click Enter. If you see this message top, you have the auto capture keyboard option turned on and this will cause the virtual machine to automatically captured the keyboard. That is perfectly fine. You could close it. Basically what is saying is if you, if your mouse is stuck inside of this window, is because we have certain features enabled, you could get out of this window by clicking the Control key, the right control key on your keyboard. So I will just simply go ahead and ignore these messages by clicking the close. Now basically what this is doing right now is it is actually copying some of the information from the ISO, amazed that we have attached. It is taking that and copying it into its memory. And the memory will actually see, hey, give me the installer that will allow me to go through the installation wizard to do my CentOS 8 installation successfully. So I'm just going to have to wait for it to start that GUI, that installer. And once we have that when we go through the installation, by the way, you could also do the command line installation. And so on the very first page, you could have done that modification as well. But if you're doing it for the first time, I will definitely recommend you go through the GUI installation. So as you see, it's showing starting installer. So give it give it a minute or less than a minute. I'm very hopeful. All right, on this screen you will get the welcome to CentOS Linux 8 dot 0 or the bill could be 1905 or whatever. What matters is version eight. What language would you like to use? We'll pick English and I'm in the United States, I'm going to pick English in the United States and click on Continue. On the second screen or you're gonna see installation summary, CentOS Linux 8, the keyboard is us. You can leave that as is. You don't need to click or chain that the localization at the keyboard. It is automatically testing and it notices that we are in the United States. So it's going to pick the keyboard as English, us. Next one is language support. It's United States and English. The time again, it's America, New York. If you are in a different region, then it should pick up that region. If not, you can click on it and you could select the desired region. Next one is on the software selection. You're going to see installation source, which is our ISO image. So that shows up as local media. Second one is software selection as server with GUI by default, it's going to give you Server with GUI. You could go ahead and select this option. And you're going to see in the base environment, the left-hand side, these are the base environment. On the right-hand side are the add-ons for selected environment. Every base environment has all these add-ons. So if you go to, for example, server, you're going to see these different servers that you can run, these different applications that you can run on your server. You probably heard of FTP, NFS, DNS, all the services that actually runs on Linux or on a server. You could pick based on your requirement. Or if you're doing in the production, you could pick depending on your application team requirement. Again, minimal install, meaning when you pick this one, it will not install Gui. But with that minimal install, you can also pick some of the tools that you think are appropriate to do your a troubleshooting or systems tool configuration workstation. And this is a workstation is a user-friendly desktop system for laptops or PC custom operating system virtualization hosts. I actually want you to go through each one of them, go through each and every ad on package, and just make sure you understand and make yourself aware what are the packages or add ons we have available. But for this training, I want you to simply select a server with GUI which was previously selected as a default. And go ahead and click Done. Okay, once that is done, you're going to notice that, that it checking with this ISO image. Hey, I need server with GUI. Do you have all the required packages and the local media, which is the ISO image, it says, okay, let me check. And it goes back and look through the packages and says yes, I do. That's why you see both of them now into the black fought. The next one we have right here is installation Destination, meaning where do you want to install your operating system? Which desk do you want to install it on? And you remember when we were configuring the virtual machine, we carved out 20 gig. By default, it has that 20 kicks selected, as you can see right here in the story configuration, I'm going to leave it as automatic, which means I am going to let Linux decide how it wants to petition this 20 gig. If I click on Custom, then I would have to specify, meaning, I want you to give five good to home. I want you to get like five gig to war. I want you to give the remaining two root. That comes into custom. So this is a very beginning. I don't want you to get into this because it requires some extra skills. If you are doing it the installation for the first time, then my suggestion is leave it as automatic and go ahead and click on Done. Okay, next option, and under this system is K damp. K DEM stands for kernel dump. If something goes wrong with your system, something crashes. And if you have that k1 enabled, then it will log all the errors and those messages. So you could go back and review what cause the server to crash. So I'm going to leave that as enabled or which is selected by default. Next one is network and host name. You click on it and let's change the host name right now it shows up a local host dot local domain, which is, which shows all the right-hand sides is current host name localhost. Let's go ahead and change it to Linux, sent OS eight, and click on Apply. Again. You could pick any host name that you like, and then you can apply it. And it will show up on the right-hand side. This one, it shows our networking right now it's disconnected because it's turned off. Here's the hardware address, which is the MAC address. Here's the speed which is a one gig. Go ahead and click on Configure. And on this screen I want you to go to the general tab and click checkmark automatically connect to this node worker when it is available, it means every time your computer, your operating system reboots, it, actually going to connect it to the network automatically so you don't have to enable it or start the network. Again. Click and click Save. And now you're gonna see it has some more information like IP address, default, route DNS. So go ahead and now I want you to click on Done. So host name and no work is done. Security policy, if you accompany, has some security policy or if you're installing CentOS 7 or 8 and you production environment, consult with your security folks, find out if there are any security policy that you need to apply. But I would say nine out of 10 times, this option is not usually selected. So leave that out and click on Begin installation. Alright, wireless starting the configuration, doing the pre-check of the installation, it's going to ask you for uses setting is going to ask you for a password. You need to set the root password and you need to define at least a user. Let's go ahead and click on root password first. I'm going to specify a root password based on my choice. It is weak. I understand. I do not recommend you guys to pick a weak password, pick a strong password. But since for me this is a lab, so I'm going to just leave as is. And by default, Linux sees it as a weak password and it asks you to press Done a twice to confirm. So if your password is weak, then you have to press this Done button twice 12. And now use a creation a, let's pick a user. I'm going to pick myself, Enron, abyssal. Of course you have to pick your own name. And by default, Linux picks the first name, initial, and complete lastName, leave these settings default and pick the password. Password again in my password is weak and that's fine. I'm going to press the done button twice. All right, so now the prerequisites for the installation is done. Now it is downloading packages. Packages, meaning it is going to that ISO image. And it is asking, Hey, ISO image, give me all my required packages. And now it is preparing transactions from the installation source. And what is that installation source again, it's our so image. Now once that is completed, then you're going to see the actual number of packages that will show up that actually are needed for this installation to complete. And once you pull it, it will show you. So most likely it's probably going to be somewhere around twelve hundred and thirteen hundred packages. Because we are going through the GUI installation. When you have GUI selected GUI takes a lot of add on packages as opposed to the command line or without the GUI installation. So anyway, if it comes up like 1300 packages. You need to leave it running. It could take anywhere. I would say the installation would take anywhere from 10 minutes to 30 to 40 or 45 minutes depending on your computer resources, depending on the speed of your computer. So I would say at this time, you could go ahead and take a coffee break or a lunch break, and then you could come back after half an hour. And what I will do is I will go ahead and fast forward from this point on. So this way, I'm not going to waste your time and my time. And then once it's done, I will meet you on the other side. All right. Congratulations guys. We have successfully completed the CentOS installation. As it says right here, complete CentOS Linux is now successfully installed and ready for you to use. Go ahead and reboot to start using it. So of course, go ahead and follow the instruction and click on reboot. All right, when you get to this screen and you can notice that it is starting back again on the CentOS Linux installation screen. The reason it is doing that is because by default, your ISO image is still attached to this virtual VM VirtualBox. So what you need to do is you need to remove that ISO. So when, when your system reboots, it doesn't think that it has to boot off of that ISO image. So for that, I would tell you to go to. So to get out of this window and release your mouse click there, Control key on the right-hand side of your keyboard. So and click on devices, optical drives, and simply click on Remove disk from virtual drive. Then it will give you a prompt you to force unmount, meaning remove it forcefully, that's fine. Go ahead and click force you unmount. Now it is unmounted. You can verify again by clicking on devices, optical drives, and there isn't anything that attached. Beautiful. Now you need to reset this machine, click on Machine and click on Reset. It will prompt you, do you really want to reset the falling virtual machines? Yes, that's fine. Click Reset. Now it is starting your CentOS version 8 operating system. Okay, when you get to the initial setup page, you need to select the license information. By the way, if you got to this page after two minutes of treatment, that is perfectly fine because this is initial configuration for its time, you'll operating system restore it. It could take some, some time. It could take longer than then what it will take you later on because I didn't click on license information and click on I accept the license agreement. Of course I recommend that you read through it and click on Done, and then click on Finish configuration. All right, when you get this to the screen, meaning that it's waiting for you to log in now. So I have created my account or you during installation. So I will click on it and asked me to put in my password. So if you go back again, click Cancel and you wanted to log in as root, then you have to click on and not listed and provide the username as root. And then you need to provide the password for the root, and that is the password that you picked it during the installation. Anyway, I want to cancel it. I want to log in as myself. Once again, if you're logging in for the first time and then it will take some time for the operating system to come online. So don't worry, be patient. If your mouse is captured inside of this window and it's not going outside of it. Then please remember you could click the Control key, the right control key on your keyboard to get out of it. All right, so this, the desktop, the only important thing that I see on the desktop is your terminal. So right here you could go ahead and click on that terminal. And it was gave you the platform to actually run all those commands that we can learn through this training. So that terminal is, you could use either console and use that terminal. Or what we could do is we could find out the IP address of this Linux machine. And then we could log in as through putting, anyway, logging into the party is something that our show you later. But anyway, this time, again, as I said, since this history for the first time, It's gonna make you go through some initial stuff like this point it's giving you a welcome screen. If you need to change your language right now, you can just leave it default click Next. Typing against selected for me, click Next. Location Services. I would like to keep it turned off. So I'm going to move this to the left and click Next. Connect your online accounts. I would not like to use those right now. So I'm gonna go ahead and click on Skip. And the last option, the last green is giving me you are ready to go start using CentOS Linux. So click on start using CentOS Linux. And it should go back to your desktop. Write out that where we have our terminal that we opened up earlier. All right, So again, as I was saying, this is the terminal, that's the one that you need to use to run all the commands. And you could get yourself familiarized with the desktop as well, the GUI desktop. But I would say 80 percent of the environment and the production corporate environment do not use Gui. So, so, so be ready to use command line. Don't get too comfortable with the GUI. Anyway. Congratulations once again, you have completed the CentOS 8 installation couple successfully. Now you could go ahead and close this Help window that will also give you some information about genome that will tell you about the going. Anyway, good luck. And let's get moving on to the next lectures. We will learn a lot about the command lines in the commands that you need to learn. 7. 1 Enabling Internet in Linux VM: Getting internet access to your virtual machine. Now, in this module, we will cover different components of networking. We will learn a little bit about how networking works in a Linux environment. So before we get into the network, we do need to allow access to our Linux machine. And in order to allow access, we have to make certain changes to our virtual VirtualBox Manager. Basically, we have to go to the network setting and change its network adapter to bridged adapter. So this way, it will get its network, your laptop or your desktop. So let's go into, right into the change. This is our VM that is running. I want to, I want you to go to the setting network and change this attached to bridged adapter. Once you change it, leave everything default, and click Okay. Once it's set, let's go to our core to a machine. And then here we will try to do Peng, Peng dot And right now it's telling me that it has, the service is not available. So let's become root. And then just simply reboot the machine and there to reboot as 0 or just type simply reboot. Let's open up the terminal. And this time I want you to run command F config and pipe it to more. And you will see here the IP address has changed it as given the IP addresses of the same network that you have set up at your home. So now when you try to ping, you should get the response. See it's getting the 64-bit response back from the server. Ping is the command that is used to communicate to other servers. So now we know that our machine is ready, it's under, under network. We could download the packages, we could install the packages, anything that we want. It has the ability to go on online. 8. 2 Network Components: Now let's get into the network side of Linux. Of course this is not work where you're gonna be learning switches and routers. That's completely a dedicated network job that you should look into. But in Linux, even if you are System Administrator or an engineer, you have to know a few things of network. What it means is when you are building or installing a Linux machine, you need to configure an IP address. You need to know certain things, certain components of network to get it working and get it online. What are those things? Of course, the first thing is IP. Ip stands for Internet Protocol. Ip address is, could be like, for example, 192, 168 dot one, dot 234 or whatever. So depending on the organization you are in, you're probably going to have a different range of IP addresses. So your job is to assign an IP address and you should know what an IP address is and what it looks like. Subnet mask is an associated way to attach it to the IP address. And then we have a gateway. Gateway tells the computer which route you have to pick to send you traffic out and to receive your traffic n. So if you are in your home environment, your modem, the IP address of your modem will be your Gateway. Then we have the static and Vs and DHCP. What static is, if you are given an IP address from your company, from your corporate environment, and you have to assign a dedicated IP to your machine that is called static. And when you reboot your machine, that IP does not change. Whereas if it is set up as DHCP, the IP address will change. It will pick an IP from a pool of IP addresses. And every time your system is rebooted, most likely it will change its IP address. So in most of the corporate environment, you will be setting up a static IP address. Then you have an interface. What interface is, if you'll look at your laptop or your computer at the back of it, there's a port where you can connect your cat 5 cable. That's an interface, a NIC card. So interface always have a MAC address that is a permanent MAC address to your neck associated with your card. And this MAC address never changes. 9. 3 Network Files and Commands: And that work files and commands. There are many network files and commands that needs to be used in order to configure your machine and bring it online or bring it to the network so it could communicate from one machine to another. It should have an interface and interface detection. Assigning an IP address to the system is very important when you bring up a system and you need to have it on the network. The interface configuration files are, the first one is at CNS file. This file is located in every Linux distribution. In fact, all these files that I'm going to talk about, all of them are and will be in your Linux system. So for the first one is ns switched up COP, which tells the system where is it should resolve its host name to IP address. So let's look at our Linux machine and then we will find out how, how to read these files. Let's clear the screen. Okay, the first file that we're going to look at, it's at CNS switch. So just do cat head sea and a file. You will see it starting with host. So let's, let's do more on it instead of just cat. So this is the read the file, page by page. Okay, so all the stuff, anything that starts with a pound, it means it's just a comment. Anything that you want to have it in effect, just remove the comment. So let's go through it. Let's go to the point where you don't see the comment. So it starting from this page on it says a password file. So the first thing is telling you that look for the password file into files don't go anywhere. There's no Active Directory, there's not other. And I asked service that's running, That's going to give you the password. So it looks for Etsy passwords. Shadow is also ETC, shadow that's local. Group is also ETC, group. And when you come down to host a right here, it's going to tell you the horse information off your system is located in the files and that is at c host. And then it's going to say if you can't find it, then go to DNS. Dns is an other service that is installed on a Linux machine or it can be installed in our Windows machine will code that later on. But for now, this is the NS switch file looks like and if you want, your horse would be resolved with DNS first, you switch DNS here to here, and file comes to second. So this is the NS switch file. You're going to be seeing this configuration of this while, many times while you're doing System Administration. Next one we're going to look at is ETC. Host. Seahorse file is where you define your system IP address and system hostname. So if my system IP address is ifconfig, it's 18 to 16, 14, I could go into that at C file. We're becoming route VI, the file. And I could go at the bottom and a 192, 168 dot 10, 14. And host name of my machine is a guard. Let me save it. And Diego, my first Linux OS. So let's do it again. My doesn't matter uppercase, lowercase, but my first Linux OS. My first Linux OS. So now if you ping my first Linux OS, it's going to Peng your IP address. You see right here the one that you specified in the EFC file. So that's what Etsy file does. It. So small, a very tiny version of DNS that's sitting in your machine. The next one we have at C says config and network file. This file, sorry, this network I believe. Now know probably if I'm right. So this is the file where you specify your host name as well. Right now it's empty because we have hard-coded the host name. But if you want to change it, you could modify it here. And certain other parameters can be set to. Of course, you are more than welcome to look it up more on the network file. The next file that we're going to be covering is actually the vile. Where you specify your IP address on all the network or the subnet mask and gateway. And when you are in the directory at C says config network scripts. I want you to do LS minus LTR. And the last file you're going to see is ISG, ENM E and P 0, S3. And what is this? The last one. It's actually your interface. If you go, IF config, and you'll see right here, this is the name of your interface. So remember, every time all those interfaces for August started, I, if C of G dash and the interface name. So when you VI that file, here you will see the boot product is defined as DHCP. You could change that at here, static and then you could define the IP address. You're going to find subnet mask gateway. And this way your IP address becomes permanent and your machine does not change. So these are the few, few of the files that I really want you to understand and memorize it. Because if you are going to go into Linux jobs and you're going to be applying for it. Oftentimes you're going to get questions on these words. These files are what the files do where they're located, and so on. So let's exit out of this file. The last file I have is at C resolved our calf at CSU resorbed our calf specifies your DNS server. Dns server is again once again, if actually resolve host names to IP, IP to host name and hosting him to hostname. So if you define it here every time you go to and hit Enter, it knows Google is I have to go into this is my gateway. I have to go to My Gateway, which is right now acting as a DNS server. I'm going to go to my DNS server and ask, where is Google and how to translate google to IP address. And it has translated, and this is the IP address of google. Let's go back to our lesson. The next one we have the network commands. The network commands we have learned ping already. If you wanted to ping a server, let's say Peng, that's a server outside that the command that you will run as pink IF Config tells you what your interfaces are in the system, we have right now three interfaces. The local one is not count as an interface. And other one you can ignore. The only one that I have is just one and it's right there and it's telling me my IP is configured this have up or down. If you want to bring down this interface, if you don't want to network, you could type up, sorry If down or if you want to bring it back up your type. Then the next one we have netstat nets that you can run with different options. I run a, are in B. This one tells you your gateway, how your traffic is flowing from, which interfaces is flowing from. And the last one we're going to cover is TCP dump. Tcp dump. It actually traces every single transactions that are leaving your machine and coming into your machine to the command to run is simply TCP dump. You have to specify either the interface, which interface you are sniffing. It's basically a snipping tool. And then you run it and you'll see every listening coming in, coming going out. It's actually listed here. So that's how you actually run this TCB command as how you run all these commands and please memorize it. Please run a man command on each and every one of them and familiarize yourself how these network commands and files work. 10. 4 NIC Information: Nick information. What is the neck? Neck stands for network interface card. That is something that is attaches to your computer, your desktop, or your laptop. If you look at the backup your laptop, you will see the little port where you connect the, the Ethernet five or six Cat 5 or 6 cable to it. That's the card installed in your computer. And the port that is associated and are attached to the card. That port is called neck. In Linux or in computer world, it's called neck. An example to find the information about the neck is that you run a command eat tool followed by the name of your neck. And how do you find out the name of your neck? Think it. Think about how do you find out the information about your neck? You run the command ipconfig, that will give you all the interfaces of your computer. Now, if you run ifconfig, you will see other nics as well. What are those? Well, there's one of the neck that you will see that shows up as LO L sands for loopback device is a special interface that your computer uses to communicate within it self. It works as a diagnostic and troubleshooting and to connect servers running on the local machine. So it's like you can say a private communication within itself. Then you have another Nick that you probably will see in your machine. If it's a virtual machine, it's via IRB 0. This dance for virtual bridged 0 interface is used for NAT. Nat stands for Network Address Translation. The virtual environment sometimes use it to connect to outside network. So I don't want you to really focus on the RB 0 or even l 0, because you will be seeing this, but there's not a main function of this. The only function of the interface that is used to communicate to other computers is a different. The third interface, which is usually labeled as if it's an Oracle Virtual, its E&P, or if it's a regular server, you probably going to see ETH 0, 1, 2 or so on. So we will run this command eat tool in our environment and see how we could get the information about our interfaces. So we'll go into our Linux machine, and this time I want to log into my system using cancel. So the cans or you could use police session too if you want to. So let's see if I have a PT session. I'll just execute the party session right here. But in order for me to run party session, I need the IP address. How do I find the IP address? How do we find it? Ifconfig. Now you should be comfortable enough to run this command all the time. If config, I'll put more because if it's if it doesn't fit on the screen, it'll give me, give me one page at a time. And the IP address that I have for my interface is this 192, 168 dot one dot 20. I login as myself. And in order for me to run the IIT tool command, I have to be root. So IM route. Let's clear the screen. Let's get rid of this one. Minimize it since we already have the buddy. Let's make it a little bigger. And now we'll talk about the interfaces. Again. How do we check our interfaces IF config, as you can see, we have the main interface right here, which is the one that is used to communicate to other computers or outside world, and it has IP assign. The next one is l o, which I have already explained. And the third one is via IRB or 0 already explained in my slide. I want to get information of the ARO. So let's say eat tool and V, B are 0 and it will say link detected, no. So forget that. Then next one we want to do is eat tool linked redacted. Yes, but there's not much information that's out there because it's the system's its own interface. So we'll have to worry about that. The one that we have to be concerned with is eat tool, DNP 0 as three. Where do I get that? Right from here. See this interface. This is the name of my interface. So I will run each tool followed by the name of my interface and I'll hit enter. Once I hit Enter, I have right here, my command output starts from right here. This is what it's telling me that setting for interface support reports is T's TTP supporting link modes. It supports 10, which is 10 meg, 100 meg, and 1, 10, 100 meg, what is 100 megabits? One gig. So my interface supports one gig of traffic. Nowadays, if you're running your computer on a very high-speed network computer, you will see ten gig right here. So a few things that you do have to get out of this command. E tool is one, that it's link mode is 1000 or 10000. Second you have to know, of course the speed is one hundred, ten hundred megabytes, which is the same as this one, then you need to know it's duplex is a full half-duplex. These are the things you have to provide to your network administrator because when your computer is connected to a switch and switch has to be configured for your port to allow the traffic to come in and leave your server. Your system, your network administrator will ask you for that information. So be ready for that. And remember, the command to find that information is eat tool. And the last one is length detected that you're your interface link is up as active. It's not down. If you are troubleshooting it, you could find it. If you see no here, then it means there's something wrong with your network card. I try these commands, run man command on each tool, and try with different options that is given and see what are the options gives you the exact information that you are looking for. 11. 5 NIC Bonding: Hello everyone. Since we are on a network configuration part of the Linux will talk about Nick bonding. We're exactly the neck bonding is just to let you know Nick bonding is one of the very important and critical aspect and Linux number configuration and this type of questions are asked oftentime in an interview. So let's see. A neck and neck stands for network interface card that is attaches to your computer. So if you look at your laptop or behind your PC, you will see a little port in there. And the airport is your neck where the neck which network interface card bonding is also known as network bonding. It can be defined as the aggregation or combination of multiple neck and do a single bond interface. It's main purpose is to provide high availability and redundancy. So let's look at our picture. We have this four NIC cards on our computer. So what we do in NYC bonding is we take two ports, we combine them together. And the reason we combine them, because what if one port dies, we still have another port. So this is for the redundancy. So another way to make two ports redundant or to have them high availability is you combine them together. If a port is one gig and the other port is one gig, you combine them together to aggregate them and get the throughput of two gig. This is achieved for high availability and link aggregation. So Nick bonding procedure is that you type myProp bonding, which is to get the configuration of your driver in for mining to get the information of your bonding. Then you create a file called Deaf conflict bonds 0, you add it the first Ethernet 01, you added a second Ethernet and you combine them and 0.2 bonds 0. If you have Nick one file, you create another Nick to file for the second neck. And then you create a third file called bond 0. You point your NIC 1 and NYK two files to word bond 0. And then what do you do at the end, you'll restart the network of your computer. So sub-command is system CTL restart network. So without further ado, I will log into my system and I will tell you exactly how Nick bonding can be done. And before we start this virtual box, I want you to take it's snapshot. The reason I'm taking a snapshot is soviet go. We could revert back to a state which is where it is right now after we do all the configuration. So click on right here you see snapshot, click on snapshot. And right here says take, click on the Take, leave the snapshot number one as a name Default and click Okay. Now it has taken the snapshot. Now I want you to click on setting To Network. Click on Network Adapter to check enabled network adapter and select bridged adapter. Now, we will have two Next on our computer, which is one here, adapter one and adapt to two. If you want more adapters, we could go to the Chapter 3 and 4 and check on enabled network adapter. But we will work only Chapter 1 and adopted to at this time. And I want you to click Okay. So once the setting is done, go ahead and click on start. Go ahead and log in as yourself. Okay, when you have the desktop, right-click on your desktop and open up your terminal. I would like to make the cost of the terminal a little bigger. Okay, go ahead and type dev, config and do more on the output. And here you will see now we have two network interfaces. One is and ENP, S3 and the second one is E&P x2 as eight. E&p as aid is the one that we just added to our Oracle VirtualBox. Now what we want to do is we want to combine these 238 together and make a bond. Are these two interfaces become root first. Let's clear the screen. Now, I will open up a document that I have that has all the commands and configuration in my document. This document is also added as part of your handouts. So before you do this exercise, I want you to also open up this document from your handouts. Have it side-by-side while you do the configuration of bonding. So I have already opened this document. Okay. So now it says just follow the directions. It says Add a New neck. If it does not exist, installed bonding driver, myProp and bonding, you will need to install this. A few don't have bonding enabled, but let's say if you do have it or not, so do Mod Info, bonding. And I want you to do more on it. And once you do more, and if you get the output and description says Ethernet channel bonding driver version three dots m dot one. That means you already have the driver installed, which is the MOD probe and Linux. So you don't have to worry about installing it. So you can move on to the next step. The next step is to create a new file called ICF g dash on 0 right here. And I have to create this file in this directory, in this path. So if I copy and paste is now going to work, so I have to type it. So I go back into a machine and I'll do the eye at C, says config network, CFG, dash bond. Now you are in VR mode, hit I to insert, and I want you to start typing exactly what's written in there. Please make sure don't make a mistake. Type is band. Name of this bond is bond 0. Bonding master. Meaning was the master of this binding is it's a self, so yes. So boot to a new type none or static, it means the same thing. So type none on boot. Yes. Ip address. I'm sorry, there's a mistake. It should be just IP ADD or the IP that I have pecked is 192, 168 dot one dot 80, because I have already typed this IP before and I know this IP does not exist, nobody has taken it. But if you wanted to confirm if this IP is not taken, you could just go into, you could open up another terminal and do Peng 192, 168 dot wonder AT and you will see you and you're not getting a response back on that IP. So it means it's not taken. So I'll use IP. I'm assigning the static IP. Net mask 25, 25, 25, 25, 25, 25 000. Gateway. Gateway is the IP address of your modem. And then bonding underscore options equal mod 5. I'm picking mod 5. And what exactly mod 5 is? Me, I'm on as this is the speed and state. I have also included that in my document exactly what these options mean. And I want you to review them and you will know exactly what it means. So now you could just save and exit the file. Okay, once you have that says bonding options detail can be found here. You see right here, it has all the options we packed. If you remember, we picked option 5, which is transmit load balancing. You could read about it. And then MIMO, which is a monitoring MRI link monitoring frequency in milliseconds we picked a 100. Okay, so next step is This is added the first nic file, which is E and P x2, x3. So I am root directory. I'll go into config. Just drag this a little more so you can see a little better. Says conflict cd network scripts. And in this directory I already have a file called PCFG, E&P X2, X3, movie I. And now I have here I said delete the entire contents. So how do you delete it? And the VR, you do DD, DD, DD, DD, DD, DD, DD. Until you go to the bottom. You are at the bottom and says no lines in buffer, That's good. Now hit Enter and hit Insert. You have, you probably have to hit Insert couple of times to get it. So now keep typing what exactly it's in there. So type Ethernet device, E&P 0 S3 on Booth. Yes. You want to have that hardware address. This is a new one. Now this is the MAC address of your E and P 0, S3. So what is my hardware MAC address? You have to open up another terminal and the bad drag it. And then just type dev config and do more. And you will see E&P S3 has a MAC address of this. So what I'll do is I'll drag this a little bit on top. I'll bring the other window and the bar in the back. And now I could type the address 0827, S3, 0, 0 0, pointing AT verified to 7300, 28 years. And then master. It's asking you who's your master? The master is 0, which is the other file that we created before that hit Enter slave or US slave, meaning this interface, is it a slave? Will say yes. So check again, boot, polo, boot or we messed one. Oh no, we didn't know it's there. Type would put a device on boot hardware address, which is the MAC address master as Bandura and slaves this okay, now save and exit. Okay, now follow the directions. Okay, now it says create the second neck file for E&P as eight. I will create a second one or I could just copy this E&P S3 and change the name and MAC address so it will be easier. I could just copy E&P X2, X3, and I name it CFG dash E&P 0 S3, and take up replace three with eight. Now it's copied. Now VI CFG E&P eight. Now in usaid not you have to change this. Third line says device 038. Yes. Yes. And now the MAC address will be different. We're back to your other command that is open. Drag it up, and you will see here the MAC address for E&P aid is this one. So once you have it highlighted, drag it down so you can see it. And now change it. It has this changed after the three octets? So 0, D, 17, Nine be okay bonds. Your master is, the bonds are o slave. Yes, I am slave. Four bonds 0. Then, right? Quit and save the file. The file is saved. Now I want to restart service system, CTL, restart the network service, network, restart it, enter by running. If config, do the more on it. And you'll see now the IP that I have assigned or so it says write a 192, 168 wonder AT It's master and the other ports, sorry, other next, E&P 0, S3, NSAID. You see here right here it says, you'd have slaves and slave. So IP assigned as given 192, 161 died AT. I'm going to take this IP, plug it into my police session and see if I could connect to it. When they to 160, eight. Wonder AT there, enter. Yes, I could connect this as just a SSH key warning sign. You could just accepted to save it and login. And yes, there you go. So now you know that your interface is combined together to and pointing it to bond euro. Any other instructions that we have, we could go down. We can also see here, it's telling me that I could verify the setting by doing cat. Let's see, PRO bonding and non-zero. And I do that. I should not have a polonium make this bigger. And now you'll see here when I did the cat, you see it says currently active slave is this one. It is load balancing slave interfaces this and seconds limb interfaces this. Now once it is done, I want you to revert back to your original VM. So just close it, powered off clothes and says power of the machine. You power it off. Now go to your Oracle virtual machine right here. And first, once wait for it to power off and goal setting and then come to network congruent network adapter to. I'm checked the one we checked before. Click Okay, now it should not have the second adopter. But I want you to click now to the snapshot one and click on restore. Now this is going to restore to the original state where we had before. Here it will create a, another snapshot of your current state, which I don't want you to do. So I uncheck this box and click Restore. Now it is restored to exactly same where, where it was before we started this lesson. Alright guys, I hope you enjoyed it and please try it on. This is, this, this is one of the topic. It as very important you will be working on a physical machines most of the time and you have to do number of bonding. 12. 6 Downloading Files and Apps: Downloading files are applications. Well in Windows, when you have Windows machine, Windows, PC, or laptop, if you need to download anything like an application or a game or a file, what do you do? You actually open up your browser, type in the link, in the URL if you know the exact link and you click it, it'll take you to that page and then you click on that download link again, the next one and it downloads it right? Right here. But in Linux, we don't have the GUI. So how do we download a file or how do we download an application that we need to download? Well, there is a tool and Linux that's called W get. W stands for worldwide verb and get is of course to get it. So get it from worldwide web or to the internet. This is the command that you will get. An example. Off of. The command is W get followed by the exact URL where the file is located. If the file ends with dot tar or dot zip, our MSI, whatever that is, you specify the entire URL in the W get command. Now, the question is, why? Why do we even need to download and he filed or any application or any program? And then that's a very good question, right? But there's one thing that you're missing, and that is the jump command. You're probably thinking of the yum command when you have a Linux machine and you need to download any package or any file, you can just simply go to them, followed by the name of the package or the file and then install and it downloads all loads for you. As in this example, you have a server and the server goes to another server to get a file. In this case is the server is a mirror or the repository where the Zhang goes and install all the packages. But that server does not have that file that you're looking for. Then it goes to another server, our computer, we'll go to another server. But that server is not listed as one of our repository. So what do we do? How do we get that file from, from that server to our server? We get it through the W get command, and that's how we install it into our machine. So let's take an example of our Linux machine. I will run the Ws, W get command in our Linux machine and see how it works. I will run it through the party. But before I run it to the party, what do we need? We need the IP address of our party session, sorry, off our Linux machine. And how to find the IP. This is something that you should know by heart. So I have 18 to 16, 11, 12. I'll put that in here. 192, 168 dot 10, 12. I will login as myself. And the reason I have this IP instead of 192, 168, 56101 is because I have in my virtual machine, if you go to the setting and you go to network, I have bridged adapter. If I had host only adapter, then there will be a communication between laptop and this virtual machine. But now I wanted to actually go outside of the network. So that's why I have this bridged adapter. And how am I connecting on my laptop or my desktop as to the wireless, right, so just make sure you have these settings. So I do, and I know I have this IP address. I've used a buddy up, put a dye IP address I am in. So now I'm just simply go in and minimize this. And I'll minimize this as well. And I will take an example of, let's say, I wanted to install buddy in my Linux machine. So in order to install it, you have to run YUM command. And before you run jump command you have to be a root. So I'll do yum install. That's a command to install any kind of putting any kind of packages or file you're looking for. Okay. So the young went outside to his repository and asked her you have to pack a putty. It says no, I can't. Sudo command party, please make sure jump. Sorry, I did run the command wrong. It is yum install buddy. I'm sorry, but that's okay. Mistakes happen, right? Okay, so yum install httparty, you hit and enter. And then you'll see at the end it says no package buddy available, arrow, nothing to do. So it did go out to the yum repositories. It did not find the pay package. Now, this is a perfect example. Now at this point I do need a party package for my Linux machines. And what do I do? Well, you need to find out where the link a URL of the recession is. So I'll go into a browser and I will type in and I'll go to download party. I'm just going to the Windows machine and to the web browser so I could get the link to download the party. So this is a package for Unix source archive. This is what, this is the one I have to download. So I'll right-click to it. I'll go to copy link location. So it has copied the link location. I'll come here and just type that location here just to make sure that it does show me download the file. Yes, It will see. So you just cancel it. Now you go back to your Linux machine and now at this time you type W, yet, it's a long link. So just make sure you extend or maximize your window space. You right-click on your keyboard and it will paste the entire URL for you. So this is the URL and once you hit Enter, see it is connecting, it is downloading. You'll see that amazing, amazing. We have that package now where is it? It will be downloaded in the current working directory where I am and where am I at this time? Let's do PWD. I'm in route, so it should be in the root. And this is it. Buddy dash 0 didn't version that target gx. So that's the reason we need that W get command. So some people or users or developers who cannot find their packages that are on a third party vendors website. They could use W get command to actually download a file or package or whatever that they're trying to install. 13. 7 curl and ping: Curl and pink commands. What do we need them? Well, those two commands are so useful when you are troubleshooting system network related issues. So if you are a system administrator and you get a call from someone who says, hey Mike, this server is not reachable or this machine is out or down, or I cannot pink this address, or I cannot reach this website. So what are the first few things that you need to do? Well first thing and are that you tried to communicate to their server yourself to see if you could reach it, right? How are you going to communicate to it? So there are two very basic commands. One of them is curl and the second one is Peng. So you have this Google website that you go on Windows, you log in, you go to Perfect. You could reach it so you know how it is, but what if your Linux system, you don't have the GUI or you can open up a browser. You have to find out how that works, right? Just like the W get command. So for that we have in Linux, we have curl. Now curl is specifically is for the URL. So as you can see, it's C and then URL. So you grab that URL and see whether you could get to that specific HTTP site. So you could ping the site. Let's say if you are pinging, it will come back with the IP address. It will try to ping that IP address. And you will see, hey, the server is up, okay? But if the surveys or what if the page is not up for Passover and the page is actually run by a, what? It's run by Apache HTTPD. What if the server is up and pages down? Then you need this curl command, which is very handy command to find out if that page is up. And of course the other one is the Peng. Peng you, you ping the server if you are server a and you wanted to see if the server B is up or not. You Peng that server by its host name or by its height IP address. So the example and then x for curl is that you specify the HTTP and entire URL, and it will bring you back the content of the page. Now exactly the way it looks when you open up a browser, but it will bring up all the HTML source code, most likely, or some other information. But when it brings it back, it means that page is up. Then you also have curl minus 0 uppercase O option. If you wanted to download a file, remember, we could use W get command as well. Well in some computers, but if you don't have w gauge, you could use curl command to download a file to your Linux machine. And of course at the end we have Peng if you want to ping a server by host name, which is let's say, or your system host name, where the fully qualified domain name you could use pink command. So we will try a curl and Peng one by one in our Linux machine. So this is my Linux machine and this time I wanted to log into the Linux machine to putty. So before we get into the party, I need to know the IP address of my Linux machine. And my IP address is right here. You'll see when I do 168, 120. So now you see that one a2 always comes up if you have the network adapter set as bridged adapter, and if you are connecting to the Internet to wireless, make sure the name is connected to wireless. Or if you are hard-coded with the wire, then you pick the wire cable connection in the name. Anyway, so I know the IP address. Now I'm going to open up my buddy session and I'm going to put in my IP address 192, 168 dot one dot pointing, I believe has confirmed it one more time. Yes, it is 20. I'm going to go ahead and click Open login as root. Okay, So I am logged in as root or who confirm that? I'm rude. And also by the prompt right here, it says the prompt is pound. So I'm gonna make this a little bigger as well. So now let's say if I wanted to go to a website and I wanted to make sure that website is up or not. So let's try our simple website. As always, google. Hit Enter. And you see all that stuff that came up on the screen. There's so much other stuff too. But you don't really need to worry about what that stuff is or how to decrypt that, or how to understand HTML. To understand that, all you have to do if you run the curl followed by the host name or the URL. And you get this entire page with HTML coding and stuff like that, then it means that your website is up. You could reach it. Good. So if you wanted to ping it. So you could do ping This will only ping the IP address of Google. You see the IP address of the Google right here to 16 581768. So it could change. So you could ping it by the host name, which is cooled out communists URL or you could paying by the IP address. So let's say if I ping it by IP address to 16, to 17, 68, you'll see you're getting a response back, and that is Google. You can always do NS lookup on this to find out Which website is that. And you'll see this website belongs to these names. These names translates to, which is the pointer record translates to Google. Anyway, what if you want to download a file from, from the Internet using curl command? For that, you need to know the exact URL for, for the files that you're downloading. So I have on my browser, I have a page open which is download party. So if you know, you could just go to, let's say Google and and type download Purdy. It will bring to, bring you to this page. Click on go to Download. And you see right here, this is the MSI file which runs on Windows. We are now trying to download it on Unix or anywhere, but in Windows, then you could use this one if you're trying to download on Linux and you could use this one anyway, it doesn't really matter for this lesson because I'm just trying to explain you how you could download so you can pick any one. Let's say if I pick this one, right-click on the link. And you see right here says Copy link address. Click on that. Once you copy it, you could verify that by opening up your notepad and then you could paste it here. You see this is the entire link for that tar.gz file. Now go back to your police session. And now this time type curl, dash, uppercase O, and right-click, which will paste your copy link to your screen. Once you have that, go ahead and enter. And you'll see it's downloading it. It tells you the statistics of the download. Now, is it downloaded? Where is it downloaded when it will download which ever directory you are in, you are in slash route. So we are in route and let's see if it could verify do ls minus l. And you'll see right here, this is the file that we just downloaded today. Today's date and time. So this is how you download if you don't have W GAD or if you wanted to specifically download through the URL. This curl and Peng commands are very useful. Also, a lot of people an interview would ask, tell me the commands are different ways that you can troubleshoot. If a server a can I reserve a b, then you could simply mentioned that you're going to use the ping command, you're going to use the curl command. If it's a web URL, you're going to use different commands to check it. Also going back to Peng, if you are pinging google and you will notice that this is going to pink continuously. Now sometimes if you are on Windows machine and you try Peng Google, ping it three times and will stop. So to use that pain on a Windows machine, you would have to, I believe use the option minus S minus T, one of those options. So please try it. I'm, I'm, I'm very sure that the minus t or minus i S option I'm sorry, I don't have the exact option, remember right now, but try those so it will pink continuously and you will see the packets are dropped or what, how long it's taking for the ping to go and ping and come back. So these are the two basic commands that I wanted to cover with you. Try them out and just play around with it. All right. 14. 8 File Transfer Commands: File transfer. There are many commands that are used to transfer files from one computer to another. As long as you computer is connected in the network, you could transfer files or directories for one server to another. Some of those commands are FTP, which stands for file transfer protocol. This is one of the old legendary commands that are used in many different operating system. It is still used in Linux, Windows, and Mac, and many of the operating system does command is used. Next one we have SCP, which is a secure copy protocol. And then the next one is rsync command. This command is mostly used by system administrator to perform files backups from one system to another. They could schedule those commands through Cron job to copy all those sync, our sync files. So let's look at a few of these commands in our Linux environment. Here we have our Linux machine and I'm logged in as myself. So when you want to copy a file, let's say I wanted to copy a file that is called My First file. The first thing I have to do is type FTP and the machine name that is going to, which is the destination server. Okay, so as an example to FTP files from your server to another server, I have logged into my legs machines myself, and we'll see who we are. We are self. So before you try to do a transfer, just see if you could ping Google, because without internet, you won't be able to transfer any file. Now, I could hang Google, it means my computer is on the network. Now, where do we have to transfer and what do we have to transfer? Now, of course, you do need a server that is running FTP daemon, meaning your server. You're a client and a server that you are trying to connect should have FTP daemon running and a daemon name is VSFTPD. For this training, we do not have an extra external FTP, so we will try to connect to the Red Hat FTP server just for training purposes. So the command to run as FTP space, FTP dot red And you will see as soon as you are connected, it will ask you for the password, for the username and a password. So you provide the credentials that are given to you by the Red Hat support. So when you enter the password and username, then you will enter the command put and the filename. And that's how it will be transferred to, to the, to the FTP site. Now, if you're trying to transfer to a server that is now running the FTP daemon. So let's say in our environment, we have ps minus EF and we'll grab for FTP. And you will see there is no FTP daemon running, right? So as as a, as a training purpose will cry transfer FTP to our own server. And our own server is local host, or the name of our host, which is my first Linux host, Linux OS. So first Peng, my first Linux OS. You'll see you are getting a reply back, right? So it means you are connected to your own machine. Of course. Let's clear it out and now try to do FTP. My first Linux OS. And a US hit Enter, you will see it says Connect, FTP, connect connection refused. And why is that? Because my server on my Linux machine is not running The demon and the demon is the one that listens to the incoming traffic. Anyway, this is how you run the FTP command and you transfer the files. And again, the purpose of doing FTP is if you have an issue with your system and you troubleshooting it and you involve support, whether it's Red Hat, our CentOS or Windows or whatever, the support that you have involved, they would ask you to send the logs and they will give you the FTP server account information and credentials. So you would have to run FTP command to send the logs over. The other command that we wanted to cover is sep. Sep is basically copying. A file from one machine to another, and of course it has S in front of us. It means it's carping it securely. So let's take an example of a file that we will want to transfer it. Let's see which directory that are in your home directory. And let's say I have a file called right here, la-la land. So I wanted to take this file, copy it from machine to machine B. Now of course, we don't have a machine B. We rewind your transfer, so we will use our own machine and pretend that it's remote machine. So the way it works is we're going to do scp, Lala Land, which is the file that I'm trying to copy your work. Where am I trying to copy your copy over to another machine? Remote machine. So we're pretending they're remote machine is, which is our own machine, of course, my first Linux OS. And then you put colon, which is first as a host name slash, where are you copying it to? So let's say I wanted to copy it to my home, my user directory and the directory I want to copy it to, let's say Seinfeld. Seinfeld is a directory a wide to copy that file into that folder. So once you have that command, hit Enter. And it says could not resolve host name my first Linux OS or yeah, because I have misspelled. First, the either the type of things that you probably would have to troubleshoot, you hit Enter. My first Linux OS. Still have coming up. So what we do is we'll just take out this part. So I'm just gonna, what I'm gonna do is I'm going to copy this and I'm going to paste it. And then hit enter. Okay, so it s saying that connect to host. My first Linux OS port 22 connection refused to. It is refusing a connection. Why is it refusing? Not sure, but let's try to do localhost. Yes. So you put in the password, of course, your own password because you are logging in as yourself on the machine as well. This is your own password. So once you put in the password, you will see it says la-la land, a 100 percent completed. So in bytes and the right end, 0.5 kilobytes per second. This is the amount of time it took to travel. So it did transfers. Now let's verify if Seinfeld directory has their la-la land file in it. So which directory I'm in, I'm in home. I have. So let's go to Seinfeld. And now Alice to do ls minus l t or. And you'll see right here, this is Lala Land. There you go. Just to confirm, ETC. Host my first Linux OS. So it has 18 to 16, 14. Okay, so now I know, so this one, I have hard-coded my host name with 182, 168, one day 14. And I'm sure why it didn't work because, uh, my IP has probably changed by now. So it's probably hitting some other device in my network. And you see it? Yes, it now my Linux machine is one out there teen. And the reason I was not able to connect because wonder 14 is probably one of my other laptop or my iPad or some other device in my home network that got that dot 14 IP. And when I ran the SCP command was actually going into that device. Perfect, It was a very good example. Now you guys learn as well that How important to us at C file, host file is, I'll go ahead and modify that, become root. And I'll do VI at c host. And I'll just take these two entries out. I'll just leave these two and close. So now if you run that command that we were trying to run before hit up arrow key. Up arrow key. No, sorry, we were as logged in as yourself, right? So now when you run that command, you will see it will give us a prompt. They go see right there, this was one rate. You hit Enter, see, it's connected. The next one is our sink. And this'll tell you exactly if I just type are single, tell you how you can copy files. If you just wanted to itemize the changes, it will also tell you the progress of it. So this command is used. It's a very famous command now, and it is used by many system engineers to do and to perform file systems back-up. 15. 9 SCP Secure Copy Protocol: Hello. In this lesson we are going to cover SCP, which is secure copy protocol. Now the secure copy protocol, or SCP, helps to transfer computer files securely from a local host to a remote host. It is somewhat similar to FTP, but it adds security and authentication. So if you are transferring a file again from server to server B, you could use SCP as the protocol or the command rather than FTP. And the reason it is preferred is because it is secure, it adds more security and authentication. Now the protocol, as I said before, the protocol is a set of rules used by computers to communicate. So when the SCP was built, they decided, okay, this is the protocol that SCP should use, and this is the port that should be used to transfer a file from one server to another. The default sep port is SSH port 22. So there is no different protocol that was established or setup for SCP. It actually leverages onto the same SSH protocol that we use to connect from one server to another or SSH. Now, for this lecture, again, we needed to Linux machines. One is for the client and one is for the server. The client is where we have the file and the server is where we want to transfer that file to the client. I have my Linux machine and it is called My First Linux VM. For the server, I have a server which is exactly the same as client as well, but I named it linux CentOS 7. So the process is the SEP. The process in the graphical way is you have a client, a client be server. Now client a wants to copy a file over to server B. Now it will use the protocol SCP, or the command is CP, but it actually transfer that over through the protocol we already have in place, and that is SSH. So there is no new protocol for that. It actually piggyback on SSH. And of course the SSH port is 22. And the service for SSH daemon should be running under recipient or the remote server in order to accept incoming incoming traffic. Okay, what's the process? The SEP command to transfer files to the remote server. First of all, you have to log in yourself, then create a file, any file, let's say v. In this lesson, we are in this lab, you'll create a file called Jack. Once the Jack file is created, then we will simply run the command SCP. Finally, in Jack, I absolve is the username that actually exist on the remote server. At 192 168 dot x is the app, the app actual IP of the remote server. Of course, replace that x with the digit, that is the digit of your remote server. And the last part is colon slash home slash. If so, this is where you want the file to go to in this directory on the remote server. Once it's connected, then it's going to ask you to enter username and password, and it will transfer the file successfully. Now, Enough is enough. Let's actually start our Linux machine, which I have already started, and I have already logged into my party. This is my Linux machine and I refer to as my client machine because this is the one that connects to the server. And this machine host name is Maya first Linux VM. Who is logged in? Who am I? I'm logged in as myself. If I follow the directions here, I'm going to create a file called Jack in my home directory. In my home directory is slash home slash. I have solved. I'll go ahead and do touch Jack. And I do ls minus l TR. You will see I have a file called Jack. It has 0 bytes. Now, I wanted to transfer that, but before I translate, put something in there just to make sure it is transferred with the right content. So let's do VI on Jack and just put Jack as Jerry, these uncle. That's it. Do LS minus LTR. Now you see it has total by 22. Perfect. Now we need to transfer this file to our remote server. But before we transfer that file to the remote server, we wanted to know what is the IP address of that remote server. So I'm going to go into my remote server, which I also have it open. And I'm going to do ifconfig E&P 0 S3 because that's the interface where the IP is assigned and the epi is 192, 168, 158. Beautiful. Let's go back to my client. And now this time I'm going to run the command. Let's clear the screen so you could see it better. Now run the command SCP, the name of the file, which is Jack, the name of the user who is going to log in to the remote server. What is a remote server? 192 168 dot one dot 58. Yes. And then colon slash, where is it going to a rich directory, it's going to home. I also hit Enter and it's going to ask you for the password. If you are doing SCP for the first time, then it's going to ask you for the fingerprints where you have to type in yes. And then enter the password. So go ahead and and password. And it says a jack, which is a filename, a 100 percent transferred and the size was 22 and this is the time it took to transfer. Okay. I got this message on the client, but let's confirm on the server whether it was transferred or not. So first of all, it was transferred as I absolved. So I have to log in as I absolve. So who am I? I am I absolved. Beautiful. Now, which directory am I logged into? I am in my home directory because that's where I transfer the file right? Now I will do ls minus l t r to check if that Jack file came in. It did. Perfect. Now, is this the right file that came in last category? We did the cat, Jack is Jerry's uncle. Perfect. This is how the SEP works. And you could also do the same thing, by the way, SCP, to go into this remote server. If you wanted to pull something out of that server from server to the client, and you just have to reverse the command. Anyway, try it out. And these are the couple of commands, a few commands that I wanted to cover and very important commands when you are dealing with transferring files from one server to another. 16. 10 rsync Remote Synchronization: Hello. In this lesson we are going to look into our sink. Yes, another utility to transfer files from one machine to another or copy from one machine to another. And then our sink stands for Remote synchronization. What exactly are Sync is a utility for efficiently transferring and synchronizing files within the same computer or to a remote computer by comparing the modification times and size of the files. So basically transferring files from one server to server B. And the way it works efficiently is because it looks at the modification times and the sizes. And the size is, let's suppose two gig, it will trash for the first time. To give it a second time is four gig. It will only transfer that change, which is to get not the entire four. Good. I'll tell you in a little bit more about it. Now the arsenic is a lot faster than those tools like FTP or SCP. This utility is mostly used for the backup of files and directories from one server to another. A lot of system administrators and engineers actually have rsync command or utility running and the crontab to actually copy files every day. Files are modified files from one server to another as a purpose to back them up. The default, our sync port is 22, which is the same as SSH. Ssh uses. So there is no rsync server that you do need to install on the remote server to accept the incoming traffic, it is going to use the SSH protocol, just like SCP uses the same protocol, SSH or Sync does the same thing. So it piggybacks on port 22 for SSH. For this lecture again, we need to Linux machine because we need to test from copying or synchronizing file from one server to another. I have my first machine is my first Linux VM, which is I referred to as client because I transfer files from that machine to another. And what is another machine is my server, which is which I created another CentOS VM and I named it linux CentOS 7. It has the same specification as the first machine that I created. Nothing changed. The only thing change is the host name. All right, let's look at more graphical or diagram way so I'll make you understand how they are singularly works. So you have a server a or client that needs to go to server B and it needs to transfer those files over the utility are sync. Now, our sync uses SSH or piggyback or SSH to transfer the files. And for that you need SSH DNS servers running on the destination server where the files are going. And the port by default for SSH ED is 22. Now it, what it does the arsenic, it actually copies and copies the destination. Keep the same copy, the same size and the time from source to destination. How it works. Let me show you right now. If you have a two meg, the size of the file is two meg of a file. It transferred that very first time, the exact same size to map. Next time someone comes in and change that file. Now the file size become from two meg to eight meg. So now you need to transfer this file from server to server B. So now this is the beauty of our sink. It is now going to take your entire eight meg and copy it over again. It will actually subtract those two meg that was copied earlier and only copy the one at the difference and the file which is six MEG, meg and then ultimately the first half or the first two meg plus the six meg, it's going to make, combine them together to make it eight mega. Similarly, if the file grows from eight to 20 meg, the sink well let's subtract the difference and only transferred the difference over to the destination server. All right, Let's look into that aside how the command works. So basic syntax of parsing command is our sample space, the option, if you want to specify any option, then the source, what are you copying or transferring destination, where are you copying and which location? Install our sink in your Linux machine. So first thing we need to do is if our sink is not already installed or the command is not available, we have to install that utility. But first before you go ahead and install, check if it is already installed. So if it's not, do gem install our sink and CentOS Red Hat distribution In been to Debian, you do apt-get install our sink, then our sink or fall on a local machine. So you need to copy a file from local machine. Within local machine. You need to do, let's say if you wanted to tar. So for that, let's create a backup of the entire home directory and we put it in a tar and then we back it up with our sink, a directory on a local machine. Our sink a file to a remote machine. And we will our sink a file from the remote machine. All right, so these are the steps you will take. So I know it's a lot of information throwing at you, but we'll try one-by-one and on, showed you understand by the time it was done with this lecture. So I have my Linux machine open. This is my Linux machine, which is my client, and which is my first Linux VM ups. Okay? Now what I need to do is I need to make sure I have the arsenate package installed before I actually go in and do yum install, let's do RPM dashed QA and grew up for our sink. Beautiful. It is there. By the way, I am logged in as myself. And again, my host name is my first Linux VM. And to check if the package is installed or not, you don't need to reroute. You could just simply do an RPM dash key way. But if you need to install a package, then yes, then you need to run yum install RSpec with the root credentials. All right, now we have confirmed that we do have arcing package. Now let's get into the fun part where we are going to do the rsync, a file on a local machine. So I am in home, my home directory and I do LS minus LTR. You see all these directories and files. What I wanted to do is I wanted to put all these directories and files into a tar file, into a container and target. So for that I'll do tar CVF backup. This is a name I wanted to give it once it's archived and Tarde. And what I'm trying, I'm trying everything within the same directory and this is the same directory which is PWD. When I did it, it's home I absorbed. So that's why I'm using dot. I could have used slash home slash hives all as well. But since I'm already in this directory, no need to specify the absolute path. Go ahead and hit Enter. All right, So it has toward all the files and directories into backup dot tar. You see it? Is there. Perfect. Now I'm going to use the arcing utility to our sink. This backup dr into another directory and then another directory I'm picking is slash temp sash backups. So before I do that, I wanted to create that backup directory, which I don't have it created yet. So I'll do MKDIR slash temp, said backups. Perfect. It is created to test. You could do cd slash temp sash backup. And there you go it is. And you are in slash temp site backups. That's how you confirm it. Anyway. Cd back out. Do PWD just to make sure you are in your home directory. Yes. Now, run the command, our sync, dash z, vh. If you wanted to know every little detail about each of these options that I'm using, then you should run the command man, our sink. And it will give you the information about every option that is available to you. Here are the different options. Anyway. Our sync dash z, VH backup, which is the file name that we created. And backing up where it's going to tell me temp backups slash temp slash backups. Good. Hit Enter. There you go. It's sent, it says 1.06 bytes, received 35 bytes size, and it took 7754 bytes per second is a transfer speed. So now go to CD tmp slash backups and check verify if the backup dot tar file came through or not. This well as my US LTR, it is there. Nice. Okay, Now, next thing we wanted to do here, let me move this up. Err on the side, right here, sink a directory on a local machine. So before we sync file, now I wanted to sink a directory. So let me go back into my home directory by just typing CD and hitting Enter. Now do PWD, you're gonna see is home I absolved do LS minus LTR to see the content inside of my directory. Now again, you probably have a lot of different files in your home directory that you might not see on my screen because I make a lot of changes when I go through making videos. So don't worry about it if my contents don't match with your contents. Okay. So our sink or directory. So to do that I wanted to our sink, everything that I have in this directory to. This temp backup directories. For that I will use the command rsync, VH slash home slash I absolve. Perfect. And move this up. And I'll put it this window right here so you know exactly where I am. Okay, And now where I am copying it to slash, temp, slash backups, hit Enter. Bengal. Beautiful work. So let's go to 10 dot backup. Verify everything that I have in my home directory which is which is slash home slash I haves all, you know is everything has been synchronized here. Perfect. Now let's talk about the part right here. Let's move down. It says rsync of file to a remote machine. Now. Now for my remote machine, I have this as my remote machine and I call it Linux CentOS. And the IP address for this remote HomePod remote machine is IF config E&P 0, S3, it is 192, 168, 150. This is the IP address and this is where I want to transfer. So let's minimize again. So I'll go into my home directory. And I wanted to copy or rsync the backup dot tar file. Now before I arcing this over to the remote server, I want to create the destination folder where this is going to go. So I will go back into my server and I'll go into slash temp. And here I will create a directory called backup backups. And as myself TR, and you're gonna see right here at the bottom, it has been created. Let's clear the screen now let's go back to our client machine. This is our client machine. Now we're going to use the command, our sync dash AB, z backup. That's a file you wanted to transfer over. Now, you want to transfer over as what user? As myself. Okay, which machine is going to? It's going to 192, 168, 158, which is the IP address we just checked on remote server. And a which directory it's going to colon slash temp slash backups. This is the directory is going to go ahead and hit Enter. It's going to ask you for the password for the I absolve on the remote machine and put in the password. Beautiful. It is transferred, sent, it tells you a lot of information and speed and everything. Now, once this transfer is your job to verify has been transferred, go to your CD slash slash backup directory, do ls minus LTR. And you'll see right here, this is the one that's been transferred. Perfect. Let's move on. Let me minimize this. Now the last part is right here at the bottom it says rsync a file from a remote machine. Now BY to go to the remote machine and fetch a file from there. So which file are refreshing? So first let's make a test file, dummy file. So I'll go into my home directory because on the server I'm logged in as myself. Here, I'm going to create a file, call it server file. Do ls minus LTR. And you're going to see the server file. Is there. Perfect. Now, if I come to my client machine to PWD and do LS minus LTR. You see I don't have that server file, so I need to bring or pull that server file from the server. And for that, I will have to do our sync dash a, d, z, h. I've saw because this is the username I was used to login to the remote host. What is the IP of the remote host? 58. Perfect. Now, where is that file that you are trying to bring? The file is in home. I absolved and the filename is server. File. Perfect. Now, when you bring it, where do you want to save it or copy it to? I like to copy it to my temp backups file or directory going to hit Enter, it's going to ask you for the password. Perfect is sent for three bytes. Now where did it go? Let's verified. I ask it to come to my slash temp slash backup directory. Do LS minus LTR. And you're gonna see right here it says server file C. That's how you fetch a file from the server. So anyway, there are different options that are available on our sink that allows you to do like dry runs, allows you to do arcing continuously, allows you to do only, only deltas, meaning only the changes. You just need to pick the right option to use. Which option works for your own requirement. For luck. 17. 11 SSH and Telnet: Ssh, telnet. These are the two main services that run in Linux to accept connections from outside. Telnet is an old, an unsecure connection between two computers. And a lot of companies don't use tenant anymore. Sage is a newer connection established protocol that is completely secure. There are two types of packages for most of the services that you see on a Linux machine. One is a client package and the other one is a server package. So you have a server. It sends a connection request and SSH request to another server. So in this case, you are the client and the computer you're trying to connect as a server. So let's take it the other way. So if you on the right-hand side and their server is on the right-hand side when it tries to sink, it's time to you. As through the NTP protocol. Then it's no longer the server, it becomes a client, and then you become the server. So let's look at our SSH, telnet, both of these services that we have and how they work in our computer. I will connect it through a recession. And I'll confirm I am root. It's clear the screen. And the service that runs. The first one is tell it. So when you run Telnet, you'll see it says command not found. Why? Because by default now Linux don't include Telnet and the installation. So if you have to install Telnet, you will have to do is yum, install Telnet. And it will go to the repositories and it will find it will match the the option I have for tonight. And it found one package. And it's telling me, Do you want to download. Now we will not be using tonight in our environment. But if there is if you are troubleshooting tenant is sometimes a tool that allows you to troubleshoot some of the issue, some of the network communication issues. But for this lesson, we will just skip that and we don't want to download that. Next one. We have the SSH. Do we have SSH? Yes, we do. That's why we got this usage of SSH. We could do SSH to followed by the IP address of the remote computer. But since we don't have a remote computer, will just say local computer, which is the same box that we are trying. We are already logged into. When you do hit Enter. Yes. You're logging in as rules of putting the root password. And you logged into the same machine that you are logged in before. So you can create as many sessions you want. So you can exit out and you will come back to your first session to check the service of ss. H, d will run PS EF to see if the process is running. And you'll see the process is right here. It says user has been SS, SSH and D. This is the process that actually listening for all the incoming traffic. If I stop this process, I will not be able to log into this machine anymore. But before we do that, I wanted to check my P and my IP address is 192 168 dot 10, 12. And let's go ahead and stop the SS HD service. And you hit enter, you get the prompt back. I mean it's not running. You could do ps minus EF again to grab it. And you will see the SSH D and SSH deed. This is this already established connections is telling me, but it is not showing the one we look for before. We just use it, sbin, SSH, D. So it means it will not accept any incoming sessions anymore. How can we confirm that? Let's log into a new party session. And I will put in the IP address of this machine again, 192, 168 dot one dot 12, ccs. Now what their connection refused because there is no SSH Ds demon that is running. So we'll click OK, close this out. And this time we'll start the SSH D process. It started because we've got a prompt back. How do we verify it? You can run ps minus EF again, SSH D. And you will see right here, the process is running now. Now it will accept the connection. Another way to find out if that's services running this by doing system CTL status. She and right here is telling you active, active and running. So now if you try to connect to that IP were nine to 16 e1.eval. You should be able to 192 168 dot 10, 12. Bingo. You see how SSH D works. So this has how you could stop the connection to your server or refine or restrict your computer. This is a weight, an enhanced way to implement security on your system. 18. 12 Hostname and IP lookup: Host name and IP address lookup. What exactly that means is if you have the host name and you wanted to find the IP address, how does it work? We do have DNS, Right? And there are protocols that we run like paying. Or we go to a browser and we type in the host name or the website name. And it resolves to an IP itself because those are the type of protocols that knows that it needs to resolve IP address. First. If you don't have those protocols and you just wanted to know the IP or host name, then you will just run the commands like NS lookup and dig. That two major commands or tools that are given to us in Linux. I believe they are also available in Windows. I'm sure NS lookup is, but I'm not sure dig is available. But you could also dig for dig to find out if the egg is available on Windows. So what exactly these tools or these commands do for us? Again, they resolve host names to IP, IP to IP, or host name to host name. Let's look at them. By logging into our system. I'm logged in through the console. And the command I will run as NS lookup. And you run this, it will bring me to its own menu. And if I type here, it is giving me the IP address of google. What is right here? Right here is our resolver, meaning this is our DNS server. Our DNS server, since we are running our machine local to our modem. So our modem is our DNS server. And our modem is also accepting requests for DNS and DNS port runs on port 53. And when you see the message here, non-authoritative answer. It means that when I type NS lookup for that IP, I, the my modem does not have the information for that It went outside on the Internet to find that information for me. That is why you see that here non-authoritative. If I had the information for Google saved in my local computer or in my local DNS server, then I would not have seen non-authoritative answer. I would have gotten the street name and address. So you could quit out of it. Or Control C out of it, cleared the screen. So you can also run NS lookup is simply followed by www dot. Let's say this time we'll do And you will see the Hotmail IP address is right here, two or 47917 to 12. If you type this IP address and to the Linux machine or in your Windows machine, you will get host, you will get the page that are associated with this IP address. Similarly, the same command works for deg, and you will get the same answer, but a little differently. So some people use NS lookup and some people use DIG. Nowadays, a lot of people uses and more inclined toward DIC command as compared to NS lookup. Ns lookup is a very old utility and you could get a lot more information out of dig command as compared to NS lookup. So try as lookup or dig command on different websites like And then try to see if you could get this IP and resolve it to the page they should go going to. So in our example, we could try to open up our server right here, sorry, our browser. And in this browser, as quote, some of the tabs in this browser, I will type the IP address that shows up. For Facebook, which is 31137136. You hit an Enter. See, it took us to the Facebook took us to the Facebook page. That's how the Internet DNS works. It does not know the name, it only knows the IP addresses. But since we are humans, we tend to remember the names instead of IP or digits. That's why it becomes easier for us to do, is to use DNS that actually translates host name to IP address. To try these two commands a few times, do run man command on them and see how it works. 19. 13 Network Time Protocol NTP: And TP, this is the second service that we wanted to learn and disservice stands for Network Time Protocol. The purpose of this service is to synchronize your computer's time to another server in case you lose your time, time drifts from seconds to minutes. And when you are running a few servers, more than one in a clustered environment, and you're running your workflow. So in corporate environment, it becomes very, very imperative that you have all your servers synchronize with one clock. So at the time on shift, so the file that will be configuring for NTP, it is at sea and service to run the NTP demon is system CTL, start or restart and TP demon. And the command to check whether it is synchronized or not, we will have the command and TP running. So let's get into our server and we will do some configuration. Or if the configuration is already there, we'll go over it and we will restart the service. This is our Linux machine and we are logged in as root. And the first thing we have to do is check whether the NTP package is installed or not. So you will run the command RPM minus key way and type and HTP. It's telling you that I do have the NTP package installed. If you do not have this package installed, then you could just run yum install NTP. And of course, you will get the option to hit Y because it will tell you these other package it and if it found and this is the size of the package, do you want me to install it? And you will hit Y and a will install it for you. Since I already have installed is telling me already installed and a little bit the latest version. So let's move on. The next thing you would do is to modify the file. file has all those comments that starts with hash pounds, so just ignore them, go to the line that has Server. Now in my configuration, I have previously selected the server eight dot eight dot dot eight. This server resolves to what? If anyone knows any guesses? The servers ofs to Google. It is a Google DNS server. This is configured for to provide your DNS resolutions as well as some time people use it for network Time Protocols. So I have set it up a dot eight and that's what I'm going to use it. The other ones are the CentOS predefined. I'm not going to touch them and that's it. I'm just going to save it if you don't have it set up, I want you to set it up as a dot-dot-dot and then save your file. Once the file is saved, run the command system CTL and start your service and the service name is and TPD and DCE against dance for daemon. Daemon is a service that would never stop and just keep running as a process in the background to listens to the request that comes in. How do we know we have started the service? You do have status. And right here it's telling you that NTP service is running good. So another way to find out whether the services running is ps minus EF command and grab for NTP. Here you will see this line telling you the NTP server is running and the process ID is 4340. You could kill that command by typing killed 43 400. Ntp. Q is the command that will bring you to an interactive mode when you hit enter, you type peers. And it will tell you which servers you are connected to to get your time. You are getting your time from Google. This is the first server, if you remember, we just configured it with a dot-dot-dot, dot-dot-dot eight. And that is the Google server we getting our time from at the other ones are CentOS servers. So if you have confirmed it is getting its time now, we'll just quit out of it. And if you wanted to stop the service, we'll just do stop. And it has stopped. And if you wanted to verify it, you'll see there's nothing in there. So NTP is another one of the service that every system administrator should know. And it is very, again, very imperative that you, all your WorkFlow Servers should run NTP to have time synchronized between them. So try this NTP with different servers and F1. 20. 14 chronyd Newer Version of NTP: Chronic D. Now Connie D is a demon that is the latest version that is used nowadays to replace an NTP demon. Now why did they do it? Because it probably have most enhanced features in it. So we'll cover their chronic D in this lesson. So the purpose of chronic D is again for time synchronization, exactly the same way as NTP that we had covered before. The package name that you would need to install. Or this program is called chronic D. The configuration file is at C This is where you go in and specify the NTP server. Now again, TP is used to synchronize your system clock with an external clock or any other clade within your organization that serves as NTP server. Then we have a log file for Granny D demon, and there are log file, all the recording are all activity are logged into our log Ronnie directory. And then we have a service, of course, when you configure the chronic file, then you have to start or restore a chronic service. And by now you should be familiar IT system CTL, starred quantity d and the program command that you can run and cranny C, which will tell you which anti-B clock you are sync word, what's the status of it? So let's look at our Linux machine again and we'll try out this new feature or this new program that is used in Red Hat and CentOS. Okay, so I have logged in as myself to our Linux machine and of course to a console. See who we are. Our self, which host? Rv pond. We are on our correct host machine. Now, I want you to become root. Okay, Now check if we have the package. And the package name is chronic. So it's RPM minus QA. Again, rpm is script that will list all the programs that we have in the minus Option Q and a. And we'll grab for chronic D. And when you hit enter, I think it's just like crania and believe not ready. Yes. Okay. So I have confirmed that I do have the chronic package. So chronic package, of course. Now what's the next step we always do once we have the package installed, we configure it, right? So let's go into our configuration file, which is at C file, hit Enter. And this configuration file pretty much looks the same as file. And we will have to go to the line where it says server. This is where you define your NTP server. And as you see the first server, second there, there are four servers that automatically defined. And these are the actual servers. Set it up by CentOS that put a new line. And I'm going to have the server as Paul dot and TP 4k. Now this is also one of the server. So you know what? Just as for giggles, we just sink it would Google a dot-dot-dot eight. So of course this is not an NTP server by Google. This is just a DNS server, but just for practice and training purposes, I'm just putting that in. So this way when we check the status will see it is connecting to the goal. Anyway, you escape bottle-fed and do write and quit. Now you saved it. Now the next step is you have to start service. So to start the service, first check if the system services running. And system CTL status. Cry d. And it says right here, it says inactive. Okay, So we have to make it active. But also one thing I wanted to mention that please do not run NTP and quantity at the same time. So check the status of NTP as well. Sorry, anti PD. And if it is running, I recommend you to stop it so it is running, as you can see here, right here it says active. So let's start with because we don't want to run two services that performs or that serves the same purpose. Let's do status and stop. Now it has stopped. The NTP. Just verify it. And it says inactive, right. Okay, good. Now also, I want to disable it. So it does not get started at the time, at the boot time, the Disable, and now it is disabled. Now I could go ahead and do system CTL, start. Cranny D. Okay. They started. Let's check the status. Okay, it is active. Okay, now we have to enable it. So it gets started at boot time. It is enabled now. Okay, so now the program that comes with this package, it's called chronic DC. So it's crony space. And then CCF, I think it stands for command to run crony, see. And when you hit enter, it will bring you into an interactive mode or program mode of its own cranny. See, so now a new type help. You'll see there are so many commands that you can run within this program. But the one that I wanted to run, it's called sources. So this will tell us where do we go right here. So this would tell us which NTP server we are connecting to. So I'll type this command. So while I'm in crannies, see, so its sources enter and you will see right here the first one, if you guys remember that I picked eight dot, eight dot, dot, dot. So this is the Google server that we are sinking our time too. And of course this is not actually an anti-B server. I just picked it for training purposes so you could exit out of it. I think it's quick. And I will go ahead and modify my cri de file again, and I will remove this first line. Once it's removed. This way, I'm not hitting Google had DNS server for some different purpose. Anyway. So now it's modified, removed, and now do restart on the service because he just modified the configuration file. Every time you modify configuration file you have to restart it service. Now run this grainy, see again. And now you do sources. And you will see now it's going to a different server which is defined in there depending on what is it resolving to. So that's the topic about chronic D. Again, it's a replacement for NTP. It has a newer features. You can look up online whether the new features and was a difference between NTP and quantity. 21. 15 Tracing Network Traffic traceroute: Trace route, trace the network traffic. So in this lesson, we are actually going to learn and try to understand how we could troubleshoot network issues if you are having any network issue in our environment. And one of the commands that is mostly used to see where your traffic is going. Which gateway or rich DNS server. It's going from one to another to the third. And finally, how is it going to reach its destination? And to view that entire tracing off those network traffic, you have to use a command, trace route. And this is the command, I believe it is also available in other operating systems as well in Windows, I believe it's called trace Aarti. I'm not sure exactly what is the command. And Mac or other operating system. Anyway, we are our focuses Linux. So let's see what trace route does. The trace route command is used in Linux to map the journey that a packet of information undertakes from its source to its destination. One use of trace route is to locate when data loss occurs throughout a network, which would significant signify node that's down. So as it says, we just need to find the tracing from source to destination, how the packet went through from one to another. Because each hub in the record reflects a new server or a router between the originating PC and then tended target, revealing the results of trace route scan also lets you identify slow points that made adversely, that made adversely affect your network traffic. So it could be many different pieces, are many different machines or gay was in the middle while your traffic is flowing that affect your your traffic flow. And that's how once you know, hey, I know this is the machine that is the troubled machine that is causing my network traffic to fail. You could find that out if I by running the command trace route. Now, the command itself is just simple trace route and the destination host name or the IP address or URL. In this case, if you are trying to go to a URL, let's say,,, or wherever you are going. Or if you are in your local environment, in your corporate world, you probably have an IP or a host name of your machine. Then you can run trace route space, the host name as long as your machine or you are running the trace route, can resolve that host name to IP. If it cannot, then make sure you put in the IP address. Okay, Let's get into my Linux machine and then we will try these trace route command on it and see how it works. So I will go into my console. And first thing, I want to make sure I am online so I could just do pink any website. So you'll see I'm getting a response back, so I am online. So now let's run the command phrase route. Now, when you run it, you have to specify the host name. If you are in your environment, in a corporate environment, and you are running your infrastructure and you probably have a lot of servers, so you have to specify the host name if it can resolve it, otherwise, the IP address. But for us, since we are using the lab environment, we'll just do enter. And you will see the first hub is going to do is it's going to jump on to our modem. This is my modem which is also a gateway to my traffic's at the first hub it is doing is going to my modem. And this is the time it takes to go there. And it didn't cause any issue if there was any hand time there, it will tell you this is going to take that much long time to go to the second half. Second hub is going to add another gateway right here, which is most likely my net ID IP, which is the internet IP address or the internet IP gateway, IP. And then it will tell you it did 12 all the way through 14 hops to get to this IP address, which is the result IP address of So this is how you could actually use a trace route utility to find out how your traffic flows from your source to the destination. The reason it went to my gate there first is because that's how my gateway is defined. And to find out your gateway, you can run the command netstat minus r and v, and you will see the gateway I have all my traffic should flow from the gateway 192, 161, that one. It might be different in your environment depending which environment you're working on. You are doing this lesson through your work, then you will have a different one. If you are doing from home, then most likely you will have the same IP address of your gateway. So this is about the trace route. Try to find it, how you can troubleshoot. Many times people also ask what are the different ways you could troubleshoot networking related issue in the operating system. So you could also bring up this trace route command. And this is one of the main command that will help you troubleshoot network related issues.