Lab 14: Configuring a Default Gateway for Routers and Switches

Lab Objective:

The objective of this lab exercise is to configure routers and switches to be able to communicate with remote networks. By default, devices can only communicate with locally-connected networks.

Lab Purpose:

Configuring a default gateway on routers and switches is a fundamental skill. Default gateways allow routers and switches to be reachable to and from remote subnets. As a Cisco engineer, as well as in the Cisco CCNA exam, you will be expected to know how to configure a router or switch default gateway.

Certification Level:

This lab is suitable for both CCENT and CCNA certification exam preparation.

Lab Difficulty:

This lab has a difficulty rating of 4/10.

Readiness Assessment:

When you are ready for your certification exam, you should complete this lab in no more than 10 minutes.

Lab Topology:

Please use the following topology to complete this lab exercise:

Lab 14: Configuring a Default Gateway for Routers and Switches 2

Task 1:

Configure hostnames on Sw1, R1, and R2 as illustrated in the topology above.

Task 2:

Configure Sw1 as a VTP server and configure the VLANs as illustrated above. In addition, configure Sw1 interface FastEthernet0/3 as a trunk using 802.1q encapsulation. Ensure that you place the correct switch interface into VLAN10.

Task 3:

Configure IP addressing on R1 and R2 and interface VLAN20 on Sw1 as illustrated above. In addition, configure a default gateway on Sw1 of and a default route on R1 via FastEthernet0/0. Make VLAN20 the native VLAN on the router. Set the native VLAN on the switch trunk port to 20.

Task 4:

Verify your configuration by pinging from Sw1 to R1’s FastEthernet0/0 address of

Configuration and Verification

Task 1:

For reference information on configuring hostnames, please refer to earlier labs.

Task 2:

For reference information on configuring and verifying VLANs and trunks, please refer to earlier labs.

Task 3:

R1#config t 
Enter configuration commands, one per line.  End with CTRL/Z. 
R1(config)#interface  fastethernet0/0 
R1(config-if)#ip address 
R1(config)#ip route fastethernet0/0 
R1#show ip interface brief 
Interface         IP-Address      OK?  Method    Status    Protocol 
FastEthernet0/0     YES  manual    up        up   

R2(config)#interface fastethernet0/0 
R2(config-if)#description “Connected To Switch Trunk Fa0/3” 
R2(config-if)#no shutdown 
R2(config)#interface fastethernet0/0.10 
R2(config-subif)#description Subinterface For VLAN 10 
R2(config-subif)#encapsulation dot1Q 10 
R2(config-subif)#ip address 
R2(config)#interface fastethernet 0/0.20
R2(config-subif)#description Subinterface For VLAN 20 
R2(config-subif)#encapsulation dot1Q 20 native 
R2(config-subif)#ip address 
R2#show ip interface brief 
Interface           IP-Address     OK?  Method    Status  Protocol 
FastEthernet0/0     unassigned     YES  manual    up      up 
FastEthernet0/0.10    YES  manual    up      up 
FastEthernet0/0.20    YES  manual    up      up 

Sw1(config)#interface vlan1 
Sw1(config)#interface vlan20 
Sw1(config-if)#ip address 
Sw1(config-if)#no shutdown 
Sw1(config-if)#int f0/3 
Switch(config-if)#switchport trunk native vlan20 
Sw1(config)#ip default-gateway   
Sw1#show ip interface brief 
Interface  IP-Address     OK? Method Status                 Protocol 
Vlan1      unassigned     YES NVRAM  administratively down  down 
Vlan20    YES manual up                     up   
Sw1#show ip redirects 
Default gateway is   

Host               Gateway           Last Use    Total Uses  Interface 
ICMP redirect cache is empty

The show ip redirects command won’t work on Packet Tracer.

Task 4:


Type escape sequence to abort. 
Sending 5, 100-byte ICMP Echos to 192.168.1, timeout is 2 seconds: 
Success rate is 60 percent (3/5), round-trip min/avg/max = 1/3/4 ms
Notify of

Inline Feedbacks
View all comments