cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1579
Views
5
Helpful
3
Replies

How to configure a Router-on-a-Stick?

MasonCa
Level 1
Level 1

I am a student, and learning Switching, Routing, and Wireless Essentials

 

I have a question about configure a Router-on-a-Stick routing

 

As we can see, We have 5vlans and 3 switch. I configure etherchannel between S1 and S2.

How can I configure the Router-on-a-Stick in S1 S2 and S3?

(The address table may miss some ip, We can give an ip.)

QQ图片20210419211512.pngQQ图片20210419211523.pngQQ图片20210419211526.png

1 Accepted Solution

Accepted Solutions

Seb Rupik
VIP Alumni
VIP Alumni

Hi there,

Try the following config. You will need to adjust the interface IDs to suit your existing topology:

 

!! R1
int fa0/1
  no shut
int fa0/1.10
  encapsulation dot1q 10
  ip address 10.0.10.254 255.255.255.0
int fa0/1.20
  encapsulation dot1q 20
  ip address 10.0.20.254 255.255.255.0
int fa0/1.30
  encapsulation dot1q 30
  ip address 10.0.30.254 255.255.255.0
int fa0/1.40
  encapsulation dot1q 40
  ip address 10.0.40.254 255.255.255.0
int fa0/1.50
encapsulation dot1q 50
ip address 10.0.50.254 255.255.255.0 ! !! S1 ! vlan 10 vlan 20 vlan 30 vlan 40
vlan 50 ! int gi1/0/3 desc connected to R1 switchoirt mode trunk switchport trunk allowed vlan 10,20,30,40,50 no shut !
int gi1/0/4
desc connected to S3
switchoirt mode trunk
switchport trunk allowed vlan 10,20,30,40,50
no shut
! int po1 desc PO to S2 switchoirt mode trunk switchport trunk allowed vlan 10,20,30,40,50 no shut ! spanning-tree vlan 10,20,30,40,50 priorty 4096 ! !! S2 ! vlan 10 vlan 20 vlan 30 vlan 40
vlan 50 ! int gi1/0/3 desc connected to S3 switchoirt mode trunk switchport trunk allowed vlan 10,20,30,40,50 no shut
! int po1 desc PO to S1 switchoirt mode trunk switchport trunk allowed vlan 10,20,30,40,50 no shut ! !! S3 ! vlan 10 vlan 20 vlan 30 vlan 40
vlan 50 ! int gi1/0/1 desc connected to S1 switchoirt mode trunk switchport trunk allowed vlan 10,20,30,40,50 no shut ! int gi1/0/2 desc connected to S2 switchoirt mode trunk switchport trunk allowed vlan 10,20,30,40,50 no shut !

cheers,

Seb.

View solution in original post

3 Replies 3

Seb Rupik
VIP Alumni
VIP Alumni

Hi there,

Try the following config. You will need to adjust the interface IDs to suit your existing topology:

 

!! R1
int fa0/1
  no shut
int fa0/1.10
  encapsulation dot1q 10
  ip address 10.0.10.254 255.255.255.0
int fa0/1.20
  encapsulation dot1q 20
  ip address 10.0.20.254 255.255.255.0
int fa0/1.30
  encapsulation dot1q 30
  ip address 10.0.30.254 255.255.255.0
int fa0/1.40
  encapsulation dot1q 40
  ip address 10.0.40.254 255.255.255.0
int fa0/1.50
encapsulation dot1q 50
ip address 10.0.50.254 255.255.255.0 ! !! S1 ! vlan 10 vlan 20 vlan 30 vlan 40
vlan 50 ! int gi1/0/3 desc connected to R1 switchoirt mode trunk switchport trunk allowed vlan 10,20,30,40,50 no shut !
int gi1/0/4
desc connected to S3
switchoirt mode trunk
switchport trunk allowed vlan 10,20,30,40,50
no shut
! int po1 desc PO to S2 switchoirt mode trunk switchport trunk allowed vlan 10,20,30,40,50 no shut ! spanning-tree vlan 10,20,30,40,50 priorty 4096 ! !! S2 ! vlan 10 vlan 20 vlan 30 vlan 40
vlan 50 ! int gi1/0/3 desc connected to S3 switchoirt mode trunk switchport trunk allowed vlan 10,20,30,40,50 no shut
! int po1 desc PO to S1 switchoirt mode trunk switchport trunk allowed vlan 10,20,30,40,50 no shut ! !! S3 ! vlan 10 vlan 20 vlan 30 vlan 40
vlan 50 ! int gi1/0/1 desc connected to S1 switchoirt mode trunk switchport trunk allowed vlan 10,20,30,40,50 no shut ! int gi1/0/2 desc connected to S2 switchoirt mode trunk switchport trunk allowed vlan 10,20,30,40,50 no shut !

cheers,

Seb.

Thanks, it is very useful. But I still have a question. For R1 and R2, if R1 has a loopback interface which Ip address is 209.165.200.12 /24. If both PC need to ping the loopback interface, how should I configure R1 and R2 with static routes. I guess on R2 I can use static host routes and static routes for R1. Is that correct?

Hi there,

I have just noticed in my config example, where I had R1 I actually meant R2....hopefully you noticed that. 

Regarding your routing question...

On R2 you should probably configure a static route:

 

!! R2
ip route 0.0.0.0 0.0.0.0 <R1_serial_int_ip_address>
!

Then on R1 you need a static route directing traffic to R2 for its connected subnets:

 

!! R1
ip route 10.0.10.0 255.255.255.0 <R1_serial_int_ip_address>
ip route 10.0.20.0 255.255.255.0 <R1_serial_int_ip_address>
ip route 10.0.30.0 255.255.255.0 <R1_serial_int_ip_address>
ip route 10.0.40.0 255.255.255.0 <R1_serial_int_ip_address>
ip route 10.0.50.0 255.255.255.0 <R1_serial_int_ip_address>
!

cheers,

Seb.