juniper交换机将多个接口加入同时到vlan中

[EX/QFX] Wildcard range commands for EX switches

[KB23789] Show KB Properties

SUMMARY:

This article provides information about the wildcard range commands for EX switches.

PROBLEM OR GOAL:

The wildcard range option enables you to configure multiple interface configuration statements by using a single set command; instead of configuring each of them individually for interfaces. The range option with the wildcard command enables you to specify ranges in activate, deactivate, delete, protect, set, show, and unprotect commands.

CAUSE:

SOLUTION:

VLAN output before applying configuration:

{master:0}[edit]

[email protected]# run show vlans

Name Tag Interfaces

default        ge-0/0/5.0, ge-0/0/6.0, ge-0/0/7.0, ge-0/0/8.0,

ge-0/0/9.0, ge-0/0/11.0, ge-0/0/12.0, ge-0/0/13.0,

ge-0/0/14.0, ge-0/0/15.0, ge-0/0/16.0, ge-0/0/17.0,

ge-0/0/18.0, ge-0/0/19.0, ge-0/0/20.0, ge-0/0/21.0,

ge-0/0/22.0, ge-0/0/23.0, ge-0/0/24.0, ge-0/0/25.0,

ge-0/0/26.0, ge-0/0/27.0, ge-0/0/28.0, ge-0/0/29.0,

ge-0/0/30.0, ge-0/0/31.0, ge-0/0/32.0, ge-0/0/33.0,

ge-0/0/34.0, ge-0/0/35.0, ge-0/0/36.0, ge-0/0/37.0,

ge-0/0/38.0, ge-0/0/39.0, ge-0/0/40.0, ge-0/0/41.0,

ge-0/0/42.0, ge-0/0/43.0, ge-0/0/44.0, ge-0/0/45.0,

ge-0/0/46.0, ge-0/0/47.0

tes110 110 ge-0/0/1.0

test100 100 ge-0/0/0.0

test127 127 ge-0/0/2.0

test254 254 ge-0/0/3.0, ge-0/0/4.0, ge-0/0/10.0

v500 500 None

Command issued to add a group of interfaces to a VLAN:

[email protected]# wildcard range set interfaces ge-0/0/[11-13,16,23,45] unit 0 family ethernet-switching vlan members v500

VLAN output after applying the configuration:

{master:0}[edit]

[email protected]# run show vlans

Name Tag Interfaces

default         ge-0/0/5.0, ge-0/0/6.0, ge-0/0/7.0, ge-0/0/8.0, ge-0/0/9.0, ge-0/0/14.0, ge-0/0/15.0, ge-0/0/17.0, ge-0/0/18.0, ge-0/0/19.0,

ge-0/0/20.0, ge-0/0/21.0, ge-0/0/22.0, ge-0/0/24.0, ge-0/0/25.0, ge-0/0/26.0, ge-0/0/27.0, ge-0/0/28.0, ge-0/0/29.0, ge-0/0/30.0,

ge-0/0/31.0, ge-0/0/32.0, ge-0/0/33.0, ge-0/0/34.0, ge-0/0/35.0, ge-0/0/36.0, ge-0/0/37.0, ge-0/0/38.0, ge-0/0/39.0, ge-0/0/40.0,

ge-0/0/41.0, ge-0/0/42.0, ge-0/0/43.0, ge-0/0/44.0, ge-0/0/46.0, ge-0/0/47.0

tes110 110  ge-0/0/1.0

test100 100 ge-0/0/0.0

test127 127 ge-0/0/2.0

test254 254 ge-0/0/3.0, ge-0/0/4.0, ge-0/0/10.0

v500      500 ge-0/0/11.0, ge-0/0/12.0, ge-0/0/13.0, ge-0/0/16.0, ge-0/0/23.0, ge-0/0/45.0

//下面的配置效果和上面的一样

The end result is that the same configuration is applied to all of the above interfaces:

[email protected]# set interfaces ge-0/0/11 unit 0 family ethernet-switching vlan members v500

[email protected]# set interfaces ge-0/0/12 unit 0 family ethernet-switching vlan members v500

[email protected]# set interfaces ge-0/0/13 unit 0 family ethernet-switching vlan members v500

[email protected]# set interfaces ge-0/0/16 unit 0 family ethernet-switching vlan members v500

[email protected]# set interfaces ge-0/0/23 unit 0 family ethernet-switching vlan members v500

[email protected]# set interfaces ge-0/0/45 unit 0 family ethernet-switching vlan members v500

The same can be used for the following purposes - active, deactivate, delete, protect, set, show, and unprotect configuration commands.

This new option is documented in the Release Notes (including the link). For more information, refer to the following configuration example:

http://www.juniper.net/techpubs/en_US/junos/topics/example/junos-cli-wildcard-range-configuring.html

PURPOSE:

Configuration

Implementation

RELATED LINKS:

时间: 2024-10-29 10:45:47

juniper交换机将多个接口加入同时到vlan中的相关文章

cacti监控交换机GigabitEthernet不显示接口

cacti监控华为交换机时图形上显示的GigabitEthernet没有显示出具体的接口,原因是Cacti的"最大域长度"默认为15.而当设备的接口描述字符长度超过这个值时,会导致超出部分无法显示. 解决办法: 1.Console -> Settings -> Visual -> Maximum Field Length: 默认15,修改成80. 2.Console--Graph Templates--Interface - Traffic (bits/sec)-Gr

在C++中定义接口类,在C#中实现

网上大部分都是C#调用C++的接口,很少有C++调用C#的,更少有在C++中定义接口类,在C#中实现. 千辛万苦,终于找到一个网址:http://www.tuicool.com/articles/AFjY7j 简单翻译一下, class __declspec(dllexport) CSimpleClass { public: int value; CSimpleClass(int value) : value(value) { } ~CSimpleClass() { printf("~CSimp

python3备份juniper交换机

#!/usr/bin/env python3# -*- coding: utf-8 -*-"""  Author:  Linxy -- <[email protected]>  Purpose: Juniper备份脚本  Created: 2017-6-23""" import datetimeimport sysimport osimport telnetlibfrom email import encodersfrom email

Juniper交换机做端口镜像

前一段时间部署了一台分析流量的的设备,需要将端口的流量镜像到该服务器的网卡一份. 由于juniper操作命令不熟悉,网上命令也比较少.因此写份Blog记录下. EX交换机的端口镜像实现对端口入流量,或者出流量单独进行镜像,而且通过ethernet-switching的firewall filter,可以指定符合条件的流量进行镜像,例如指定IP地址或者MAC地址的流量,或者指定协议(例如Http)的流量镜像. 操作步骤: (1)建立一个端口镜像名称,并且指定需要作镜像的端口,同一个镜像名称可以指定

juniper交换机ex2200配置(生产环境)

qnqy-dpf-jrex2200-01# show | display set set version 12.3R11.2set system host-name qnqy-dpf-jrex2200-01set system time-zone Asia/Shanghaiset system root-authentication encrypted-password "$1$7RMyTyeG$tLGAToBggMFhcOw85Ts.EP/"set system login user

ssh下:系统初始化实现ServletContextListener接口时,获取spring中数据层对象无效的问题

想要实现的功能:SSH环境下,数据层都交由Spring管理:在服务启动时,将数据库中的一些数据加载到ServletContext中缓存起来. 系统初始化类需要实现两个接口: ServletContextListener,系统初始化时调用contextInitialized方法缓存数据: ApplicationContextAware,获取Spring的ApplicationContext对象,以获取spring容器管理的service对象. 系统初始化类如下: 1 package com.liz

C++ 11可变参数接口设计在模板编程中应用的一点点总结

概述 本人对模板编程的应用并非很深,若要用一句话总结我个人对模板编程的理解,我想说的是:模板编程是对类定义的弱化. 如何理解“类定义的弱化”? 一个完整的类有如下几部分组成: 类的名称: 类的成员变量(或属性,C#中属性和成员变量还是有区别的): 类的成员方法: 从编译器的角度看,我们必须明确指定以上3部分,才算完整地定义了一个类并且编译通过. 所谓的“类弱化”,是指类的设计者在定义类的时候,并没有完整定义一个类,而是把类的其中一部分的定义留给类的使用者. 从传统才c++98看,通过模板类,使用

iOS中自定义UIView(用接口获取Lable和TextFile中的值)

NSArray *arrayText = @[@"用户名",@"密码",@"确认密码",@"手机号",@"邮箱"]; NSArray *placeholders = @[@"请输入用户名",@"请输入密码",@"请确认密码",@"请输入手机号",@"请输入邮箱"]; NSInteger y = 30; for

接口和抽象类在项目中的用处经验

抽象类与接口: 抽象类:一般用于描述一个体系单元,将一组共性内容进行抽取,特点:可以在类中定义抽象内容让子类实现,可以定义非抽象内容让子类直接使用.它里面定义的都是一些体系中的基本内容. 接口:一般用于定义对象的扩展功能,是在继承之外还需这个对象具备的一些功能.