All About Routing & Routing Table | Routing Table Configuration in Linux (RHEL) | Nehra Classes
All About Routing & Routing Table | Routing Table Configuration in Linux (RHEL) | Nehra Classes
=====================
ROUTING:
Routing is the process of selecting a path for traffic in a network or
between or across multiple networks. Broadly, routing is performed in
many types of networks, including circuit-switched networks, such as
the public switched telephone network (PSTN), and computer
networks, such as the Internet.
Routing is a process which is performed by layer 3 (or network layer)
devices in order to deliver the packet by choosing an optimal path from
one network to another.
There are 3 types of routing:
1. Static routing:
Static routing is a process in which we manually add the routes in
routing table.
2. Default Routing:
This is the method where the router is configured to send all packets
towards a single router (next hop). It doesn’t matter to which network
the packet belongs, it is forwarded out to router which is configured
for default routing. It is generally used with stub routers. A stub router
is a router which has only one route to reach all other networks.
3. Dynamic Routing:
Dynamic routing makes automatic adjustment of the routes according
to the current state of the route in the routing table. Dynamic routing
uses protocols to discover network destinations and the routes to
reach it. RIP and OSPF are the best examples of dynamic routing
protocol. Automatic adjustment will be made to reach the network
destination if one route goes down.
A dynamic protocol has following features:
1. The routers should have the same dynamic protocol running in
order to exchange routes.
2. When a router finds a change in the topology then router
advertises it to all other routers.
The routing table consists of at least three information fields:
1. network ID: The destination subnet
2. metric: The routing metric of the path through which the packet
is to be sent. The route will go in the direction of the gateway
with the lowest metric.
3. next hop: The next hop, or gateway, is the address of the next
station to which the packet is to be sent on the way to its final
destination
Depending on the application and implementation, it can also contain
additional values that refine path selection:
1. quality of service associated with the route. For example, the U
flag indicates that an IP route is up.
2. filtering criteria: Access-control lists associated with the route
3. interface: Such as eth0 for the first Ethernet card, eth1 for the
second Ethernet card, etc.
Shown below is an example of what the table above could look like on
an average computer connected to the internet via a home router:
Network
Destination
Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.0.1 192.168.0.100 10
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
192.168.0.0 255.255.255.0 192.168.0.100 192.168.0.100 10
• The column Network Destination and Netmask together describe
the Network ID as mentioned earlier. For example,
destination 192.168.0.0 and netmask 255.255.255.0 can be written
as network ID 192.168.0.0/24.
• The Gateway column contains the same information as the Next
hop, i.e. it points to the gateway through which the network can be
reached.
• The Interface indicates what locally available interface is
responsible for reaching the gateway. In this example,
gateway 192.168.0.1 (the internet router) can be reached through
the local network card with address 192.168.0.100.
The current recommended way of printing the routing table in Linux is
with the ip command followed by route, as demonstrated below.
[root@centos7 ~]# ip route
default via 192.168.1.254 dev eno16777736 proto static metric 100
192.168.1.0/24 dev eno16777736 proto kernel scope link src
===
Join this channel to get access to perks:
https://www.youtube.com/channel/UCvk2Fst1h1a0StSnUcvGfBQ/join
===
Thanks for watching the video. If it helped you then, please do like & share it with others as well. Feel free to post your queries & suggestions, we will be glad to answer your queries.
If you like our hard work then do subscribe to our channel & turn on the bell notification for latest updates.
===
Contact Us:
Follow our all social media accounts @NehraClasses
Vikas Nehra’s Twitter Handle: http://bit.ly/VikasNehraTwitterHandle
Vikas Nehra’s FB Account: https://www.facebook.com/er.vikasnehra/
Vikas Nehra’s Instagram Handle: https://www.instagram.com/er.vikasnehra/
Registration Form: http://bit.ly/NehraClassesRegForm
Twitter Handle: http://bit.ly/NehraClassesTwiiterHandle
Facebook Page: www.facebook.com/nehraclasses
Instagram: https://www.instagram.com/nehraclasses/
Telegram Channel: https://t.me/NehraClasses
WhatsApp Us: https://bit.ly/2Kpqp5z
Email Us: nehraclasses@gmail.com
===
©COPYRIGHT. ALL RIGHTS RESERVED.
centos 7