Connecting Networks with Packet Tracer
In this activity we will configure two different networks connected to one another and ping a device on one network from the other.
Network Devices
To start Drag and drop two 2911 Routers onto the page from the Network Devices section
Next, click on the “End Devices” section and drag and drop one PC below both Routers. Your network should now look like this:
Now lets connect the devices. Click on the Connections Tab and Select the Copper Cross Over Cable
When the wire is selected, your cursor should then turn into what looks like a tiny Ethernet cable. Click on Router1 and select the GigabitEthernet0/1 port then click on Router2 and select the GigabitEthernet0/1 port
Your network should now lool like this:
Notice the red triangles on the wire, this shows that the interface is currently down
Next Click on the Copper Straight-Through cable
With that Straight-Through, click on PC0 and select the FastEthernet0 port
Take the other end and click on Router 0 and connect it to the GigabitEthernet0/0 port
Use the same copper straight through cable to connect PC1 and Router1 via PC1’s FastEthernet0 port and Router1’s GigabitEthernet0/0 port
Your Network should now look like this:
Lets start configuring the network, start by clicking on Router1 and moving to the CLI tab
Once in the CLI tab enter these commands to configure Router1
-
Router1> enable
This moves the user into Privileged EXEC mode. This gives you the ability to view configurations, save things and enter configuration mode. The user EXEC is limited to basic monitoring
-
Router1# configure terminal
This command brings the user into Global Configuration mode where the user can make changes to the router’s running configuration. This includes setting IP addresses, routes and protocols.
-
Router1(config)# interface g0/0
You must enter the interface context to assign IP addresses and enable the port. This interface is the port connecting Router1 to PC1
-
Router1(config-if)# ip address 192.168.10.1 255.255.255.0
This command assigns an IP address and subnet mask to the routers G0/0 interface. This makes the router’s interface part of the 192.168.10.0/24 network. Allowing it to communicate with PC1 and act as its default gateway
-
Router1(config-if)# no shutdown
This enables the interface. By default, all of the router’s interfaces are shutdown. This command brings the interface up so it can pass traffic
-
Router1(config-if)# exit
Moves you back one level, from interface configuration mode to global configuration mode. Like using ‘cd ..’ in ubuntu
-
Router1(config)# interface g0/1
Enters interface configuration mode for GigabitEthernet 0/1
-
Router1(config-if)# ip address 10.0.0.1 255.255.255.252
This assigns Router1’s G0/1 an IP in the 10.0.0.0/30 subnet. This creates a point-to-point link between Router1 and Router2. The /30 mask gives exactly two usable addresses (10.0.0.1 and 10.0.0.2), which is perfect for router-to-router links.
-
Router1(config-if)# no shutdown
Enables the G0/1 interface
-
Router1(config-if)# exit
Brings you from the G0/1 configuration to global configuration
-
Router1(config)# ip route 192.168.20.0 255.255.255.0 10.0.0.2
This command creates a static route telling Router1 how to reach the 192.168.20.0/24 network (PC2’s LAN) via next-hop 10.0.0.2 (Router2’s G0/1). This must be done because Routers only know about directly connected networks. Static routes teach them how to reach remote networks.
-
Router1(config)# end
Exits configuration mode back to privileged EXEC
-
Router1# write memory
This command saves the running configuration to the startup configuration. Without this your changes would be lost if the router reboots. This makes them permanent
The finished screen should look like this:
Next lets exit out of that and click on Router2. Navigate to the CLI tab and enter these commands to configure Router2
-
Router2> enable
Moves you into privileged EXEC mode
-
Router2# configure terminal
Enters global configuration mode
-
Router2(config)# interface g0/0
Enters interface g0/0 configuration mode
-
Router2(config-if)# ip address 192.168.20.1 255.255.255.0
Assigns Router2’s G0/0 an IP address and subnet mask. This makes Router2 part of PC2’s LAN and allows it to act as the default gateway for PC2
-
Router2(config-if)# no shutdown
Enables the interface
-
Router2(config-if)# exit
Returns to global configuration mode
-
Router2(config)# interface g0/1
Enters interface g0/1 configuration mode
-
Router2(config-if)# ip address 10.0.0.2 255.255.255.252
Assigns Router2’s G0/1 an IP in the 10.0.0.0/30 subnet. - This creates the point‑to‑point link between Router1 and Router2. Router1 uses 10.0.0.1, Router2 uses 10.0.0.2
-
Router2(config-if)# no shutdown
Enables the G0/1 interface
-
Router2(config-if)# exit
Brings you back to global configuration
-
Router2(config)# ip route 192.168.10.0 255.255.255.0 10.0.0.1
Creates a static route telling Router2 how to reach the network (PC1’s LAN) via next‑hop (Router1’s G0/1). Routers only know about directly connected networks. This static route teaches Router2 how to reach PC1’s subnet.
-
Router2(config)# end
Exits configuration mode back to privileged EXEC
-
Router2# write memory
Saves the running configuration to startup configuration
The finished screen should look like this:
Next click on PC1 and navigate to FastEthernet0 under Config
Enter in the IPv4 Address 192.168.10.2 and the Subnet mask 255.255.255.0. This gives PC1 a unique identifier in the 192.168.10.0/24 subnet. Without this IP address, the PC cannot communicate on the network. This IP address must match the subnet of the routers so that they can communicate with each other. The 255.255.255.0 defines which portion of the IP is the network and which is the host. This ensures that PC1 knows all addresses with 192.168.10.x are local.
Next go to the Settings tab under config and enter in the default gateway 192.168.10.1. This tells PC1 where to send traffic destined for outside its subnet. Router1’s G0/0 is the gateway to other networks. Without this, PC1 can’t reach PC2.
The Settings tab should now look like this:
Next, exit out and click on PC2 and go to the same config tab
Under settings enter in the default gateway 192.168.20.1. This points PC2 to Router2’s G0/0 for traffic outside its subnet. This allows PC2 to reach PC1 through Router2 > Router1.
The settings tab should now look like this on PC2:
Under the FastEthernet0 tab enter in the IPv4 address 192.168.10.2 and the Subnet Mask 255.255.255.0
Congratulations you have successfully set up your network
Let’s test to see if are work is correct!
Lets try and ping PC2 from PC1. Click on PC1 and go to the command prompt
Once in the command prompt enter ‘ping 192.168.20.2’ which is PC2’s IP address
If everything was done correctly then the output should be something like this:
Now lets setup a simple firewall on Router1’s G0/1 interface that blocks all traffic on that port
Open up Router1’s CLI
-
Enable
Moves from user EXEC (Router>) into privileged EXEC (Router#)
-
configure terminal
Enters global configuration
-
access-list 100 deny ip any any
Creates ACL 100 with a single rule: deny all IP traffic from any source to any destination. This is the simplest possible firewall - it blocks everything.
-
interface g0/1
Opens the G0/1 interface
-
ip access-group 100 in
Attaches ACL 100 to traffic entering Router1’s G0/1 interface. This means any packet arriving from Router2 (including PC2’s traffic) will be blocked before Router1 can forward it to PC1.
-
end
Back to privileged EXEC mode
-
write memory
Saves the running config to the startup config
The finished screen should look like this:
Now lets try and ping PC1 from PC2
Open up PC2’s Command Prompt and enter ‘ping 192.168.10.2’ (PC1’s IP address)
The ping fails! Congratulations you have successfully setup a firewall