In my previous post, I showed you how to configure a multilayer switch with the network topology shown above. In that post, I showed you the process of creating SVI, creating trunk links between the Layer 3 switch and each of the Layer 2 switches, and also the process of creating access ports on each of the Layer 2 switches. After the configuration, we could achieve inter-VLAN routing with a multilayer switch.
In this post, I will be showing how to connect a multilayer switch to a router. I will be adding a router to the network topology shown above and then showing how to configure a routed port on the multilayer switch so that traffic can route between host devices attached to the layer 3 switch and the host devices attached to the router.
Network Topology
Just like I said before, I will be adopting the network topology I used in the previous post.
As shown below, I have added a router, connected it with a cross-over cable to the layer 3 switch, and attached a PC to the router.
Configuration Objectives
Our configuration objectives for this post include:
- Configuring a routed port on the layer 3 switch.
- Configuring OSPF as the routing protocol on both the layer 3 switch and the router.
- Testing the network to ensure successful routing.
Configuration
Below are the configurations needed on the multilayer switch and the router to connect both of them;
Multilayer Switch Configuration
Interface Configuration
Enter the following commands to the configure the interface of the layer 3 switch that is connected to the router;
SWI>en
SWI#conf ter
SWI(config)#int fa0/4
SWI(config)#no switchport
SWI(config-if)#ip address 192.168.3.3 255.255.255.0
SWI(config-if)#no shut
OSPF Configuration
Enter the following command to configure OSPF IP routing protocol on the layer 3 switch;
SWI(config)#router ospf 10
SWI(config-router)#network 192.168.2.0 0.0.0.255 area 0
SWI(config-router)#network 192.168.1.0 0.0.0.255 area 0
SWI(config-router)#network 192.168.3.0 0.0.0.255 area 0
SWI(config-router)#network 192.168.4.0 0.0.0.255 area 0
SWI(config-router)#exit
SWI(config)#ip route 0.0.0.0 0.0.0.0 192.168.3.1
SWI(config)#do write
Here is a brief explanation of each of the above commands;
- The first command above enter the ospf configuration mode with a process number of 10.
- Line 2, 3, 4, 5 Identifies the networks that should participate in the OSPF routing
SWI(config)#ip route 0.0.0.0 0.0.0.0 192.168.3.1
: This command configures a default route on the multilayer switch. It tells the switch that any traffic with a destination not matching any specific route should be forwarded to the next-hop IP address 192.168.3.1. This is often used to route traffic to an external gateway, such as a router or firewall for further routing
Router 0 Configuration
Interface Configuration
Enter the following commands to configure the interfaces of the router;
Router>en
Router#conf ter
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int g0/0/0
Router(config-if)#ip address 192.168.3.1 255.255.255.0
Router(config-if)#no shut
Router(config-if)#exit
Router(config)#int g0/0/1
Router(config-if)#ip address 192.168.4.1 255.255.255.0
Router(config-if)#no shut
Router(config-if)#do write
OSPF Configuration
Enter the following commands to configure OSPF on router 0;
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#
Router(config)#router ospf 10
Router(config-router)#network 192.168.3.0 0.0.0.255 area 0
Router(config-router)#network 192.168.4.0 0.0.0.255 area 0
Router(config-router)#exit
Verify the Configuration
To verify that that the connection between the layer 3 switch and the router 0 is successful, I have pinged from PC3 to PC4 and the result is as shown in the image below;
I am a passionate Networking Associate specializing in Telecommunications.
With a degree in Electronic engineering, I possess a strong understanding of electronic systems and the intricacies of telecommunications networks. I gained practical experience and valuable insights working for a prominent telecommunications company.
Additionally, I hold certifications in networking, which have solidified my expertise in network architecture, protocols, and optimization.
Through my writing skills, I aim to provide accurate and valuable knowledge in the networking field.
Connect with me on social media using the links below for more insights.
You can contact me using [email protected] or connect with me using any of the social media account linked below