Networking in Linux with Practical Examples and Commands

 



• Computer Networking refers to interconnected computing devices that can exchange date and share resource with each other.

Hardware Requirements 

 • Etherent Card, NIC, Interface, Lan Card

 • Cables (wireless/wired)

 • Networking Devices (HUB/Switch/Router) 



Logical Terms

 • IP Address (Public,Private,static,Dynamic,Virtual) 

 • Mac Address 

 • Source & Destination Address 

 • Ports, Sockets

 • Network Address, Broadcast Address

Mac address:- Mac address is the physical address , which uniqualy identifies each devices on a given network. It’s persistent.

 IP address:- IP address stand for “Internet Protocol Address”. The inetenet protocol is a set of rule for communication over the internet.


• Type of IP addres

 1. IPv4 (Internet Protocol Version 4) 

 2. IPv6 (Internet Protocol Version 6) 


IPv4 = 32 bit 

 IPv6 = 128 bit

Bit = 0,1 

 *IPv4 = 32 bit

4 octats = 8.8.8.8

000000000.00000000.00000000.0000000 = 0.0.0.0 (all bit off)

11111111.11111111.11111111.1111111 = 255.255.255.255(all bit on)



• Class D and E are reserved for resarch and multicasting.

IP range of 127 is know as a Loopback adress

Loopback address:- the local host address of the machine.The loopback address of every machine is the same.  


Network bit:- to identify the network 

 Host bit:- to identify the device on the network


                                                 Network address & Broadcast address  



Subnetting

• Subent is a process where we can divide our network into small pices. 

 • Logical distributation of the network in various logical parts are known as a subnetting.  


255.0.0.0 --> A class 

 255.255.0.0 --> B class

 255.255.255.0 --> C class


CIDR = Classless Inetr Domain Rounting

/8 

 /16 

 /24

192.168.1.1/8 --> class A 

 192.168.10.5/16 --> class B 

 192.176.1.1/24 --> class C 


                                                               Public IP

ISP --> Internet Service Provider 

 DHCP --> Dynamic Host Control Protocol 


Router 

 • Communication between different network. 

 • It provide best roues to our packet.


Server-Client Model 

• Server serves services to client. 

 • Clients are the hosts are using services provided by the server. 

 • Request sent by client to any server are in the from of socket.

 • Sockets are the combination of IP address and ports. 

 • Socket = IP address:ports


Ports

• Ports can be understandable as the address os services running over the server. 

 • Request sent by clients over the server where multiple services are served can be identified by the ports they are listening on.

 • Total number of ports we are having is 65535.

 • Out of the above ports few ports are reserves for specific services.



                                                                 Commnads

ping --> to check any host health

 Ip a/ifconfig/ip addr ---> to check server IP

 nslookup --> to check domain IP

 netstat --> to check open ports 

 nmcli device status --> Shows the current status of all network devices

 nmcli connection show --> Lists all saved network connection profiles on the system
 
 nmcli con add con-name manish type etherent ifname ens224 ipv4.method auto --> to connected ethernet card for CLI Method

 nmcli connection down manish --> Disconnects the specified network connection.
 
 nmcli connection up manish --> Connects (activates) the specified network profile. 

 nmcli connection delete manish --> Deletes (forgets) the specified saved network connection.


Note:-
2 network files 
 1. /etc/hosts 
 2. /etc/resolve.conf

 /etc/hosts --> Ping command find such names in hosts file of your system. 

 /etc/resolv.conf --> If no entery is found in /etc/hosts then this search transfered to “/etc/resolve.conf” file which is having entery of the name server.



Thank You 😊😎

Complete Networking 







Comments

Popular posts from this blog

User Management in Linux – Complete Notes for Beginners

DevOps Roadmap 2026 – Your Complete Beginner-to-Expert Guide

What is Public Subnet in AWS? Step-by-Step Explanation with Example