In this lab I will configured a multilayer switch port to be a routed port. On the router I configured an ip address that goes is directly connected to the l3 switch.
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int fa 0/1
Router(config-if)#ip add 210.1.1.1 255.255.255.0
On the l3 switch I configured an SVI for vlan 11 and 33.
Switch(config)#ip routing
Switch(config)#int vlan 11
Switch(config-if)#ip add 201.1.1.254 255.255.255.0
Switch(config)#int fa 0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 11
%LINK-5-CHANGED: Interface Vlan11, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan11, changed state to up
% Access VLAN does not exist. Creating vlan 11
Switch(config-if)#int vlan 33
Switch(config-if)#ip add 30.1.1.254 255.255.255.0
Switch(config-if)#int fa 0/3
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 33
%LINK-5-CHANGED: Interface Vlan33, changed state to up
For the port directly connected to the router I turn off layer2 switching with the no switch port command and then assign an ip address to the interface just like I would a router.
Switch(config)#int fa 0/1
Switch(config-if)#no switchport
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
Switch(config-if)#ip add 210.1.1.2 255.255.255.0
I confirmed connectivity with the router by pinging its interface.
Switch#ping 210.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 210.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 2
From the host I can ping the switch routed interface but not the router's. The reason for this is that the router doesn't know how to get to those VLANs.
PC>ping 210.1.1.2
Pinging 210.1.1.2 with 32 bytes of data:
Reply from 210.1.1.2: bytes=32 time=27ms TTL=255
Reply from 210.1.1.2: bytes=32 time=4ms TTL=255
Reply from 210.1.1.2: bytes=32 time=4ms TTL=255
Reply from 210.1.1.2: bytes=32 time=3ms TTL=255
Ping statistics for 210.1.1.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 3ms, Maximum = 27ms, Average = 9ms
PC>ping 210.1.1.1
Pinging 210.1.1.1 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 210.1.1.1:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
Router has no entries for 20.1.1.0 or 30.1.1.0 networks, a dynamic protocol can be used to solve this problem or static routes.
Router#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
C 210.1.1.0/24 is directly connected, FastEthernet0/0
I configured EIGRP on both the router and the l3 switch so that they can exchange routing tables.
Router(config)#router eigrp 100
Router(config-router)#no auto-summary
Router(config-router)#network 210.1.1.0 0.0.0.255
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#router eigrp 100
Switch(config-router)#no auto
Switch(config-router)#network 210.1.1.0 0.0.0.255
Switch(config-router)#
%DUAL-5-NBRCHANGE: IP-EIGRP 100: Neighbor 210.1.1.1 (FastEthernet0/1) is up: new adjacency
Switch(config-router)# network 20.1.1.0 0.0.0.255
Switch(config-router)# network 30.1.1.0 0.0.0.255
The router now knows how to reach all networks in this topology.
Router#show ip route eigrp
20.0.0.0/24 is subnetted, 1 subnets
D 20.1.1.0 [90/25628160] via 210.1.1.2, 00:00:34, FastEthernet0/0
30.0.0.0/24 is subnetted, 1 subnets
D 30.1.1.0 [90/25628160] via 210.1.1.2, 00:02:28, FastEthern
The ping is successful from the host now.
PC>ping 210.1.1.1
Pinging 210.1.1.1 with 32 bytes of data:
Reply from 210.1.1.1: bytes=32 time=9ms TTL=254
Reply from 210.1.1.1: bytes=32 time=11ms TTL=254
Reply from 210.1.1.1: bytes=32 time=8ms TTL=254
Reply from 210.1.1.1: bytes=32 time=9ms TTL=254
Ping statistics for 210.1.1.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 8ms, Maximum = 11ms, Average = 9ms