Monday, 18 March 2019

Run levels in Linux

This document is intended to brief us about the Linux booting procedure. 

Once the kernel finished its loading, /etc/initab file is loaded.
The /etc/inittab file is used to set the default run level for the system. Applications/services that are started by init are located in the /etc/rc.d folder. Within this directory there is a separate folder for each run level, eg rc0.d, rc1.d, and so on.

There are 7 Runlevel in linux 0 to 6 explained below,

0 - /etc/rc.d/rc0.d - This is system HALT - this run level will shutdown the system.

1 - /etc/rc.d/rc1.d - This is single user mode - booting with this runlevel will boot with basic command line interface without loading network modules/graphics. Doesn't allow non-root login.

2 - /etc/rc.d/rc2.d - This is multi-user mode - When booting with runlevel 2, network module is not loaded.

3 - /etc/rc.d/rc3.d - This is multi-user mode with network - Boots with network modules and allows multi user modules. System will be booting normally.

4 - /etc/rc.d/rc4.d - This is still undefined/not usable can be user defined.

5 - /etc/rc.d/rc5.d- This is similar to the init level 3 which boots with X11 graphic interface.

6 - /etc/rc.d/rc6.d - This is reboot - When runlevel 6 is called it will reboot the system.

Init is the program that bring up all the other processes. It runs as a daemon and Process ID for Init is 1. This is the first process to run on a linux/unix machine. 
You can provide which Runlevel the system will boot with as a kernel boot parameter.

Thursday, 28 February 2019

Network Gateway

Network Gateway
In computer network, a network gateway is a device/software which acts as a gate between intranet/internet. Any piece of information that is on the internet and you want to access them without passing through the Network gateway you will not be able to access them.
Like the name gateway -  It is like a gate in your room where without opening your gate you cannot access/reach outside world.
A network gateway can be a router/L3 Switch/Proxy Software/Firewall.
When you assign gateway IP to a desktop/server you must confirm that from your desktop/server you are able to reach the gateway using ping.