How to configure router on stick juniper

 

Router-on-a-stick is a most used to describe a setup up that consists of a router and switch connected using one Ethernet link configured as an 802.1q trunk link. in this tutorial we share how to configure router on stick on juniper.

Task 1

Sub-interface Configure on Juniper

IP address Assign on Juniper

Task 2

Trunk Port configure with allow vlan on Sw1

Access Port Configure on Sw1

Juniper 1 Configure

set system root-authentication plain-text-password

New password:
Retype new password:

edit interfaces em0

[edit interfaces em0]
root# set vlan-tagging

root# set unit 10 vlan-id 10 family inet address 192.168.1.1/24

root# set unit 20 vlan-id 20 family inet address 192.168.2.1/24

root# commit
commit complete

Sw1 Configure

IOU1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
IOU1(config)#vl
IOU1(config)#vlan 10,20
IOU1(config-vlan)#
IOU1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
IOU1(config)#
*Apr 20 09:56:14.924: %SYS-5-CONFIG_I: Configured from console by console
IOU1(config)#int e0/0
IOU1(config-if)#switchport trunk encapsulation do
IOU1(config-if)#switchport trunk encapsulation dot1q
*Apr 20 09:56:31.442: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to down
IOU1(config-if)#switchport mode trunk

IOU1(config-if)#switchport trunk allowed vlan 10
IOU1(config-if)#switchport trunk allowed vlan add 20

IOU1(config-if)#no sh

IOU1(config-if)#int e0/1
IOU1(config-if)#no sh

IOU1(config-if)#switchport mode access

IOU1(config-if)#switchport access vlan 10

IOU1(config-if)#int e0/2
IOU1(config-if)#no sh

IOU1(config-if)#switchport mode access

IOU1(config-if)#switchport access vlan 20

 

Verification:

root# run show arp
MAC Address       Address         Name                      Interface     Flags
00:50:79:66:68:00 192.168.1.2     192.168.1.2               em0.10        none
00:50:79:66:68:01 192.168.2.2     192.168.2.2               em0.20        none
Total entries: 2

 

PC1> ping 192.168.2.2
84 bytes from 192.168.2.2 icmp_seq=1 ttl=63 time=12.082 ms
84 bytes from 192.168.2.2 icmp_seq=2 ttl=63 time=9.681 ms
84 bytes from 192.168.2.2 icmp_seq=3 ttl=63 time=18.360 ms
84 bytes from 192.168.2.2 icmp_seq=4 ttl=63 time=17.433 ms
84 bytes from 192.168.2.2 icmp_seq=5 ttl=63 time=18.230 ms

 

 

 

 

 

 

 

 

 

 

Related posts

Leave a Comment