JuniperEX4200中文配置手册.docx

上传人:b****6 文档编号:5741156 上传时间:2022-12-31 格式:DOCX 页数:73 大小:416.30KB
下载 相关 举报
JuniperEX4200中文配置手册.docx_第1页
第1页 / 共73页
JuniperEX4200中文配置手册.docx_第2页
第2页 / 共73页
JuniperEX4200中文配置手册.docx_第3页
第3页 / 共73页
JuniperEX4200中文配置手册.docx_第4页
第4页 / 共73页
JuniperEX4200中文配置手册.docx_第5页
第5页 / 共73页
点击查看更多>>
下载资源
资源描述

JuniperEX4200中文配置手册.docx

《JuniperEX4200中文配置手册.docx》由会员分享,可在线阅读,更多相关《JuniperEX4200中文配置手册.docx(73页珍藏版)》请在冰豆网上搜索。

JuniperEX4200中文配置手册.docx

JuniperEX4200中文配置手册

 

EX4200/3200交换机

命令配置手册

 

1交换机基础知识

1.1Junos操作系统基础

Juniper交换机支持两种配置方式:

采用命令行的CLI(command-lineinterface)配置方式,以及采用web浏览器界面JWeb配置方式。

本指导书主要是采用命令行的配置方式。

交换机配置可以采用console终端配置方式,也可以采用远程telnet方式进行配置,第一次配置的时候必须采用console方式,然后在交换机上打开telnet服务并且配置网络IP地址以及设置用户名和密码,然后才可以进行远程telnet配置。

系统初始化用户名是root,密码是空。

1.1.1交换机配置模式

CLI有两种模式:

用户模式和配置模式,用户模式的提示符是>,配置模式的提示符是#,在数用户模式下输入configure或者edit可以进入配置模式:

用户模式:

lab@EX4200>#用户模式

在用户模式下可以显示交换机的配置、端口状态、路由信息等。

登录到交换机上即进入交换机的用户模式:

Example:

login:

EX42

Password:

lab@EX4200>

配置模式:

lab@EX4200##配置模式

通过在用户模式使用edit命令或者configure命令进入配置模式:

lab@EX4200>edit

Enteringconfigurationmode

{master}[edit]

lab@EX4200#

lab@EX4200>configure

Enteringconfigurationmode

{master}[edit]

lab@EX4200#

1.1.2交换机配置结构

Juniper交换机的配置是一种层次化的配置模式,如下图所示:

第一层次protocols协议层里面,可以包含bgp、isis和ospf等第二层次参数配置,而ospf层次里面,又可以定义第三层参数,比如area和traceoptions等,area下面又可以定义interface、area-range等第四层参数,而dead-interval、hello-interval等第五层参数则属于第四层interface下面的参数。

由于是层次化结构,因此配置一个参数有两种方式,一是在最外层使用一条set命令将所有层的参数一次写完,另外一种方式是利用edit逐层进入需要配置参数的层次,然后用set命令直接设置参数。

例如要在ospf协议area0中将interfacege-0/0/1.0的hello-interval时间设置为10秒,那么可以有两种设置方式:

方法一:

lab@EX4200#setprotocolsospfarea0interfacege-0/0/1.0hello-interval10

方法二:

lab@EX4200#editprotocols

[editprotocols]

lab@EX4200#editospf

[editprotocolsospf]

lab@EX4200#editarea0

[editprotocolsospfarea0.0.0.0]

lab@EX4200#editinterfacege-0/0/1.0

[editprotocolsospfarea0.0.0.0interfacege-0/0/1.0]

lab@EX4200#sethello-interval10

[editprotocolsospfarea0.0.0.0interfacege-0/0/1.0]

lab@EX4200#

在edit这种方式中,exit可以退回上一次用edit进入以前的层,直接输入top则退回最上层:

lab@EX4200#editprotocols

[editprotocols]

lab@EX4200#editospf

[editprotocolsospf]

lab@EX4200#exit

[editprotocols]

lab@EX4200#

分两次输入edit进入ospf,最后输入exit退回protols那层。

 

lab@EX4200#editprotocolsospf

[editprotocolsospf]

lab@EX4200#exit

[edit]

lab@EX4200#

分一次edit进入ospf,最后输入exit退回最外层.

lab@EX4200#editprotocols

[editprotocols]

lab@EX4200#editospf

[editprotocolsospf]

lab@EX4200#top

[edit]

lab@EX4200#

输入top直接退出到最外层。

另外,juniper的配置参数有些可以一次写几个,比如要一次配置ospf的hello-time和dead-time可以按照下面写法:

lab@EX4200#setprotocolsospfarea0interfacege-0/0/1.0hello-interval10dead-interval10

输入以上命令之后,交换机的配置如下:

protocols{

ospf{

area0.0.0.0{

interfacege-0/0/1.0{

hello-interval10;

}

}

}

}

 

注意:

如果不知道一条命令里面后面是否还可以跟其它配置参数,那么最好使用?

帮助一下:

lab@EX4200#setprotocolsospfarea0interfacege-0/0/1.0hello-interval10?

Possiblecompletions:

<[Enter]>Executethiscommand

+apply-groupsGroupsfromwhichtoinheritconfigurationdata

+apply-groups-exceptDon'tinheritconfigurationdatafromthesegroups

>authentication

>bfd-liveness-detectionBidirectionalForwardingDetectionoptions

dead-intervalDeadinterval(seconds)(1..65535)

demand-circuitInterfacefunctionsasademandcircuit

disableDisableOSPFonthisinterface

interface-typeTypeofinterface

ipsec-saIPSecsecurityassociationname

>ldp-synchronizationAdvertisemaximummetricuntilLDPisoperational

metricInterfacemetric(1..65535)

>neighborNBMAneighbor

no-neighbor-down-notificationDon'tinformotherprotocolsaboutneighbordownevents

>passiveDonotrunOSPF,butadvertiseit

poll-intervalPollintervalforNBMAinterfaces(1..65535)

priorityDesignatedrouterpriority(0..255)

retransmit-intervalRetransmissioninterval(seconds)(1..65535)

te-metricTrafficengineeringmetric(1..65535)

transit-delayTransitdelay(seconds)(1..65535)

|Pipethroughacommand

[edit]

1.1.3TAB和空格键的使用

交换机JUNOS命令配置中,可以使用TAB键和空格键来进行参数的补全,在补全系统参数中两个键的作用是一样的,例如:

lab@EX4200#setpro<-输入TAB键或者空格键,则会补全protocols

lab@EX4200#setprotocols

而对于用户自己定义的参数,则只能用TAB来补全,比如我们定义了一个Test_Policy_1的策略,要在ospf中配置时可以使用?

来显示:

lab@EX4200#setprotocolsospfexport?

Possiblecompletions:

Exportpolicy

(Openanexpression

Test_Policy_1

[Openasetofvalues

[edit]

也可以直接输入T之后按TAB键来补全,而此时按空格键则无法补全:

lab@EX4200#setprotocolsospfexportT<-输入TAB键,则会补全Test_Policy_1

lab@EX4200#setprotocolsospfexportTest_Policy_1

1.1.4用户模式和配置模式show的区别

在用户模式下,是无法进行配置操作的,而只能查看系统的一些参数。

所以用户模式下的show命令是查看系统参数。

要看系统配置则使用showconfigure命令。

例如用户模式下showinterface是查看端口信息:

lab@EX4200>showinterfaces

Physicalinterface:

ge-0/0/1,Enabled,PhysicallinkisUp

Interfaceindex:

142,SNMPifIndex:

31

Link-leveltype:

Ethernet,MTU:

1518,Speed:

100mbps,Loopback:

Disabled,Sourcefiltering:

Disabled,

Flowcontrol:

Enabled

Deviceflags:

PresentRunning

Interfaceflags:

SNMP-TrapsInternal:

0x4000

CoSqueues:

4supported,4maximumusablequeues

Currentaddress:

00:

05:

85:

dc:

cc:

db,Hardwareaddress:

00:

05:

85:

dc:

cc:

db

Lastflapped:

2007-06-2920:

37:

17HKT(1w2d00:

31ago)

Inputrate:

280bps(0pps)

Outputrate:

1280bps(1pps)

Activealarms:

None

Activedefects:

None

Logicalinterfacege-0/0/1.0(Index83)(SNMPifIndex71)

Flags:

SNMP-Traps0x4000VLAN-Tag[0x8100.33]Encapsulation:

ENET2

Inputpackets:

0

Outputpackets:

0

Protocolinet,MTU:

1500

Flags:

None

lab@EX4200>

而在配置下show命令是显示相关的配置,比如showinterface则是显示interface部分的配置:

lab@EX4200#showinterfaces

ge-0/0/1{

unit0{

familyethernet-switchingvlanmembers10;

familyinet;

}

}

[edit]

lab@EX4200#

因此说用户模式和配置模式下的show命令是不同的,如果要在配置模式下运行用户模式命令,则需要在命令前面加一个run

lab@EX4200#runshowinterfaces

Physicalinterface:

ge-0/0/1,Enabled,PhysicallinkisUp

Interfaceindex:

142,SNMPifIndex:

31

Link-leveltype:

Ethernet,MTU:

1518,Speed:

100mbps,Loopback:

Disabled,Sourcefiltering:

Disabled,

Flowcontrol:

Enabled

Deviceflags:

PresentRunning

Interfaceflags:

SNMP-TrapsInternal:

0x4000

CoSqueues:

4supported,4maximumusablequeues

Currentaddress:

00:

05:

85:

dc:

cc:

db,Hardwareaddress:

00:

05:

85:

dc:

cc:

db

Lastflapped:

2007-06-2920:

37:

17HKT(1w2d00:

36ago)

Inputrate:

792bps(0pps)

Outputrate:

672bps(0pps)

Activealarms:

None

Activedefects:

None

Logicalinterfacege-0/0/1.0(Index83)(SNMPifIndex71)

Flags:

SNMP-Traps0x4000VLAN-Tag[0x8100.33]Encapsulation:

ENET2

Inputpackets:

0

Outputpackets:

0

Protocolinet,MTU:

1500

Flags:

None

[edit]

lab@EX4200#

lab@EX4200#runping172.27.69.8

PING172.27.69.8(172.27.69.8):

56databytes

64bytesfrom172.27.69.8:

icmp_seq=0ttl=64time=5.118ms

64bytesfrom172.27.69.8:

icmp_seq=1ttl=64time=7.949ms

64bytesfrom172.27.69.8:

icmp_seq=2ttl=64time=7.018ms

^C

---172.27.69.8pingstatistics---

3packetstransmitted,3packetsreceived,0%packetloss

round-tripmin/avg/max/stddev=5.118/6.695/7.949/1.178ms

[edit]

lab@EX4200#

lab@EX4200#runping172.27.69.8命令等同于lab@EX4200>ping172.27.69.8

 

1.1.5如何将配置转换成set命令

在配置模式下使用show或者在用户模式下使用showconfigure命令,输出结果是“程序化”的配置,这样的配置并不能直接粘贴到另外一台交换机上,不过可以在show后面使用管道符号加上displayset将其转换成set格式命令,然后可以直接粘贴到其它交换机上:

 

lab@EX4200#showprotocolsospf

exportTest_Policy_1;

area0.0.0.0{

interfacege-0/0/1.0{

hello-interval10;

}

}

[edit]

lab@EX4200#showprotocolsospf|displayset

setprotocolsospfexportTest_Policy_1

setprotocolsospfarea0.0.0.0interfacege-0/0/1.0hello-interval10

[edit]

lab@EX4200#

1.1.6commit和rollback

在cisco中只要输入命令,回车之后命令马上生效,因为我们修改的就是系统正在使用的running-config配置文件。

而在JUNOS中完全不同,我们操作(增加、删除、修改)的那份配置文件只是一个候选文件(candidateconfigure),并不是正在运行的配置文件,只有将候选文件通过commit提交之后,配置才会真正的应用到当前系统使用的active配置文件中,从而使得修改的配置生效。

 

为了检查配置是否有错,可以在commit之前使用commitcheck来对配置进行语法检查。

为了避免提交时出错,建议不要同时两个人修改配置。

如果提交之后,可以使用rollback进行回滚,rollback1回滚上一次提前之前的配置,rollback2则是回滚上2次提交之前的配置:

lab@EX4200#showsystemhost-name

host-nameEX4200;

[edit]

lab@EX4200#setsystemhost-nameR1

[edit]

lab@EX4200#commit

commitcomplete

[edit]

lab@EX4200#showsystemhost-name

host-nameEX4200;

[edit]

lab@EX4200#rollback1

loadcomplete

[edit]

lab@EX4200#showsystemhost-name

host-nameEX4200;

[edit]

lab@EX4200#commit

commitcomplete

[edit]

lab@EX4200#

1.2EX交换机命令菜单结构

vlans{

vlan-name{//vlan名字,自定义,下面所有参数都是针对该vlan

mac-limitaction;//设置vlan允许的最大mac

descriptiontext-description;//vlan描述

filterinputfilter-name;//设置VLAN输入流量过滤条件

filteroutputfilter-name;//设置VLAN输出流量过滤条件

l3-interfacevlan.logical-interface-number;//将vlan绑定到L3的vlan子端口

mac-table-aging-timeseconds;//设置vlan的mac表生存时间

vlan-idnumber;//设置vlanid

vlan-rangevlan-id-low-vlan-id-high;//同时创建多个vlan

}

}

chassis{

aggregated-devices{

ethernet{

device-countnumber;//设置聚合端口数量,范围是0-64

}

}

}

 

interfaces{

ae-x{

aggregated-ether-options{//设置聚合端口参数

lacpmode{//设置lacp模式

periodicfast/slow;//设置lacp包发送间隔时间,选择fast则隔1秒发送,选择

//slow每隔30秒发送

}

}

}

ge-chassis/pic/port{//设置ge端口参数

descriptiontext;//设置描述

ether-options{//ether-options参数

802.3adaex;//指定加入的聚合端口

auto-negotiation;//自动协商

flow-control;//流控制

link-modemode;//设置端口工作模式

speed(speed|auto-negotiation|no-autonegotiation);//设置端口速率

}

mtubytes;//设置端口MTU值,默认是1514

unitlogical-unit-number{//设置逻辑单元参数

familyethernet-switching{//设置L2参数

filterinputfilter-name;//设置二层输入包过滤条件

filteroutputfilter-name;//设置二层输出包过滤条件

l3-interfaceinterface-name-logical-unit-number;//在Trunk端口模式下设置允许通过的

//L3端口流量

native-vlan-idvlan-id//指定navitevlanid

port-modemode;//设置端口L2工作模式,为Trunk或者access模式

vlan{

members[(names|vlan-ids)];//设置端口属于哪个VLAN或者允许哪些VLAN通过

}

}

vlan-idvlan-id-number;//仅对GE或者ae端口有效,范围是1t到4094

}

vlan-tagging;//设置端口为vlan-tagging

}

}

protocols{

dot1x{

authenticator{

authentication-proaccess-pro;

static{

mac-address{

vlan-assignment(vlan-id|vlan-name);

interfaceinterface-names;

}

}

interface(all|interface-name){

disable;

guest-vlan(vlan-name|vlan-id);

maximum-requestsseconds;

no-reauthentication;

quiet-periodseconds;

reauthentication{

i

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 经管营销

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1