Screen Shot 2024-12-21 at 6.05.16 PM.png

now in this setup we will be introduced to the Routes.

Routes define the path that packets take to reach their destination. In networking, a route has two main components:

  1. Destination:

    This specifies the target IP range (subnet) or a specific IP address to which the route applies. For example:

  2. Gateway:

    This specifies the next hop (typically a router's IP address) where the packet should be forwarded to continue its journey toward the destination.

How it works:

When a host needs to send a packet:

So now we should put the ip of the interface r2 as gateway of the route of B1 and since routers are designed to connect different subnets. For traffic to leave the host’s subnet, the router must first receive the packet from the host. If the host and router are in different subnets, the host cannot directly send packets to the router because:

so the interface r2 and b1 should be in the same subnet so they will have the same mask and b1 ip should have the same network bytes of r2

same thing for host a with r1