1. Home page
  2. Nerwork.

Configuration of Cisco Switch Router On a Stick (RoAS)

What is Cisco Switch Router on a Stick configuration? How to do it? The subject is explained.


0

Let’s first explain what Router on a Stick is. This configuration helps in VLAN routing by enabling access and communication to multiple VLANs through a single Ethernet configuration. It means that we can create multiple virtual VLAN gateways on a single Cisco Switch interface and route different VLAN addresses. This infrastructure is particularly beneficial for cost savings. If your network is not very extensive, this virtual VLAN infrastructure can be highly advantageous for cost management.

Cisco Router on a Stick Configuration

Let’s go through an example scenario based on the diagram above. We will create a network structure as follows: For the user labeled as PC2, we will assign the local IP address 192.168.1.10 and define it as VLAN 10. Similarly, for PC3, we will assign the local IP address 192.168.2.10 and define it as VLAN 20.

thumbnail
Önerilen Yazı
Converting Video Sound to Text and Adding YouTube Subtitles

Creating VLANs on Cisco Switch

First, let’s create VLANs for the Cisco Switch interfaces and define the interface VLANs. I will use VLAN 10 and VLAN 20. You can add VLANs according to your own network setup. The command for creating VLANs is as follows:

  • Switch#enable
  • Switch#configure terminal
  • Switch(config)#vlan 10
  • Switch(config-vlan)#vlan 20
  • Switch(config-vlan)#exit

We have created the VLANs. Now, let’s configure the VLAN accesses for FA0/1 and FA0/2 interfaces and allow trunking on the Gig0/1 interface on the switch.

  • Switch(config)#interface fastEthernet 0/1
  • Switch(config-if)#switchport access vlan 10
  • Switch(config-if)#exit
  • Switch(config)#interface fastEthernet 0/2
  • Switch(config-if)#switchport access vlan 20
  • Switch(config-if)#exit
  • Switch(config)#interface gigabitEthernet 0/1
  • Switch(config-if)#switchport mode trunk
  • Switch(config-if)#end
  • Switch# write

The Cisco Switch configuration is complete. Now let’s move on to the Cisco Router device. Here, we will create virtual interfaces (sub-interfaces) on GIG0/0/0 for the VLANs. After specifying the VLAN encapsulation protocol for these interfaces, we will assign the IP addresses.

Creating Virtual Interfaces on Cisco Router

To create virtual interfaces, add a dot (.) followed by an ID number after the interface name. This ID number can be any number, but it is recommended to use the same number as the VLAN ID you have created. This way, you can easily associate them. The code to create virtual VLANs is as follows:

Creating a Virtual Interface for VLAN 10:

  • Router#enable
  • Router#configure terminal
  • Router(config)#interface gigabitEthernet 0/0/0
  • Router(config-if)#interface gigabitEthernet 0/0/0.10 (I added the ID number to create a virtual VLAN)
  • Router(config-subif)#encapsulation dot1Q 10 (The ID number should match the one you created for the VLAN)
  • Router(config-subif)#ip address 192.168.1.1 255.255.255.0 (I’m adding the gateway for the virtual interface)
  • Router(config-subif)#exit

Creating a Virtual Interface for VLAN 20:

  • Router#enable
  • Router#configure terminal
  • Router(config)#interface gigabitEthernet 0/0/0.20 (I’m using the same ID number as VLAN 20)
  • Router(config-subif)#encapsulation dot1Q 20
  • Router(config-subif)#ip address 192.168.2.1 255.255.255.0
  • Router(config-subif)#exit

Finally, we activate the virtual interfaces that we opened:

  • Router>enable
  • Router#configure terminal
  • Router(config)#interface gigabitEthernet 0/0/0
  • Router(config-if)#no sh
  • Router(config-if)#no shutdown
  • Router(config-if)# end
  • Router# write

After these steps, with the Cisco Switch Router on a Stick configuration, communication will take place through the two virtual interfaces we created using a single physical interface.

Yazıya Tepkin Ne Olur?
  • 0
    be_endim
    Beğendim
  • 0
    alk_
    Alkış!
  • 0
    sevmedim
    Sevmedim
  • 0
    k_zd_m
    Kızdım
  • 0
    _a_k_n_
    Şaşkın!
  • 0
    _z_ld_m
    Üzüldüm

Bültenimize Katılın!

Ücretsiz üye olun ve yeni yayınlardan haberdar olan ilk kişi olun.

Your email address will not be published. Required fields are marked *