How to Configure VLAN in Juniper
- 1). Create a layer 2 VLAN by entering the code below:
root# set vlans <vlan-name> vlan-id <vlan-id (1..4095)> - 2). Create a logical layer 3 VLAN interface:
root# set interfaces vlan unit <unit# (0..16385)> family inet address <ip address/mask> - 3). Link the layer 2 VLAN to the layer 3 VLAN interface:
root# set vlans <vlan-name> l3-interface vlan.<unit# mentioned above>
Repeat steps 1-3 for all logical VLANs. - 4). Verify that the logical VLAN interface is "up":
root> show interfaces terse
vlan.10 up up inet 10.0.0.1/24
At least one access port or trunk port must be "up" with that VLAN assigned to it for the layer 3 VLAN to be "up." - 5). Verify the routes of the VLAN logical interfaces:
root> show route
10.0.0.0/24 *[Direct/0] 1d 01:16:45
> via vlan.10
10.0.0.1/32 *[Local/0] 1d 01:16:45
Local via vlan.10