Adding a VLAN on a Juniper MX

Juniper MX SP Style Bridging

First you configure your interfaces to accept packets with the right VLAN tags:

interfaces { ge-0/0/0 { vlan-tagging; encapsulation extended-vlan-bridge; unit 200 { vlan-id 200; } } ge-0/0/1 { vlan-tagging; encapsulation extended-vlan-bridge; unit 200 { vlan-id 200; } } }

Then configure a bridge domain that bridges these two:

bridge-domains { vlan-200 { vlan-id 200; interface ge-0/0/0.200; interface ge-0/0/1.200; } }

Now you have a bridged VLAN 200 on these two ports.

Untagged / Access Interfaces

If you have an untagged "access" port that you want to bridge, you can do that too by using this syntax:

interfaces { ge-0/0/0 { encapsulation ethernet-bridge; unit 0 { family bridge; } } }

Then use ge-0/0/0.0 in your bridge configuration.

L3 Interface / Routing Interface

To add a L3 interface to the mix, first define an Integrated Routing and Bridging Interface (IRB) with your IP:

irb { unit 200 { family inet { address 192.168.1.1/24; } } }

And then add this interface to your bridge:

bridge-domains { vlan-200 { vlan-id 200; routing-interface irb.200; interface ge-0/0/0.200; interface ge-0/0/1.200; } }

That should complete your setup.

It's a bit more complex than the "normal" VLAN concept found on other switches/devices but it's also way more flexible. For example you could have another two ports that also have VLAN-ID 200 configured and they could have their own bridge, completely separated from the first bridge you just configured.

Juniper MX Enterprise Style Bridging

requires: family, interface mode, vlan-id

interfaces { ge-0/0/0 { unit 0 { family bridge { interface-mode trunk; vlan-id-list [ 1 2 ]; } } } ge-0/0/1 { unit 0 { family bridge { interface-mode trunk; vlan-id-list [ 1 2 ]; } } } } bridge-domains { VLAN-1 { vlan-id 1; } VLAN-2 { vlan-id 2; } }