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

2023-12-06 00:30

本文主要是介绍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 EX系列交换机VLAN配置操作的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/459727

相关文章

SpringBoot多环境配置数据读取方式

《SpringBoot多环境配置数据读取方式》SpringBoot通过环境隔离机制,支持properties/yaml/yml多格式配置,结合@Value、Environment和@Configura... 目录一、多环境配置的核心思路二、3种配置文件格式详解2.1 properties格式(传统格式)1.

Python操作PDF文档的主流库使用指南

《Python操作PDF文档的主流库使用指南》PDF因其跨平台、格式固定的特性成为文档交换的标准,然而,由于其复杂的内部结构,程序化操作PDF一直是个挑战,本文主要为大家整理了Python操作PD... 目录一、 基础操作1.PyPDF2 (及其继任者 pypdf)2.PyMuPDF / fitz3.Fre

Debian系和Redhat系防火墙配置方式

《Debian系和Redhat系防火墙配置方式》文章对比了Debian系UFW和Redhat系Firewalld防火墙的安装、启用禁用、端口管理、规则查看及注意事项,强调SSH端口需开放、规则持久化,... 目录Debian系UFW防火墙1. 安装2. 启用与禁用3. 基本命令4. 注意事项5. 示例配置R

Python对接支付宝支付之使用AliPay实现的详细操作指南

《Python对接支付宝支付之使用AliPay实现的详细操作指南》支付宝没有提供PythonSDK,但是强大的github就有提供python-alipay-sdk,封装里很多复杂操作,使用这个我们就... 目录一、引言二、准备工作2.1 支付宝开放平台入驻与应用创建2.2 密钥生成与配置2.3 安装ali

MySQL 强制使用特定索引的操作

《MySQL强制使用特定索引的操作》MySQL可通过FORCEINDEX、USEINDEX等语法强制查询使用特定索引,但优化器可能不采纳,需结合EXPLAIN分析执行计划,避免性能下降,注意版本差异... 目录1. 使用FORCE INDEX语法2. 使用USE INDEX语法3. 使用IGNORE IND

PyCharm中配置PyQt的实现步骤

《PyCharm中配置PyQt的实现步骤》PyCharm是JetBrains推出的一款强大的PythonIDE,结合PyQt可以进行pythion高效开发桌面GUI应用程序,本文就来介绍一下PyCha... 目录1. 安装China编程PyQt1.PyQt 核心组件2. 基础 PyQt 应用程序结构3. 使用 Q

Redis MCP 安装与配置指南

《RedisMCP安装与配置指南》本文将详细介绍如何安装和配置RedisMCP,包括快速启动、源码安装、Docker安装、以及相关的配置参数和环境变量设置,感兴趣的朋友一起看看吧... 目录一、Redis MCP 简介二、安www.chinasem.cn装 Redis MCP 服务2.1 快速启动(推荐)2.

Spring Boot配置和使用两个数据源的实现步骤

《SpringBoot配置和使用两个数据源的实现步骤》本文详解SpringBoot配置双数据源方法,包含配置文件设置、Bean创建、事务管理器配置及@Qualifier注解使用,强调主数据源标记、代... 目录Spring Boot配置和使用两个数据源技术背景实现步骤1. 配置数据源信息2. 创建数据源Be

Python使用openpyxl读取Excel的操作详解

《Python使用openpyxl读取Excel的操作详解》本文介绍了使用Python的openpyxl库进行Excel文件的创建、读写、数据操作、工作簿与工作表管理,包括创建工作簿、加载工作簿、操作... 目录1 概述1.1 图示1.2 安装第三方库2 工作簿 workbook2.1 创建:Workboo

Spring Boot Maven 插件如何构建可执行 JAR 的核心配置

《SpringBootMaven插件如何构建可执行JAR的核心配置》SpringBoot核心Maven插件,用于生成可执行JAR/WAR,内置服务器简化部署,支持热部署、多环境配置及依赖管理... 目录前言一、插件的核心功能与目标1.1 插件的定位1.2 插件的 Goals(目标)1.3 插件定位1.4 核