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查看

  • 27
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

it技术分享just_free

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值