Description

The router-on-a-stick term is used to describe a network device that routes traffic between two networks, by using one physical network interface. It has also been called a Stub router and One-armed router.

Symptoms

The Router on a stick configuration can be used, if we want to route traffic across multiple VLANs. Since the router routes traffic across different VLANs, we need to add VLAN tagging.



Solution


Router JSRX-1 is directly connected to a VLAN capable switch .Our aim is to talk to SITE-1 on one subnet and SITE-2 on another, over the same Fast Ethernet port.

The first step, in configuring VLANs, is to enable VLAN tagging on the physical interface. For example, we are using fe-0/0/1 as the physical interface; we can also use the ge interface.

[edit interfaces fe-0/0/1]
testname@SRX-1# set vlan-tagging

[edit interfaces fe-0/0/1]
testname@JSRX-1# show
vlan-tagging;
speed 100m;
link-mode full-duplex;

[edit interfaces fe-0/0/1]
testname@JSRX-1#

The next steps are to create the units, assign the units to the appropriate VLAN, and then configure the IP addresses in the units. We are specifying the speed as 100m and mode as full-duplex for the Fast Ethernet interface.

Here, VLANs 20 and 30 are being used:
[edit interfaces fe-0/0/1]
testname@JSRX-1# set unit 20 vlan-id 20

[edit interfaces fe-0/0/1]
testname@JSRX-1# set unit 20 family inet address 1.1.1.1/24

[edit interfaces fe-0/0/1]
testname@JSRX-1# set unit 30 vlan-id 30 family inet address 2.2.2.2/24

[edit interfaces fe-0/0/1]
testname@JSRX-1# show
vlan-tagging;
speed 100m;
link-mode full-duplex;
unit 20 {
    vlan-id 20;
    family inet {
        address 1.1.1.1/24;
    }  
}
unit 30 {
    vlan-id 30;
    family inet {
        address 2.2.2.2/24;
    }
}

[edit interfaces fe-0/0/1]
testname@JSRX-1#
Fast Ethernet 0/0/1 now has two logical units that are configured in VLANs on unit 20 and unit 30. This allows for routing across different VLANs via a single physical interface.