04-19-2021 09:51 PM - edited 04-19-2021 09:55 PM
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.)
Solved! Go to Solution.
04-20-2021 01:53 AM - edited 04-20-2021 03:00 AM
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.
04-20-2021 01:53 AM - edited 04-20-2021 03:00 AM
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.
04-20-2021 02:21 PM
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?
04-21-2021 01:56 AM
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.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide