JUNIPEREX3200交换机配置文档格式.docx
《JUNIPEREX3200交换机配置文档格式.docx》由会员分享,可在线阅读,更多相关《JUNIPEREX3200交换机配置文档格式.docx(10页珍藏版)》请在冰豆网上搜索。
root@%
注意使用root用户登录的情况下,输入帐号/密码以后,默认是进入shell模式的(而只有root用户帐号有这个现象),要输入cli命令进入用户模式:
root@%cli
root>
2配置模式
用户模式下输入configure命令进入配置模式,配置模式下可以对设备进行各种参数的配置
configure
[edit]
root#
2.1设置root用户密码
命令:
setsystemroot-authenticationplain-text-password
路由器初始化root用户是没有密码的,在第一次进行配置的时候必须要配置root密码才能commit成功。
密码采用字母+数字方式。
Example:
lab@M7i_GZ#setsystemroot-authenticationplain-text-password
Newpassword:
Retypenewpassword:
2.2添加系统用户
setsystemloginuserjuniperuid2000
<
-设置用户名为juniper用户id为2000
setsystemloginuserjuniperclasssuper-user
-设置juniper用户为超级用户
setsystemloginuserjuniperauthenticationplain-text-password
-设置juniper用户的密码
2.3设置主机名
setsystemhost-nameM7i_GZ
-设置主机名为M7i_GZ
2.4开启系统telnet服务
setsystemservicestelnet
说明:
系统默认是没有打开telnet功能的,只有打开telnet服务之后才能从网络上登陆到路由器。
2.5设置交换机地址
Editsystem
Setname-server192.168.17.225
Commit
删除:
Deletename-server192.168.17.225
2.6开启系统ftp服务
setsystemservicesftp
系统默认是没有打开ftp功能的,只有打开ftp服务之后才能从网络上ftp到路由器。
2.7配置SNMP
setsnmpcommunity
community>
authorization
<
read-only/read-write>
clients
prefix>
#设置SNMP字符串
setsnmptrap-optionssource-address192.168.1.1
#设置snmptrap的原地址为192.168.1.1
setsnmpcontact
contact>
#设置snmp的联系信息
setsnmpengine-idlocal
local>
#设置snmpv3engineID信息
setsnmpdescription
description>
#设置snmp的系统描述
2.8配置物理端口参数
user@host#setinterfacege-slot/pic/portdescriptiondescription
#配置端口描述
user@host#setinterfacege-slot/pic/portmtumtu-number
#配置端口MTU
user@host#setinterfacege-slot/pic/portether-optionsspeed(10m|100m|1g)
#配置端口速率
user@host#setinterfacege-slot/pic/portether-optionslink-mode(automatic|full-duplex|
half-duplex)
#配置端口双工
user@host#setinterfacege-slot/pic/portether-options(auto-negotiation|
no-auto-negotiation)
#配置端口自动协商
Example(例如):
root@host>
edit
Enteringconfigurationmode
root@host#setinterfacesge-3/0/0description“to_BJ-4200-1”
root@host#setinterfacesge-3/0/0mtu9216
root@host#setinterfacesge-3/0/0ether-optionsspeed1g
root@host#setinterfacesge-3/0/0ether-optionslink-mode
full-duplex
root@host#setinterfacesge-3/0/0ether-optionsauto-negotiation
2.9配置物理端口二层接口
root@host#setinterfacesge-0/0/16unit0familyethernet-switching
port-modeaccess
#配置物理端口作为二层access模式的接口,端口默认情况下就是二层access端口。
user@host#showinterfaces
ge-0/0/16{
unit0{
familyethernet-switching;
}
2.10配置物理端口三层接口
EX交换机物理接口可以支持三层路由接口功能,直接可以在接口上配置三层地址
root@host#setinterfacesge-0/0/17unit0familyinetaddress
192.168.20.1/24
2.11配置VLAN
初始化配置时候,所有端口属于defaultVLAN,defaultvlan的默认ID是0
user@host#setinterfacesnameunit0familyethernet-switchingport-modeaccess
#配置端口的access模式,默认端口就是access模式。
user@host#setvlansvlan-namevlan-idnumber
#配置VLAN分配vlanID
EX支持2种方式来配置access接口分配到VLAN,采用其中一种就可以实现端口VLAN的划分。
方式一:
user@host#setvlansvlan-nameinterfaceinterface_name
直接在VLAN中添加多个物理端口
方式二:
或是在物理接口下:
user@host#setinterfacesinterface-nameunit0familyethernet-switchingvlanmembers
vlan-nameorvlan-id
#添加端口到特定VLAN
user@host#showvlansvlan-namedetail
#查看VLAN信息
root@host#setvlanssalesvlan-id100
root@host#setvlanssalesinterfacege-0/0/1
#或者可以如下配置,实现相同的配置效果
root@host#setinterfacesge-0/0/1unit0familyethernet-switching
vlanmemberssales
2.12配置Vlantrunk
配置端口作trunk端口,支持802.1Q的标准封装。
user@host#setinterfacesnameunit0familyethernet-switchingport-modetrunk
#配置端口的VLAN模式为trunk模式
user@host#setinterfacesnameunit0familyethernet-switchingvlanmembers
all|number
#配置trunk端口的允许通过的VLAN,9.1版本目前不支持vlan-range,预期在9.2版本支持。
root@host#show
interfaces{
ge-0/0/3{
familyethernet-switching{
port-modetrunk;
vlan{
members[orangeblue];
ge-0/0/4{
members[100200];
2.13配置native-vlan-id
EX在trunk端口下支持native-vlan的配置:
root@host#setinterfacege-0/0/8unit0familyEthernet-switch
native-vlan-idpurple
root@host#showinterface
ge-0/0/8{
members[orangebluepurple];
native-vlan-idpurple;
2.14静态路由协议
手工添加到路由表
下一跳必须有效
所以的配置在routing-options级别
Syntax(语法):
routing-options{
static{
defaults{
static-options;
routedestination-prefix{
next-hopnext-hop;
qualified-next-hopaddress{
metricmetric;
preferencepreference;
s