Posts

Lets Learn "Network subnetting ( with examples )"

Image
  In this tutorial, we'll be learning about the network subnetting as in what it is, why it is required, etc.  What is subnet? Basically, a subnet is derived from subnetWORK which means a logical subdivision of the IP network. A subnet is a network inside a network. Subnets make the network routing much more efficient. Why subnetting is required? 1. It improves network performance and speed. Some network protocols required broadcasting the network packets. If there are large number of devices, it means broadcasted packets need to reach more number of devices which can affect network switching performance and hence overall network performace. With the help of subnetting, the broadcast domain is reduced and the packet need to be broadcasted only to the devices that are part of same subnet. Because now we are no longer spamming all the devices, it will increase the network switching performance and hence improves overall network perfomance. 2. It boosts network security. Subnetti...

Lets learn "How to update dns configure in docker on MacOS?"

Image
  In this tutorial, we'll learn about how to modify DNS configuration in docker daemon. If you are not familiar with docker images you can check my tutorial here . So before building the docker image docker builds the context and if some statement in Dockerfile includes accessing the external servers which require special DNS configuration, we need to set that configuration in docker preferences. Below are the steps to do that. Step 1. Open Docker preferences. Click on the Preferences option  Step 2. Go inside Daemon -> Advanced and set the configuration. Step 3. Click "Apply & Restart" from above image. HOPE YOU LIKE THIS TUTORIAL. FEEL FREE TO COMMENT BELOW IF YOU HAVE ANY DOUBTS. AND STAY TUNED FOR MORE TUTORIALS :)

Lets learn "About screen command in linux"

Image
  In this tutorial, we'll learn about the screen command in Linux. Before proceeding to the tutorial I would also recommend going through a small tutorial on tty files in Linux which is available here . Screen command in Linux is helpful to open tty files.  Introduction The Screen is a full-screen program that multiplexes a physical terminal between several processes (typically interactive shells). It offers a user to open several separate terminal instances inside a one single window manager. Installation To install a screen on your system, run the below commands. On Debian based systems $ apt get install screen On Red Hat based systems $ yum install screen. Running screen for the first time $ screen The command will open up a new terminal instance from the current terminal. To verify it you can check the tty (terminal) files. You will see a new tty (terminal) file being created. Checkout this  for more info on tty files. To exit from the terminal opened by screen pre...

Lets learn "About tty files in linux"

Image
  In this tutorial, we'll learn about the tty files we have in Linux, About what are these files, where are these files used, etc.  Basically, in Linux, everything is a file. Even hardware connected to a Linux system is also a special file. tty mean TeleType also known as terminal. Similar to other things, the terminal is also a file in the Linux system. And these terminal files are the tty files. So the definition of tty files ( or Terminal ) can be written as: Its a device, that allows you to interact with the system bypassing the data ( you provided ) to the system and printing the output produced by the system. tty commands in linux tty [OPTIONS]... If you run tty command on the Linux terminal, it will simply return the tty file for the current terminal window from where the command is running. Example Let's take an example to understand this correctly. When someone ssh to a host, it lands you to a terminal. And when there is a terminal, there must be a tty file for that ...

Lets learn "About docker directory structure"

Image
 In this tutorial, we'll try to answer the following questions regarding the docker. Where docker images are stored in the filesystem? Where Docker containers are stored in the filesystem? How docker layers are stored and reused for different containers? So here we'll try to answer all these questions. Before proceeding further I would recommend learning about docker image/container layers work in this tutorial, if you are not familiar already. To get the basic information about the docker info run the below command. $ docker info    ...    Storage Driver: overlay2    Docker Root Dir: /var/lib/docker    ... The above command gives the docker's storage driver and docker root directory.  Storage location for Docker images and containers Storage location for docker images & containers is different in different operating systems.  Ubuntu : /var/lib/docker Debian : /var/lib/docker Fedora : /var/lib/docker MacOS :...

Lets learn "How to run commands on remote host"

Image
 In this tutorial, we'll learn about how to execute commands on the remote system using SSH. In this, we'll assume the source host (from where'll be running the commands from) is host1 and the destination host is host2 on which we'll be executing the command on. Running a simple command [root@host1 ~]# sudo -u root -- ssh host2 touch /tmp/foo ... Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'host2,*.*.*.*' (ECDSA) to the list of known hosts. root@host2's password: [root@host1 ~]# [root@host2 ~]# ls /tmp/foo /tmp/foo [root@host2 ~]# ls -ltrh /tmp | grep foo -rw-rw-r-- 1 root  root     0 Oct  3 15:45 foo Running a complex command By complex command, I mean running multiple commands in one go separated by &&. One thing to be taken care of while running the complex command is you need to add quotes ("") around the command to run the full command on the destination host. [root@host1 ~]# sudo -u root -- ss...

Lets learn "About kube proxy in iptables mode"

Image
In this tutorial, we'll learn about the Kube-proxy in iptables mode. Basically, we'll see how Kube-proxy create iptables that help in load balancing and service discovery. If you are not familiar with Linux IPTables I would recommend to check out my tutorial on IPTables here  first and then come back to read this tutorial. Kube-proxy Kube-proxy when running in iptables mode basically watch kube-apiserver for new endpoints and create corresponding iptables rules and iptables are fully responsible for service discover and proper routing of traffic to corresponding pods. Kube-proxy needs to run on all k8s worker nodes. Below is a small video describing the working of kube-proxy in iptables mode.  src:  https://www.slideshare.net/CJCullen/kubernetes-networking-55835829 Now that we know what Kube-proxy is and how it Kube-proxy works, let deep dive into the types of iptables Kube-proxy adds to the firewall. Kube-proxy added IPTables To learn this let's consider an example. Cons...