JuniperEX4200中文配置手册全集详解Word文件下载.docx
《JuniperEX4200中文配置手册全集详解Word文件下载.docx》由会员分享,可在线阅读,更多相关《JuniperEX4200中文配置手册全集详解Word文件下载.docx(74页珍藏版)》请在冰豆网上搜索。
Enteringconfigurationmode
{master}[edit]
lab@EX4200#
configure
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
在edit这种方式中,exit可以退回上一次用edit进入以前的层,直接输入top则退回最上层:
lab@EX4200#exit
分两次输入edit进入ospf,最后输入exit退回protols那层。
lab@EX4200#editprotocolsospf
[edit]
分一次edit进入ospf,最后输入exit退回最外层.
lab@EX4200#top
输入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?
value>
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是查看端口信息:
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:
db
Lastflapped:
2007-06-2920:
37:
17HKT(1w2d00:
31ago)
Inputrate:
280bps(0pps)
Outputrate:
1280bps(1pps)
Activealarms:
None
Activedefects:
Logicalinterfacege-0/0/1.0(Index83)(SNMPifIndex71)
Flags:
SNMP-Traps0x4000VLAN-Tag[0x8100.33]Encapsulation:
ENET2
Inputpackets:
0
Outputpackets:
0
Protocolinet,MTU:
1500
None
而在配置下show命令是显示相关的配置,比如showinterface则是显示interface部分的配置:
lab@EX4200#showinterfaces
ge-0/0/1{
unit0{
familyethernet-switchingvlanmembers10;
familyinet;
因此说用户模式和配置模式下的show命令是不同的,如果要在配置模式下运行用户模式命令,则需要在命令前面加一个run
lab@EX4200#runshowinterfaces
36ago)
792bps(0pps)
672bps(0pps)
None
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
icmp_seq=1ttl=64time=7.949ms
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
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{
lab@EX4200#showprotocolsospf|displayset
setprotocolsospfexportTest_Policy_1
setprotocolsospfarea0.0.0.0interfacege-0/0/1.0hello-interval10
1.1.6commit和rollback
在cisco中只要输入命令,回车之后命令马上生效,因为我们修改的就是系统正在使用的running-config配置文件。
而在JUNOS中完全不同,我们操作(增加、删除、修改)的那份配置文件只是一个候选文件(candidateconfigure),并不是正在运行的配置文件,只有将候选文件通过commit提交之后,配置才会真正的应用到当前系统使用的active配置文件中,从而使得修改的配置生效。
为了检查配置是否有错,可以在commit之前使用commitcheck来对配置进行语法检查。
为了避免提交时出错,建议不要同时两个人修改配置。
如果提交之后,可以使用rollback进行回滚,rollback1回滚上一次提前之前的配置,rollback2则是回滚上2次提交之前的配置:
lab@EX4200#showsystemhost-name
host-nameEX4200;
lab@EX4200#setsystemhost-nameR1
lab@EX4200#commit
commitcomplete
lab@EX4200#rollback1
loadcomplete
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参数
//设置二层输入包过滤条件
//设置二层输出包过滤条件
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-profile-nameaccess-profile-name;
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