This tutorial explains how to use a default static route to send packets to a device. Learn how to configure a static default route through a practical example in the Packet Tracer.
By default, if the destination network address of an incoming packet is unknown to the router, the router forwards that packet from the default route. The router or device that is connected to the other side of the default route decides what to do with the packet.
If an administrator wants to capture all unknown packets for logging and monitoring purposes, he can connect such a device or server to the other side of the default route that can process unknown packets. In the below section, we will understand how this is done practically through an example in the packet tracer.
Packet tracer is a network simulator software. To download the latest version of the packet tracer and learn how to install it, check the following tutorial.
Download and Install Cisco Packet Tracer
For this tutorial, I assume that you know what a default route is and how it is configured in Cisco routers. If you don’t know how a default route works or how to configure a default route, please take a pause here and check previous parts of this tutorial.
This tutorial is the third part of the article "Configure Default Routes in Cisco Router". Other parts of this article are the following.
Default Routes in Cisco Routers Explained
This is the first part of the article. This part describes how a default route works as well as also explains the command syntax that is used to configure the default route.
How to configure Default Routing in Cisco Routers
This is the second part of the article. This part explains how to configure default routing in Cisco routers.
Configuring a default route in the packet tracer to send packets to a device or server
Create a packet tracer practice LAB as shown in the following image and configure routing in such a way that it not only allows communication between both networks (10.0.0.0/8 and 40.0.0.0/8) but also forwards all unknown packets to the log server for logging and monitoring purposes.
Assign IP configuration to all devices and routers’ interfaces, as shown in the above image. Alternatively, download the following pre-configured practice LAB and load it on the packet tracer.
Download practice lab with IP configuration
A router stores routing information in a table, known as the routing table. A routing table entry consists of two pieces: the destination network and the local interface that is connected to that destination network.
When we start a router, the router scans all of its active interfaces. If it finds IP configuration on any active interface, it abstracts the network address from the IP configuration and creates a routing table entry that associates the abstracted network address with the interface.
After starting, the router actively monitors the state and IP configuration of all interfaces. If it detects any change in the state or IP configuration of any interface, it automatically updates the related routing table entry.
On the router R1, we configured IP addresses 10.0.0.1/8, 20.0.0.1/8, and 30.0.0.1/8 on interfaces FastEthernet (Fa) 0/0, FastEthernet 0/1, and Serial (S) 0/0/0, respectively. The router R1, automatically adds three entries in the routing table that indicates that the networks 10.0.0.0/8, 20.0.0.0/8, and 30.0.0.0/8 are available on the interfaces Fa0/0, Fa0/1, and S0/0/0, respectively.
On the router R2, we configured IP addresses 40.0.0.1/8, and 30.0.0.1/8 on interfaces FastEthernet 0/0, and Serial 0/0/0, respectively. The router R2 automatically adds two entries in the routing table that indicates that the networks 40.0.0.0/8 and 30.0.0.0/8 are available on the interfaces Fa0/0 and S0/0/0, respectively.
To view the routing table entries, we can use the "show ip route" command from the privileged-exec mode.
The following image shows the output of this command on both routers.
As you can see in the above image, both routers have already added the routing information about the networks that are directly connected to them, we only need to configure the routing information about the networks that are not connected to them directly.
Configuring routing on the router R1
Run the following commands on the router R1 from the global configuration mode.
Router(config)#ip route 40.0.0.0 255.0.0.0 30.0.0.2 Router(config)#ip route 0.0.0.0 0.0.0.0 20.0.0.2
The following image shows how to run these commands in the packet tracer.
Configuring routing on the router R2
Run the following command from the global configuration mode on the router R2.
Router(config)#ip route 0.0.0.0 0.0.0.0 30.0.0.1
The following image shows how to run this command in the packet tracer.
How a default route and routing work
When a router receives a packet on its interface, it reads the destination network address of the incoming packet and locates the destination network address in the routing table.
If the routing table contains an entry for the destination network address, the router forwards the incoming packet from the interface that is specified with the destination network in the entry.
If the routing table does not contain an entry for the destination network address, the router forwards the incoming packet from the interface that is specified with the default route in the entry.
The following image shows how this process works on router R1.
The following image shows how this process works on router R2.
Testing / verifying the LAB
There were two objectives of this LAB: -
- Allow communication between both networks:10.0.0.0/8 and 40.0.0.0/8.
- Forward all unknown packets to the log server for logging and monitoring purposes.
To verify connectivity between both networks, click the PC0 and click the Desktop menu item. From available options, click the Command prompt.
Now, use the ping command to test and verify the connectivity. Ping command sends ICMP packets to test connectivity between source and destination. If the source receives packets sent by the destination in response, the source and destination have connectivity.
PC0 belongs to the network 10.0.0.0/8. To test connectivity from the network 40.0.0.0/8, send ICMP packets to a PC that belongs to this network.
The following image shows how to use the ping command to test and verify the connectivity between both networks.
To verify that all unknown packets will be forwarded to the log server, click the PC2 and click the Desktop menu item and click the Traffic generator option.
In the PDU Settings section, adjust the settings as described below.
- Select any application such as SSH from the drop-down.
- In the "destination IP address" field, set an IP address that does not belong to available networks.
- In the "source IP address" field, fill the IP address of the PC.
- In the "Starting source port" field, set any number from the range 1000 to 4000.
In the simulation settings section, select the Periodic radio button and set the time interval to 2 seconds.
Click the send button.
If packets sent by PC2 to an unknown host (80.0.0.5) reach the log server, it will verify that the second and final purpose of the LAB has been successfully achieved.
The simulation panel of the packet tracer displays real-time events of the network. If any device sends packets to another device of the network, this panel displays that transmission including the complete path of the transmission.
Click the Simulation button available in the bottom-right corner of the packet tracer. In the Simulation pane, click the Start button.
As you can see in the above image, packets sent by PC2 to an unknown host reached to the log server.
In case if you don’t get a similar output, download the following configured LAB and compare your LAB to detect misconfigurations.
Default routing configured LAB
To stop the testing, open the traffic generator option of the PC2 and click the Stop button. To hide the simulation panel, click the Realtime button available in the right-bottom of the packet tracer.
That’s all for this tutorial. In the next part of this tutorial, we will understand how to advertise a default route through the routing protocol. If you like this tutorial, please don’t forget to share it with friends through your favorite social network.