当前位置:文档之家› juniper学习笔记

juniper学习笔记

产品信息学习高性能数据中心技术点线速性能的集群交换技术TM(Virtual Chassis)服务质量(Qos)和HA(High Availability)ISCSI和NAS技术FCoE(Fiber Channel over Ethernet)空间、电源和制冷的需求数据中心产品线EX系列以太网交换机(集群技术/万兆线速性能)EX4200 EX8200 系列SRX系列业务网关(NAT/集中策略控制)SRX5000系列MX系列以太业务路由器/M系列多业务边缘路由器(MPLS技术)MX960产品配置学习EX系列交换机配置交换机配置模式CLI 有两种模式:用户模式和配置模式,用户模式的提示符是>,配置模式的提示符是#,在数用户模式下输入configure 或者edit 可以进入配置模式。

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

●在edit 这种方式中,exit 可以退回上一次用edit 进入以前的层,直接输入top 则退回最上层:●命令配置中,可以使用TAB 键和空格键来进行参数的补全,使用?来进行帮助commit命令的作用我们操作(增加、删除、修改)的那份配置文件只是一个候选文件(candidate configure),并不是正在运行的配置文件,只有将候选文件通过commit 提交之后,配置才会真正的应用到当前系统使用的active 配置文件中,从而使得修改的配置生效。

Show命令在用户模式和配置模式的区别户模式和配置模式下的show 命令是不同的,如果要在配置模式下运行用户模式命令,则需要在命令前面加一个run如何将配置转换成set 命令Juniper# show protocols ospf | display set基本配置(1) 设置root 密码Set root-authentication plain-text-password(2) 设置主机名set host-name EX4200(3) 设置日期时间set time-zone Asia/Shanghailab@EX4200> set date 200811071441.00(4) 添加用户(5) 开启ssh/telnet/http 服务(6) 设置DNS(可选配置)set name-server 192.168.1.1(7) 分配新的用户权限(可选配置)(8) 设置NTP 服务器(可选配置)VLAN的配置交换机二层和三层信息是配置在端口下的逻辑端口,而Juniper 交换机的逻辑端口是通过unit逻辑单元来实现的,unit 0 是默认的逻辑端口,所有引用到二层/三层端口都是引用unit 0,例如对于物理端口ge-0/0/0,其二层和三层协议用到的逻辑端口就是ge-0/0/0.0,IP 地址信息、VLAN 信息等都在ge-0/0/0.0 下面配置如果创建一个名字为SDB_vlan 的VLAN 10,并且网关设置为192.168.1.1/24,ge-0/0/1 属于该VLAN。

配置步骤:(1) 创建VLAN#编辑vlan 信息SDB_vlan 是vlan 名字,如果不存在则新建一个VLANlab@EX4200-1# edit vlans SDB_vlan #"以下所有操作都是对SDB_vlan 进行"[edit vlans SDB_vlan]lab@EX4200-1# set vlan-id 10 #"设置SDB_vlan 的vlan id"lab@EX4200-1# set description "Server VLAN" #"设置vlan 描述"lab@EX4200-1# set l3-interface vlan.10 #"将绑定三层逻辑子端口"(10代表unit号)lab@EX4200-1# set interface ge-0/0/1.0 #"将端口加入到VLAN 中"lab@EX4200-1# set interface ge-0/0/2.0 #"将端口加入到VLAN 中"set interfaces vlan unit 0 family inet address 192.0.2.0/25set interfaces vlan unit 1 family inet address 192.0.2.128/25set vlans sales l3–interface vlan.0set vlans sales vlan-id 100set vlans support vlan-id 200set vlans support l3-interface vlan.1(2) 创建三层逻辑子端口lab@EX4200-1# top #"回到最外层菜单"[edit]lab@EX4200-1# set interfaces vlan unit 10 family inet address 192.168.1.1/24 (10代表unit号)(3) 将交换机端口修改为access 模式并加入到新创建的VLAN 中lab@EX4200-1# top #"回到最外层菜单"[edit]lab@EX4200-1# set interfaces ge-0/0/1 unit 0 family ethernet-switching port-mode access lab@EX4200-1# set interfaces ge-0/0/1 unit 0 family ethernet-switching vlan members 10 lab@EX4200-1# set interfaces ge-0/0/2 unit 0 family ethernet-switching port-mode access lab@EX4200-1# set interfaces ge-0/0/2 unit 0 family ethernet-switching vlan members 10set interfaces ge-0/0/0 unit 0 family ethernet-switching vlan members salesset interfaces ge-0/0/3 unit 0 family ethernet-switching vlan members salesset interfaces ge-0/0/22 unit 0 family ethernet-switching vlan members salesset interfaces ge-0/0/20 unit 0 family ethernet-switching vlan members salesset interfaces ge-0/0/24 unit 0 family ethernet-switching vlan members supportset interfaces ge-0/0/26 unit 0 family ethernet-switching vlan members supportset interfaces ge-0/0/44 unit 0 family ethernet-switching vlan members supportset interfaces ge-0/0/46 unit 0 family ethernet-switching vlan members supportIEEE 802.1Q协议Trunk接口配置:set interfaces ge-0/1/0 unit 0 family ethernet-switching port-mode trunkset interfaces ge-0/1/0 unit 0 family ethernet-switching nativevlan-id 1端口配置修改端口L2/L3层模式如果将交换机端口设置为二层模式,就可以配置交换机为vlan 端口或者Trunk 端口;设置为三层模式,就可以当路由器三层端口一样使用,可以配置IP 地址。

通常在跟路由器进行点对点连接的时候将端口设置为三层模式。

lab@EX4200-1# edit interfaces ge-0/0/1lab@EX4200-1# delete unit 0 family ethernet-switching #"删除二层信息"lab@EX4200-1# set unit 0 family inet #设置为三层端口lab@EX4200-1# set unit 0 family inet address 192.168.1.1/30 #"设置三层IP 地址"set interfaces ge-0/0/1 unit 0 family inetset interfaces ge-0/0/1 unit 0 family inet address 192.168.1.1/30POE设置set poe interface all disableset poe interface allset poe interface ge-0/0/1set poe guard-band 15set poe interface allSTP协议配置Port trunking 配置(IEEE 802.3ad)set chassis aggregated-devices ethernet device-count 2set interfaces ge-0/0/1 ether-options 802.3ad ae0set interfaces ae0 unit 0 family ethernet-switching port-mode trunkset interfaces ae0 unit 0 family ethernet-switching port-mode accessset interfaces ae0 unit 0 family ethernet-switching vlan members 10set interfaces ae0 unit 0 family inet address 192.168.1.1/24路由协议配置静态路由协议set routing-options static route 172.16.1.0/24 next-hop 192.168.1.253set routing-options static route 0.0.0.0/0 qualified-next-hop 20.1.1.1 preference 200set routing-options static route 0.0.0.0/0 qualified-next-hop 20.1.1.1 interface ge-0/0/1.0OSPF路由协议配置(1) 配置router id(2) 配置启动OSPF协议(3) 配置OSPF 端口参数(4) 配置OSPF export 策略(路由重定向)1. 广播式广播式网络类型是L A N上的缺省类型。

相关主题