Inter-VLAN Routing
To configure inter-VLAN routing on a Cisco switch or router, you need to create subinterfaces for each VLAN on the router's physical interface and configure routing between them. Below are the commands and descriptions for configuring inter-VLAN routing:
Assumptions:
- You have a Cisco router with at least one Ethernet interface connected to a switch.
- You have already created VLANs on the connected switch.
1. Access Configuration Mode:
- Description: Access the router's command-line interface (CLI) and enter configuration mode.
bashRouter> enable
Router# configure terminal
2. Configure the Physical Interface:
- Description: Configure the physical interface that connects to the switch. This interface will be used for inter-VLAN routing.
bashRouter(config)# interface GigabitEthernet0/0
Router(config-if)# no shutdown
3. Create Subinterfaces for Each VLAN:
- Description: Create subinterfaces for each VLAN on the router's physical interface. Each subinterface represents a different VLAN.
bashRouter(config)# interface GigabitEthernet0/0.10
Router(config-subif)# encapsulation dot1Q 10
Router(config-subif)# ip address 192.168.10.1 255.255.255.0
- Description: In the above example, we created a subinterface for VLAN 10 with an IP address. Repeat this step for each VLAN you want to route.
4. Repeat for Each VLAN:
- Description: Repeat step 3 for each VLAN, creating a separate subinterface for each one and configuring its IP address.
5. Enable Routing on the Router:
- Description: Enable routing on the router to allow it to route traffic between VLANs.
bashRouter(config)# ip routing
6. Verify the Configuration:
- Description: To verify the inter-VLAN routing configuration, use the following command to check the routing table:
bashRouter# show ip route
- Description: This command displays the routing table, showing the networks that the router can reach and how they are connected.
7. Configure Default Gateway on Switch (Optional):
- Description: If your switch has a default gateway configured, ensure it points to the IP address of the router's subinterface in the management VLAN.
8. Test Inter-VLAN Routing:
- Description: Finally, test inter-VLAN routing by connecting devices to the different VLANs and attempting to communicate between them.
Comments
Post a Comment