0% found this document useful (0 votes)
51 views

4-Configure A Router On A Stick - Implementing and Administering Cisco Solutions

Uploaded by

Daniel Cafu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views

4-Configure A Router On A Stick - Implementing and Administering Cisco Solutions

Uploaded by

Daniel Cafu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

3/26/2020 Configure a Router on a Stick | Implementing and Administering Cisco Solutions

Implementing and Administering Cisco Solutions


ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/4

You are using a US English keyboard layout. This cannot be changed once the lab has
initialized.

Visit Device Help for info about changing the OS keyboard layout and screen resolution after
lab initialization.

You will be notified once the devices are ready.

Include a Router Interface in a VLAN


Open Transcript

Step 1

One way to implement routing between VLANs is to connect physical interfaces on


routers to switch access ports that are assigned to the appropriate VLANs. R1 already
has its Ethernet0/0 interface connected to a VLAN 1 access port (Ethernet0/1) on SW1. In
the following series of steps, you will configure a second physical connection from R1 to
an access port on the switch that is in VLAN 2. Access the console of SW1 and verify the
current interface status.

Enter the following command to the SW1 switch:

https://ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/4 1/20
3/26/2020 Configure a Router on a Stick | Implementing and Administering Cisco Solutions

SW1# show interfaces status

Port Name Status Vlan Duplex Speed Type


Et0/0 Trunk to SW2 connected trunk auto auto unknown
Et0/1 Link to R1 VLAN 1 connected 1 auto auto unknown
Et0/2 Link to R1 VLAN 2 connected 1 auto auto unknown
Et0/3 connected 1 auto auto unknown
Et1/0 Link to PC1 connected 1 auto auto unknown
Et1/1 Link to PC2 connected 2 auto auto unknown
Et1/2 connected 1 auto auto unknown
Et1/3 connected 1 auto auto unknown

R1 Ethernet0/1 is connected to SW1 Ethernet0/2. Ethernet0/2 is currently in VLAN 1. This


means that router R1 has two interfaces connected to ports that have access VLAN set to
1. In other words, router R1 is only part of VLAN 1. Also note that Ethernet 0/0, which is
connected to SW2, is a trunk, and Ethernet 1/1, which is connected to PC2, is in VLAN 2.

Step 2

Configure SW1 Ethernet0/2 to be an access port that is assigned to VLAN 2.

Enter the following commands to the SW1 switch:

SW1# configure terminal


Enter configuration commands, one per line. End with CNTL/Z.
SW1(config)# interface Ethernet 0/2
SW1(config-if)# switchport mode access
SW1(config-if)# switchport access vlan 2
SW1(config-if)# end
SW1#

By assigning SW1 port E0/2 to VLAN 2, you have included the router R1 in VLAN 2. It can
now act as the default gateway for both VLANs.

https://ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/4 2/20
3/26/2020 Configure a Router on a Stick | Implementing and Administering Cisco Solutions

Step 3

Access the R1 console, configure its Ethernet0/1 interface with IPv4 address
10.10.2.1/24, and enable the interface.

Enter the following commands to the R1 router:

R1# configure terminal


Enter configuration commands, one per line. End with CNTL/Z.
R1(config)# interface Ethernet 0/1
R1(config-if)# ip address 10.10.2.1 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# end
R1#
*Oct 30 07:57:23.805: %LINK-3-UPDOWN: Interface Ethernet0/1, changed state to up
*Oct 30 07:57:24.810: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/1, changed
state to up

Step 4

R1 can now act as a gateway for VLAN 2. Before you configure R1 as the default gateway
for PC4, verify that PC4 belongs to the same VLAN 2. According to the topology diagram,
PC4 is connected to SW2 Ethernet 1/1 interface. Examine the VLAN information summary

https://ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/4 3/20
3/26/2020 Configure a Router on a Stick | Implementing and Administering Cisco Solutions

on SW2 to verify interface VLAN assignment.

On SW2, enter the following command:

SW2# show vlan brief

VLAN Name Status Ports


---- -------------------------------- --------- -------------------------------
1 default active Et0/1, Et0/2, Et0/3, Et1/0
Et1/2, Et1/3
2 Engineering active Et1/1
256 NoHosts active
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup

The output shows that Ethernet1/1 access VLAN is set to 2. Alternatively, because Cisco
Discovery Protocol is enabled, you can use the show cdp neighbors detail command
on PC4 to view SW2 information.

PC4# show cdp neighbors detail


-------------------------
Device ID: SW2
Entry address(es):
IP address: 10.10.1.5
Platform: Linux Unix, Capabilities: Switch IGMP
Interface: Ethernet0/0, Port ID (outgoing port): Ethernet1/1
Holdtime : 158 sec

Version :
Cisco IOS Software, Solaris Software (I86BI_LINUXL2-ADVENTERPRISEK9-M), Experimental
Version 15.1(20130919:231344) [dstivers-sept19-2013pm-team_track 107]
Copyright (c) 1986-2013 by Cisco Systems, Inc.
Compiled Thu 19-Sep-13 22:38 by dstivers

advertisement version: 2
VTP Management Domain: ''
Native VLAN: 2
Duplex: half

https://ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/4 4/20
3/26/2020 Configure a Router on a Stick | Implementing and Administering Cisco Solutions

Step 5

On PC4, configure router R1’s VLAN 2 IPv4 address 10.10.2.1 as the default gateway
and exit to the privileged EXEC mode.

On PC4, enter the following command:

PC4# configure terminal


Enter configuration commands, one per line. End with CNTL/Z.
PC4(config)# ip default-gateway 10.10.2.1
PC4(config)# end
PC4#

The default gateway IPv4 address and the host IPv4 address must belong to the same
subnet.

Step 6

Verify that PC4 can now reach hosts on VLAN 1 by pinging PC1 (10.10.1.10).

Enter the following command to PC4:

PC4# ping 10.10.1.10


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

https://ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/4 5/20
3/26/2020 Configure a Router on a Stick | Implementing and Administering Cisco Solutions

Refer to the topology diagram to understand the physical path from PC4 to PC1. The
VLAN 2 path starts at PC4 and proceeds to SW2. Then, it crosses the trunk link to SW1
and continues up to the R1 Ethernet0/1 interface. R1 performs the route forwarding to
VLAN 1. It sends the packet out of its Ethernet0/0 interface back to SW1 on VLAN 1, and
then SW1 delivers the packet to PC1.

Step 7

According to the topology diagram, PC2 is also in VLAN 2. Before you configure the
default gateway on PC2, verify that it belongs to VLAN 2. All devices have Cisco
Discovery Protocol enabled. Use the information obtained by the Cisco Discovery
Protocol to verify VLAN configuration.

On PC2, enter the following command:

https://ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/4 6/20
3/26/2020 Configure a Router on a Stick | Implementing and Administering Cisco Solutions

PC2# show cdp neighbors detail


-------------------------
Device ID: SW1
Entry address(es):
IP address: 10.10.1.4
Platform: Linux Unix, Capabilities: Switch IGMP
Interface: Ethernet0/0, Port ID (outgoing port): Ethernet1/1
Holdtime : 149 sec

Version :
Cisco IOS Software, Solaris Software (I86BI_LINUXL2-ADVENTERPRISEK9-M), Experimental
Version 15.1(20130919:231344) [dstivers-sept19-2013pm-team_track 107]
Copyright (c) 1986-2013 by Cisco Systems, Inc.
Compiled Thu 19-Sep-13 22:38 by dstivers

advertisement version: 2
VTP Management Domain: ''
Native VLAN: 2
Duplex: half

PC2 is already configured in VLAN 2.

Step 8

Configure the default gateway on PC2.

On PC2, enter the following command:

PC2# configure terminal


Enter configuration commands, one per line. End with CNTL/Z.
PC2(config)# ip default-gateway 10.10.2.1
PC2(config)# end
PC2#

https://ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/4 7/20
3/26/2020 Configure a Router on a Stick | Implementing and Administering Cisco Solutions

Step 9

Verify that PC2, which is connected to VLAN 2 on SW1, can reach hosts that are
connected to VLAN 1 on SW2. Ping PC3 (10.10.1.30). The attempt should succeed.

Enter the following command to PC2:

PC2# ping 10.10.1.30


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

There is connectivity between PC2 and PC3. Consulting the topology diagram, trace the
path between PC2 and PC3. Remember that a device with the routing function must be in
the path, since PC2 and PC3 are not in the same subnets and VLANs.

At this point, successful routing exists between two VLANs using two physical interfaces on R1.

Configure a Router with a Trunk Link


Open Transcript
In the next series of steps, you will add a third VLAN. You will leave the switch management IPv4
addresses in VLAN 1, but all PCs will be distributed between VLAN 2 and VLAN 3. There are not
enough physical interfaces available on R1 to connect to all the three VLANs individually.
Therefore, you need to configure one of the router R1 physical interfaces, Ethernet 0/1, as a trunk
to allow it to have a logical connection to multiple VLANs.

https://ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/4 8/20
3/26/2020 Configure a Router on a Stick | Implementing and Administering Cisco Solutions

In this lab, only VLAN 2 and VLAN 3 will be configured on the router’s trunk interface Ethernet
0/1. The Ethernet 0/0 interface will remain in VLAN 1. In a real environment, you would configure
all required VLANs to the trunk.

Step 10

Start by accessing the SW1 console and creating VLAN 3, assigning it the name
"Marketing," and then return to the Global Configuration mode.

On SW1, enter the following commands:

SW1# configure terminal


Enter configuration commands, one per line. End with CNTL/Z.
SW1(config)# vlan 3
SW1(config-vlan)# name Marketing
SW1(config-vlan)# exit

Step 11

Configure the port connecting to PC1 as an access interface, and assign it to VLAN 3.

On SW1, enter the following command:

https://ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/4 9/20
3/26/2020 Configure a Router on a Stick | Implementing and Administering Cisco Solutions

SW1(config)# interface Ethernet 1/0


SW1(config-if)# switchport mode access
SW1(config-if)# switchport access vlan 3
SW1(config-if)# end
SW1#

Step 12

Verify the configuration of VLAN 3 on SW1.

On SW1, enter the following command:

SW1# show vlan id 3

VLAN Name Status Ports


---- -------------------------------- --------- -------------------------------
3 Marketing active Et0/0, Et1/0

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
3 enet 100003 1500 - - - - - 0 0

Primary Secondary Type Ports


------- --------- ----------------- ------------------------------------------

The output shows two ports are in VLAN 3. Ethernet 1/0 is the access interface that you
just configured. Ethernet 0/0 is the trunk interface towards SW2, which was pre-
configured for the lab. VLAN 3 is allowed on the trunk.

https://ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/4 10/20
3/26/2020 Configure a Router on a Stick | Implementing and Administering Cisco Solutions

Step 13

Access the console of PC1 and configure its IPv4 address and default gateway. Both
addresses must belong to the same subnet, the subnet allocated for VLAN 3, which is
10.10.3.0/24. For PC, use the IPv4 address 10.10.3.10/24. For the default gateway, use
the IPv4 address 10.10.3.1/24.

On PC1, enter the following commands:

PC1# configure terminal


Enter configuration commands, one per line. End with CNTL/Z.
PC1(config)# interface Ethernet 0/0
PC1(config-if)# ip address 10.10.3.10 255.255.255.0
PC1(config-if)# exit
PC1(config)# ip default-gateway 10.10.3.1
PC1(config)# end
PC1#

Step 14

Access the console of SW2 and create VLAN 3, as you did on SW1. Assign the port
connecting PC3 as an access interface, and assign it to VLAN 3.

On PC1, enter the following commands:

https://ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/4 11/20
3/26/2020 Configure a Router on a Stick | Implementing and Administering Cisco Solutions

SW2# configure terminal


Enter configuration commands, one per line. End with CNTL/Z.
SW2(config)# vlan 3
SW2(config-vlan)# name Marketing
SW2(config-vlan)# exit
SW2(config)# interface Ethernet 1/0
SW2(config-if)# switchport mode access
SW2(config-if)# switchport access vlan 3
SW2(config-if)# end
SW2#

Step 15

Verify the status of the Ethernet1/0 interface on SW2.

On SW2, enter the following command:

SW2# show interfaces Ethernet1/0 status

Port Name Status Vlan Duplex Speed Type


Et1/0 Link to PC3 connected 3 auto auto unknown

The output shows that Ethernet 1/0 interface is in VLAN 3.

Step 16

https://ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/4 12/20
3/26/2020 Configure a Router on a Stick | Implementing and Administering Cisco Solutions

Verify the configuration of VLAN 3 on SW2.

On SW2, enter the following command:

SW2# show vlan id 3

VLAN Name Status Ports


---- -------------------------------- --------- -------------------------------
3 Marketing active Et0/0, Et1/0

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
3 enet 100003 1500 - - - - - 0 0

Primary Secondary Type Ports


------- --------- ----------------- ------------------------------------------

The output shows two ports are in VLAN 3. Ethernet 1/0 is the access interface that you
just configured. Ethernet 0/0 is the trunk interface towards SW1, which was pre-
configured for the lab. VLAN 3 is allowed on the trunk.

Step 17

Access the console of PC3 and configure its IPv4 address and default gateway. Both
addresses must belong to the same subnet, the subnet that is allocated for VLAN 3. For
PC3 use the IPv4 address 10.10.3.30/24.

On PC3, enter the following command:

https://ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/4 13/20
3/26/2020 Configure a Router on a Stick | Implementing and Administering Cisco Solutions

PC3# configure terminal


Enter configuration commands, one per line. End with CNTL/Z.
PC3(config)# interface Ethernet 0/0
PC3(config-if)# ip address 10.10.3.30 255.255.255.0
PC3(config-if)# exit
PC3(config)# ip default-gateway 10.10.3.1
PC3(config)# end
PC3#

Note that although you configured the PC1 and PC3 with the default gateway, you have
not yet configured 10.10.3.1/24 IPv4 address on the router.

Step 18

PC3 and PC1 are now correctly configured. The switch ports that they are connected to
are assigned to VLAN 3. Verify that there is connectivity between them.

On PC3, enter the following command:

PC3# ping 10.10.3.10


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

Step 19

https://ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/4 14/20
3/26/2020 Configure a Router on a Stick | Implementing and Administering Cisco Solutions

Use the R1 Ethernet0/1 to SW1 Ethernet0/2 connection as a trunk for VLANs 2 and 3. To
prepare for the trunk port configuration on R1, you must configure SW1 Ethernet0/2 as a
trunk port. Only two VLANs will be configured on the interface. Configure Ethernet0/2 on
SW1 as a trunk with native VLAN 256 and 802.1Q encapsulation; VLAN 256 is already
configured on SW1.

Only two VLANs will be configured on a single interface.

On SW1, enter the following commands:

SW1# configure terminal


Enter configuration commands, one per line. End with CNTL/Z.
SW1(config)# interface Ethernet 0/2
SW1(config-if)# switchport trunk encapsulation dot1q
SW1(config-if)# switchport trunk native vlan 256
SW1(config-if)# switchport trunk allowed vlan 2,3
SW1(config-if)# switchport mode trunk
SW1(config-if)# end
SW1#
*Oct 30 09:55:41.399: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/2, changed
state to down
*Oct 30 09:55:44.049: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/2, changed
state to up

Note that if you do not allow specific VLANs on the trunk, the default configuration allows
all VLANs.

Step 20

https://ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/4 15/20
3/26/2020 Configure a Router on a Stick | Implementing and Administering Cisco Solutions

Now, configure Ethernet 0/1 interface on R1 so that it connects to both VLAN 2 and VLAN
3. First, remove the IPv4 address that is currently configured on R1 Ethernet 0/1 physical
interface.

On R1, enter the following commands:

R1# configure terminal


Enter configuration commands, one per line. End with CNTL/Z.
R1(config)# interface Ethernet0/1
R1(config-if)# no ip address

Step 21

To accommodate two VLANs and their two subnets, create two logical subinterfaces, one
for each VLAN, of the Ethernet 0/1 interface. First, create the logical Ethernet0/1.2
subinterface, assign it to VLAN 2, and configure it with the appropriate IPv4 address that
is given in the Device Information table.

On R1, enter the following commands:

R1(config-if)# interface Ethernet 0/1.2


R1(config-subif)# encapsulation dot1q 2
R1(config-subif)# ip address 10.10.2.1 255.255.255.0

In this example, the subinterface number (.2), the VLAN ID (2), and the third octet of the
IPv4 address (2) are all consistent with each other. This practice is common, but it is not a
technical requirement.

https://ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/4 16/20
3/26/2020 Configure a Router on a Stick | Implementing and Administering Cisco Solutions

Step 22

Create the logical Ethernet0/1.3 subinterface, assign it to VLAN 3, and configure it with
the appropriate IPv4 address. Leave the configuration mode when you are done.

On R1, enter the following commands:

R1(config-subif)# interface Ethernet 0/1.3


R1(config-subif)# encapsulation dot1q 3
R1(config-subif)# ip address 10.10.3.1 255.255.255.0
R1(config-subif)# end
R1#

Step 23

If everything was configured successfully, R1 should have connectivity to devices in both


VLAN 2 and VLAN 3. Verify this connectivity from the router to all PCs. All verifications
should be successful.

On R1, enter the following commands:

https://ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/4 17/20
3/26/2020 Configure a Router on a Stick | Implementing and Administering Cisco Solutions

R1# ping 10.10.3.10


Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.3.10, timeout is 2 seconds:
..!!!
Success rate is 60 percent (3/5), round-trip min/avg/max = 1/1/1 ms
R1# ping 10.10.2.20
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.2.20, timeout is 2 seconds:
..!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/1 ms
R1# ping 10.10.3.30
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.3.30, timeout is 2 seconds:
.!!!!
Success rate is 60 percent (3/5), round-trip min/avg/max = 1/1/1 ms
R1# ping 10.10.2.40
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.2.40, timeout is 2 seconds:
.!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/1 ms

Step 24

Verify that the PCs can also reach each other. From PC1 verify connectivity to PC2.

On PC1, enter the following command:

PC1# ping 10.10.2.20


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

https://ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/4 18/20
3/26/2020 Configure a Router on a Stick | Implementing and Administering Cisco Solutions

Step 25

Verify that R1 is in the path between PC1 and PC2 using the traceroute command.

On PC1, enter the following command:

PC1# traceroute 10.10.2.20


Type escape sequence to abort.
Tracing the route to 10.10.2.20
VRF info: (vrf in name/id, vrf out name/id)
1 10.10.3.1 0 msec 0 msec 0 msec
2 10.10.2.20 0 msec * 1 msec

Step 26

Also verify that PC1 can still reach the switch management IPv4 addresses that remain in
VLAN 1. Ping 10.10.1.4 and 10.10.1.5. Both attempts should succeed.

On PC1, enter the following command:

https://ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/4 19/20
3/26/2020 Configure a Router on a Stick | Implementing and Administering Cisco Solutions

PC1# ping 10.10.1.4


Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.1.4, timeout is 2 seconds:
!!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/1 ms
PC1# ping 10.10.1.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.1.5, timeout is 2 seconds:
!!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/1 ms

https://ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/4 20/20

You might also like