11.3 Configuring a network
In this section you will configure and test a simple network using Packet Tracer Anywhere.
First watch the video below, which is about 5 minutes long. This video reminds you of the need for IP addresses and demonstrates how to configure a simple network using Packet Tracer Anywhere.
Box _unit7.1.3 Configuring a network
I’m now going to look at an example of two networks joined by a router which is, as yet, unconfigured.
When you’re configuring a network it’s always useful to construct a table giving the IP addresses you intend to use. From my table you can see that PC0 and PC1 are in the network 192.168.1.0/24 and PC2 and PC3 are in the network 192.168.5.0/24.
You already know that switches operate at the Network Access layer of the TCP/IP stack (or the OSI layer 2), whereas IP addresses are used at the Internet layer of the TCP/IP stack (or the OSI layer 3).
So why do we need to give the PCs an IP address? In the early days of local networks, when they just carried local data, IP addresses wouldn’t have been needed, just MAC addresses. But a MAC address is meaningless on an external network, so we need an addressing system that will at least deliver inward traffic from external networks to the correct destination network. Unlike the MAC address (or any other form of address that has only local significance), the IP address and the subnet mask are meaningful on external networks.
The subnet mask isolates that bit of the address that relates to the network, and is all that’s needed to get the data across other networks to the destination network. At the destination network, though, the host part of the IP address is unique to the receiving device, but there has to be a look-up table from which the corresponding MAC number can be read off; we will look at in the next session. Similarly, outbound data from a network needs to be directed at the router, because that’s the gateway out of the local network.
So now I’ll configure the network. I’m using Packet Tracer Anywhere for this demonstration. First I’ll configure the PCs with the IP addresses identified in the table. I’ll start with PC0 which needs an IP address of 192.168.1.2.
I will now click PC0 and click ‘Edit device’ and click the ‘Interfaces’ tab, leaving the default interface as FastEthernet0 and editing the address and the subnet mask. Now I’ll do the same for PC1 to give it the IP address 192.168.1.10. Again, I’m leaving the default gateway unchanged. In the same way I’ll configure the IP addresses on PC2 and PC3, but I won’t demonstrate that here. I’ll just jump forward to the next stage.
I can check I’ve correctly configured the PCs by opening the command line and typing the command ipconfig. Here you can see the correct IP address has been set for PC0.
Leaving the command line open for PC0 I’m going to ping PC1. Here you can see the ping has been successful.
What will happen if I try to ping PC2, which is in a different network? Let’s give it a try. You can see that the ping has failed. That’s not surprising as it’s in a different network and I haven’t yet configured the router. I’ll do that next.
I will now click on the router. Then click on the menu item ‘Open console’ to show the command line of the router. I need to answer ‘no’ at the first prompt ‘Continue with configuration dialog’ and then Return. I’ll type en to enable the privileged exec mode. I now need to type conf t to enter the configuration mode of the router. To configure the interface G0/0 I first need to enter the command int g0/0. This enters the interface configuration mode.
Next I type ip add 192.168.1.1 255.255.255.0. And you mustn’t forget to add no shut to activate the interface. Now I’ll go through the same process to configure interface G0/1 on the router, this time giving it the IP address 192.168.5.1.
So now I’ll try to ping again from PC0 to PC2. It still doesn’t work, but that’s because I still need to configure the default gateway settings on each PC. I have included the ipconfigcommand to show the IP settings. Each PC needs to be configured with the IP address of the router’s Gigabit Ethernet port that connects to that network. For PC0 and PC1 the default gateway is the router port G0/0, which for this network is the address 192.168.1.1. So I’ll edit the settings for PC0 accordingly.
I’ll do the same for PC1, but won’t show it in this demonstration. For PC2 and PC3 the default gateway is the router port G0/1, which for this network is 192.168.5.1. Again, I’ll set this for both PCs, but won’t show it in this demonstration. Instead I’ll jump straight to the fully configured network. I have included the ipconfigcommand to show the IP settings. Now I’ll try and ping again from PC0 to PC2. And this time it is successful.
Activity _unit7.1.4 Activity 4 Sort it out
1. Open PT Anywhere [Tip: hold Ctrl and click a link to open it in a new tab. (Hide tip)] in a new tab or window so you can read these instructions.
In this scenario, two networks – each comprising a switch and two PCs – are joined by a router. PC0, PC1 and the router interface G0/0 are already configured. A ‘spare’ PC is provided at the bottom for use in step 6 of this activity.
2. Configure PC2, PC3 and the router interface G0/1 with the following:
|Device||IP address||Subnet mask|
(Hint: don’t forget to configure the default gateway on each PC.)
3. Can you ping PC0 from PC3? (Hint: you will need to find out the IP address of PC0.)
4. Check the configuration of PC0. Is the default gateway configured? Is it correct? (Hint: check the IP address of the network’s router interface.)
5. Can you ping PC0 from PC3 now?
6. Add another PC to the network 192.168.2.0 and configure it with the IP address 192.168.2.15/255.255.255.0. For this step of the activity, use the ‘spare’ PC provided at the bottom.
7. Can you ping each of the other four PCs from this PC?
In step 3 the ping from PC0 to PC3 would have failed. When you checked the configuration of PC0 you should have discovered that its default gateway was incorrectly set to 192.168.1.0. PC0 is connected via a switch to router interface G0/0 which has an IP address of 192.168.1.1 so PC0 was unable to send a reply to the ping. Once you corrected PC0’s default gateway to 192.168.1.1, the ping should have been successful. When you added the additional PC you should have set its default gateway to 192.168.2.1 to match the IP address of router interface G0/1. You should have found that you could then ping each of the other PCs with the exception of PC1, which also has an incorrect default gateway set.