Connecting two networks using a router

Submitted on Mon, 04/22/2024 - 22:51

Let us consider two PCs with following IP addresses:

PC0

5.5.5.1/30

PC1

7.7.7.1/30

From our understanding of IPv4 addressing, we can tell that these two IP addresses belong to different networks. We can see that the network IDs for the two IP addresses are

5.5.5.0/30 and,

7.7.7.0/30

In order for these two PCs to communicate, we will need a router. Let us create a network as follows:

To select a router, go to Network Devices, then Routers and select any router; 4331 in this case.

In order for the router to connect these two networks, the two interfaces of the router should be part of those two networks. Based on the understanding of point to point connection, we can assign following IP addresses to the router’s interfaces:

Interface

IP address

Gig0/0/0

5.5.5.2/30

Gig0/0/1

7.7.7.1/30

Note: The router’s interface and the connected PC should form a single network as a point to point network.

Note: Please make sure to turn on the port status. It is unticked by default.

To make the changes permanent, go to Settings and click on Save button for NVRAM. This copies the running configuration of the router to start up configuration.

Now, we need to define the default gateways for PCs so that packets destined for foreign networks are sent to the router’s interfaces for routing.

Go to the first PC and set the default gateway as 5.5.5.2. Go to the second PC and set the default gateway as 7.7.7.2. 

 

Note: The default gateway should always be on the same network. This way, the packets can reach the gateway directly.

Once that is done, the two PCs can communicate with each other through the router.

Previous: DNS