juniper EX系列交换机VLAN配置操作

配置VLAN

初始化配置时候,所有端口属于default VLAN,default vlan的默认ID是0

user@host# set interfaces name unit 0 family ethernet-switching port-mode access

#配置端口的access模式,默认端口就是access模式。

user@host#set vlans vlan-name vlan-id number

#配置VLAN分配vlan ID

EX支持2种方式来配置access接口分配到VLAN,采用其中一种就可以实现端口VLAN的划分。

方式一:

user@host#set vlans vlan-name interface interface_name 

直接在VLAN中添加多个物理端口

方式二:

或是在物理接口下:

user@host#set interfaces interface-name unit 0 family ethernet-switching vlan members vlan-name or vlan-id

#添加端口到特定VLAN

user@host# show vlans vlan-name detail 

#查看VLAN信息

Example: 

root@host> edit

Entering configuration mode

[edit]

root@host# set vlans sales vlan-id 100

[edit]

root@host# set vlans sales interface ge-0/0/1

#或者可以如下配置,实现相同的配置效果

[edit]

root@host# set interfaces ge-0/0/1 unit 0 family ethernet-switching vlan members sales

[edit]

root@host# commit

​​​​​​​配置RVI接口

user@host# set interfaces vlan unit number family inet address x.x.x.x/yy

#配置RVI端口和地址

user@host# set vlans vlan_name l3-interface vlan.unit-number

#绑定RVI端口到某个VLAN

user@host# show vlans

user@host# show interface terse

user@host# show Ethernet-switching interface

#查看VLAN和端口信息

Example: 

root@host> edit

Entering configuration mode

[edit]

root@host# set interface vlan unit 100 family inet 192.168.3.254/24

[edit]

root@host# set vlans sales l3-interface vlan.100

[edit]

root@host# commit

​​​​​​​配置Vlan trunk

配置端口作trunk端口,支持802.1Q的标准封装。

user@host# set interfaces name unit 0 family ethernet-switching port-mode trunk

#配置端口的VLAN模式为trunk模式

user@host# set interfaces name unit 0 family ethernet-switching vlan members all|number

#配置trunk端口的允许通过的VLAN,9.1版本目前不支持vlan-range,预期在9.2版本支持。

Example: 

root@host> edit

Entering configuration mode

[edit]

root@host#show

interfaces {        
    ge-0/0/3 {
        unit 0 {
            family ethernet-switching {
                port-mode trunk;
                vlan {
                    members [ orange blue ];
                }
            }
        }
    }
    ge-0/0/4 {
        unit 0 {
            family ethernet-switching {
                port-mode trunk;
                vlan {
                    members [ 100 200 ];
                }
            }
        }
    }               

}

配置native-vlan-id

EX在trunk端口下支持native-vlan的配置:

root@host> edit

Entering configuration mode

[edit]

root@host# set interface ge-0/0/8 unit 0 family Ethernet-switch native-vlan-id purple

[edit]

root@host#show interface

ge-0/0/8 {
    unit 0 {
        family ethernet-switching {
            port-mode trunk;
            vlan {
                members [ orange blue purple ];
            }
            native-vlan-id purple;
        }
    }
}

​​​​​​​GVRP配置

GVRP(GARP VLAN Registration Protocol,GARP VLAN 注册协议)是GARP(Generic Attribute Registration Protocol,通用属性注册协议)的一种应用,它基于GARP 的工作机制,维护设备中的VLAN 动态注册信息,并传播该信息到其它的设备中。设备启动GVRP 特性后,能够接收来自其它设备的VLAN 注册信息,并动态更新本地的VLAN 注册信息,包括当前的VLAN 成员、这些VLAN 成员可以通过哪个端口到达等。而且设备能够将本地的VLAN 注册信息向其它设备传播,以便使同一局域网内所有设备的VLAN 信息达成一致。

[edit]

set protocols gvrp enable join-timer 40

set protocols gvrp enable leave-timer 120

set protocols gvrp enable leaveall-timer 2000

set protocols gvrp interface all enable

通过show gvrp以及show vlan查看

你可能感兴趣的:(网络数通,安全,网络,juniper,数通,路由交换)