User Tools

Site Tools


products:ict:communications:courses:cisco:ccna:router_on_a_stick_configuration_for_inter_vlan_routing

Router-on-a-Stick is a configuration method used to perform inter-VLAN routing using a single physical interface on a router. This approach is commonly used when multiple VLANs need to communicate with each other, but only one physical connection is available between the router and the switch. Here's how Router-on-a-Stick configuration for Inter-VLAN Routing works:

### 1. Configure VLANs on the Switch:

First, create the VLANs on the switch and assign switch ports to their respective VLANs using VLAN configuration commands.

``` Switch(config)# vlan <vlan_id> Switch(config-vlan)# name <vlan_name> Switch(config-vlan)# exit Switch(config)# interface <interface_type> <interface_number> Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan <vlan_id> ```

Repeat this process for each VLAN and its associated switch ports.

### 2. Configure the Trunk Port:

Next, configure the switch port connected to the router as a trunk port to allow traffic from multiple VLANs to pass through a single physical connection.

``` Switch(config)# interface <interface_type> <interface_number> Switch(config-if)# switchport mode trunk Switch(config-if)# switchport trunk allowed vlan <vlan_list> ```

Replace `<vlan_list>` with a comma-separated list of VLAN IDs allowed on the trunk port.

### 3. Configure the Router:

On the router, configure a subinterface for each VLAN on the trunk port. Each subinterface represents a virtual interface associated with a specific VLAN.

``` Router(config)# interface <interface_type> <interface_number>.<vlan_id> Router(config-subif)# encapsulation dot1q <vlan_id> Router(config-subif)# ip address <ip_address> <subnet_mask> ```

Replace `<interface_type>` and `<interface_number>` with the physical interface connected to the switch and `<vlan_id>` with the VLAN ID. Configure an IP address and subnet mask for each subinterface.

### 4. Enable Inter-VLAN Routing:

Enable routing on the router to allow traffic between the VLANs.

``` Router(config)# ip routing ```

### 5. Verify Configuration:

Verify the Router-on-a-Stick configuration using show commands on both the switch and the router to ensure that VLANs are properly configured and inter-VLAN routing is functioning correctly.

``` Switch# show vlan Switch# show interfaces trunk Router# show ip interface brief Router# show ip route ```

### Conclusion:

Router-on-a-Stick configuration allows a single physical interface on a router to perform inter-VLAN routing by creating subinterfaces for each VLAN. This method provides a cost-effective solution for routing traffic between VLANs when only one physical connection is available between the router and the switch.

products/ict/communications/courses/cisco/ccna/router_on_a_stick_configuration_for_inter_vlan_routing.txt · Last modified: 2024/04/01 03:01 by wikiadmin