En computación, un Router on A Stick (ROAS), es un router que tiene una sola conexión física o lógica a una red. Es un método de ruteo inter-VLAN (redes de área local virtual) donde un router está conectado a un Switch vía un solo cable. El router tiene conexiones físicas a los dominios de broadcast donde uno o más VLAN requieren de enrutamiento entre ellos.
Configurar Sw1 y Sw2 como switches VTP transparentes:
Sw1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Sw1(config)#vtp mode Transparent
Setting device to VTP TRANSPARENT mode.
Sw1(config)#vtp domain CISCO
Changing VTP domain name from NULL to CISCO
Sw1(config)#vtp password cisco-vtp
Setting device VLAN database password to cisco-vtp
Sw1(config)#do sh vtp status
VTP Version : 2
Configuration Revision : 0
Maximum VLANs supported locally : 36
Number of existing VLANs : 5
VTP Operating Mode : Transparent
VTP Domain Name : CISCO
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0xC3 0xD3 0x78 0x64 0x81 0xE5 0xE4 0x17
Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00
Sw1(config)#
Sw2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Sw2(config)#vtp mode Transparent
Setting device to VTP TRANSPARENT mode.
Sw2(config)#vtp domain CISCO
Changing VTP domain name from NULL to CISCO
Sw2(config)#vtp password cisco-vtp
Setting device VLAN database password to cisco-vtp
Sw2(config)#do sh vtp status
VTP Version : 2
Configuration Revision : 0
Maximum VLANs supported locally : 36
Number of existing VLANs : 5
VTP Operating Mode : Transparent
VTP Domain Name : CISCO
VTP Pruning Mode : Disabled
VTP V2 Mode : Disabled
VTP Traps Generation : Disabled
MD5 digest : 0xC3 0xD3 0x78 0x64 0x81 0xE5 0xE4 0x17
Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00
Sw2(config)#
Vlans 10,20,30,40 y su nombre correspondiente. Interface e0/0 y e0/1 modo trunk, permitir vlan 1,10,20,30,40. Interface e0/2 access vlan 20.
Sw1#config t
Enter configuration commands, one per line. End with CNTL/Z.
Sw1(config)#interface e0/0
Sw1(config-if)#switchport mode trunk
Sw1(config-if)#exit
Sw1(config)#vlan 10
Sw1(config-vlan)#name SALES
Sw1(config-vlan)#exit
Sw1(config)#vlan 20
Sw1(config-vlan)#name STATIC
Sw1(config-vlan)#exit
Sw1(config)#vlan 30
Sw1(config-vlan)#name ADMIN
Sw1(config-vlan)#exit
Sw1(config)#interface e0/0
Sw1(config-if)#switchport trunk allowed vlan 1,10,20,30,40
Sw1(config)#vlan 40
Sw1(config-vlan)#name VoIP
Sw1(config-vlan)#exit
Sw1(config)#interface e0/1
Sw1(config-if)#switchport mode trunk
Sw1(config-if)#switchport trunk allowed vlan 1,10,20,30,40
Sw1(config-if)#exit
Sw1(config)#interface e0/2
Sw1(config-if)#switchport mode access
Sw1(config-if)#switchport access vlan 20
Sw1(config-if)#end
Sw1#
Verificar interfaces trunk en sw1:
Sw1#sh interfaces trunk
Port Mode Encapsulation Status Native vlan
Et0/0 on 802.1q trunking 1
Et0/1 on 802.1q trunking 1
Port Vlans allowed on trunk
Et0/0 1,10,20,30,40
Et0/1 1,10,20,30,40
Port Vlans allowed and active in management domain
Et0/0 1,10,20,30,40
Et0/1 1,10,20,30,40
Port Vlans in spanning tree forwarding state and not pruned
Et0/0 1,10,20,30,40
Et0/1 1,10,20,30,40
Sw1#
Vlans Switch 1:
Sw1#sh vlan b
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Et0/3
10 SALES active
20 STATIC active Et0/2
30 ADMIN active
40 VoIP active
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
Sw1#
Vlans 10,20,30,40 y su nombre correspondiente. Interface e0/0 modo trunk, permitir vlan 1,10,20,30,40. Interface e0/1 access vlan 30, interface e0/2 access vlan 40.
Sw2#config t
Enter configuration commands, one per line. End with CNTL/Z.
Sw2(config)#interface e0/0
Sw2(config-if)#switchport mode trunk
Sw2(config-if)#exit
Sw2(config)#vlan 10
Sw2(config-vlan)#name SALES
Sw2(config-vlan)#exit
Sw2(config)#vlan 20
Sw2(config-vlan)#name STATIC
Sw2(config-vlan)#exit
Sw2(config)#vlan 30
Sw2(config-vlan)#name ADMIN
Sw2(config-vlan)#exit
Sw2(config)#vlan 40
Sw2(config-vlan)#name VoIP
Sw2(config-vlan)#exit
Sw2(config)#interface e0/0
Sw1(config-if)#switchport trunk allowed vlan 1,10,20,30,40
Sw2(config)#interface e0/1
Sw2(config-if)#switchport mode access
Sw2(config-if)#switchport access vlan 30
Sw2(config-if)#exit
Sw2(config)#interface e0/2
Sw2(config-if)#switchport mode access
Sw2(config-if)#switchport access vlan 40
Sw2(config-if)#^Z
Sw2#
Verificar interfaces trunk en sw2:
Sw2#show interfaces trunk
Port Mode Encapsulation Status Native vlan
Et0/0 on 802.1q trunking 1
Port Vlans allowed on trunk
Et0/0 1,10,20,30,40
Port Vlans allowed and active in management domain
Et0/0 1,10,20,30,40
Port Vlans in spanning tree forwarding state and not pruned
Et0/0 1,10,20,30,40
Sw2#
Vlans en switch2:
Sw2#sh vlan b
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Et0/3
10 SALES active
20 STATIC active
30 ADMIN active Et0/1
40 VoIP active Et0/2
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
Sw2#
Router On A Stick (ROAS) en R1:
R1#config t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#interface e0/0
R1(config-if)#description "Connected a Sw1 Trunk e0/1"
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface e0/0.10
R1(config-subif)#description Subinterface Para VLAN 10
R1(config-subif)#encapsulation dot1Q 10
R1(config-subif)#ip address 10.0.10.1 255.255.255.240 R1(config-subif)#exit
R1(config)#interface e0/0.20
R1(config-subif)#description Subinterface Para VLAN 20
R1(config-subif)#encapsulation dot1Q 20
R1(config-subif)#ip address 10.0.20.1 255.255.255.128
R1(config-subif)#exit
R1(config)#interface e0/0.30
R1(config-subif)#description Subinterface Para VLAN 30
R1(config-subif)#ip address 10.0.30.1 255.255.255.248
R1(config-subif)#exit
R1(config)#interface e0/0.40
R1(config-subif)#description Subinterface Para VLAN 40
R1(config-subif)#encapsulation dot1Q 40
R1(config-subif)#ip address 10.0.40.1 255.255.255.224
R1(config-subif)#end
R1#
Verificar configuración:
R1#show ip interface brief
R1#sh ip interface b
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 unassigned YES NVRAM up up
Ethernet0/0.10 10.0.10.1 YES NVRAM up up
Ethernet0/0.20 10.0.20.1 YES NVRAM up up
Ethernet0/0.30 10.0.30.1 YES NVRAM up up
Ethernet0/0.40 10.0.40.1 YES NVRAM up up
Ethernet0/1 unassigned YES NVRAM administratively down down
Ethernet0/2 unassigned YES NVRAM administratively down down
Ethernet0/3 unassigned YES NVRAM administratively down down
R1#
Dirección IP 10.0.10.2/28 (Vlan 10):
Sw2#conf t
Sw2(config)#interface vlan10
Sw2(config-if)#ip address 10.0.10.2 255.255.255.240
Sw2(config-if)#no shutdown
Sw2(config)#^Z
Sw2#
Comprobar:
Sw2#sh ip interface b
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 unassigned YES unset up up
Ethernet0/1 unassigned YES unset up up
Ethernet0/2 unassigned YES unset up up
Ethernet0/3 unassigned YES unset administratively down down
Vlan1 unassigned YES unset administratively down down
Vlan10 10.0.10.2 YES manual up up
Vlan20 unassigned YES unset administratively down down
Vlan30 unassigned YES unset administratively down down
Vlan40 unassigned YES unset administratively down down
Sw2#
Ping, comprobar conectividad:
R1#ping 10.0.10.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.10.2, timeout is 2 seconds: .!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 1/3/4 ms
R1#ping 10.0.20.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.20.2, timeout is 2 seconds: .!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 1/3/4 ms
R1#ping 10.0.30.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.30.3, timeout is 2 seconds: .!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 1/3/4 ms
R1#ping 10.0.40.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.40.4, timeout is 2 seconds: .!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 1/3/4 ms
Archivos de configuración de todos los dispositivos:
Sw1#sh run
Building configuration...
Current configuration : 1150 bytes
!
version 15.1
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
service compress-config
!
hostname Sw1
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
clock timezone CET 1 0
no ipv6 cef
ipv6 multicast rpf use-bgp
!
no ip domain-lookup
ip cef
!
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
!
!
!
vlan internal allocation policy ascending
!
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 1,10,20,30,40
switchport mode trunk
duplex auto
!
interface Ethernet0/1
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 1,10,20,30,40
switchport mode trunk
duplex auto
!
interface Ethernet0/2
switchport access vlan 20
switchport mode access
duplex auto
!
interface Ethernet0/3
duplex auto
!
interface Vlan10
no ip address
shutdown
!
interface Vlan20
no ip address
shutdown
!
interface Vlan30
no ip address
shutdown
!
interface Vlan40
no ip address
shutdown
!
!
no ip http server
!
!
!
!
!
control-plane
!
!
line con 0
logging synchronous
line aux 0
line vty 0 4
login
!
end
Sw2#sh run
Building configuration...
Current configuration : 1278 bytes
!
! Last configuration change at 20:05:49 CET Mon Mar 29 2021
!
version 15.1
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
service compress-config
!
hostname Sw2
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
clock timezone CET 1 0
no ipv6 cef
ipv6 multicast rpf use-bgp
!
no ip domain-lookup
ip cef
!
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
!
!
!
vlan internal allocation policy ascending
!
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 1,10,20,30,40
switchport mode trunk
duplex auto
!
interface Ethernet0/1
switchport access vlan 30
switchport trunk encapsulation dot1q
switchport mode access
duplex auto
!
interface Ethernet0/2
switchport access vlan 40
switchport mode access
duplex auto
!
interface Ethernet0/3
switchport mode access
shutdown
duplex auto
!
interface Vlan1
no ip address
shutdown
!
interface Vlan10
ip address 10.0.10.2 255.255.255.240
!
interface Vlan20
no ip address
shutdown
!
interface Vlan30
no ip address
shutdown
!
interface Vlan40
no ip address
shutdown
!
!
no ip http server
!
!
!
!
!
control-plane
!
!
line con 0
logging synchronous
line aux 0
line vty 0 4
!
end
Sw2#
R1#sh run
Building configuration...
Current configuration : 1561 bytes
!
! Last configuration change at 20:13:31 CET Mon Mar 29 2021
!
version 15.7
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
!
!
!
clock timezone CET 1 0
mmi polling-interval 60
no mmi auto-configure
no mmi pvc
mmi snmp-timeout 180
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
no ip domain lookup
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
redundancy
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
description "Connected a Sw1 Trunk e0/1"
no ip address
duplex auto
!
interface Ethernet0/0.10
description -Subinterface For VLAN 10"
encapsulation dot1Q 10
ip address 10.0.10.1 255.255.255.240
!
interface Ethernet0/0.20
description -Subinterface For VLAN 20"
encapsulation dot1Q 20
ip address 10.0.20.1 255.255.255.128
!
interface Ethernet0/0.30
description -Subinterface For VLAN 30"
encapsulation dot1Q 30
ip address 10.0.30.1 255.255.255.248
!
interface Ethernet0/0.40
description -Subinterface For VLAN 40"
encapsulation dot1Q 40
ip address 10.0.40.1 255.255.255.224
!
interface Ethernet0/1
no ip address
shutdown
duplex auto
!
interface Ethernet0/2
no ip address
shutdown
duplex auto
!
interface Ethernet0/3
no ip address
shutdown
duplex auto
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
ipv6 ioam timestamp
!
!
!
control-plane
!
!
!
!
!
!
!
!
line con 0
logging synchronous
line aux 0
line vty 0 4
login
transport input none
!
!
end
R1#
R2#sh run
Building configuration...
Current configuration : 1006 bytes
!
! Last configuration change at 15:16:01 CET Mon Mar 29 2021
!
version 15.7
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
!
!
!
clock timezone CET 1 0
mmi polling-interval 60
no mmi auto-configure
no mmi pvc
mmi snmp-timeout 180
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
redundancy
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
ip address 10.0.20.2 255.255.255.128
duplex auto
!
interface Ethernet0/1
no ip address
shutdown
duplex auto
!
interface Ethernet0/2
no ip address
shutdown
duplex auto
!
interface Ethernet0/3
no ip address
shutdown
duplex auto
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
ipv6 ioam timestamp
!
!
!
control-plane
!
!
!
!
!
!
!
!
line con 0
logging synchronous
line aux 0
line vty 0 4
login
transport input none
!
!
end
R2#
R3#sh run
Building configuration...
Current configuration : 1013 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
clock timezone CET 1
mmi polling-interval 60
no mmi auto-configure
no mmi pvc
mmi snmp-timeout 180
ip source-route
!
!
!
!
ip cef
multilink bundle-name authenticated
!
!
!
!
!
!
interface Ethernet0/0
ip address 10.0.30.3 255.255.255.224
!
interface Ethernet0/1
no ip address
shutdown
!
interface Ethernet0/2
no ip address
shutdown
!
interface Ethernet0/3
no ip address
shutdown
!
interface Serial1/0
no ip address
serial restart-delay 0
!
interface Serial1/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
ip forward-protocol nd
!
no ip http server
!
!
line con 0
logging synchronous
line aux 0
line vty 0 4
login
!
exception data-corruption buffer truncate
end
R3#
R4#sh run
Building configuration...
Current configuration : 1013 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R4
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
clock timezone CET 1
mmi polling-interval 60
no mmi auto-configure
no mmi pvc
mmi snmp-timeout 180
ip source-route
!
!
!
!
ip cef
multilink bundle-name authenticated
!
!
!
!
!
!
interface Ethernet0/0
ip address 10.0.40.4 255.255.255.224
!
interface Ethernet0/1
no ip address
shutdown
!
interface Ethernet0/2
no ip address
shutdown
!
interface Ethernet0/3
no ip address
shutdown
!
interface Serial1/0
no ip address
serial restart-delay 0
!
interface Serial1/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
ip forward-protocol nd
!
no ip http server
!
!
line con 0
logging synchronous
line aux 0
line vty 0 4
login
!
exception data-corruption buffer truncate
end
R4#