EX交换机配置手册v1.2 - 图文 下载本文

EX3200/4200交换机

命令行配置指导手册

Version 1.2

2008年11月

目 录

1

交换机基础知识 ........................................................................................................................................... 6 1.1 认识JUNIPER交换机 ....................................................................................................................................................... 6 1.2 EX交换机JUNOS操作系统基础 .................................................................................................................................. 8 1.2.1 交换机配置模式 .................................................................................................................................................... 8 1.2.2 交换机配置结构 .................................................................................................................................................... 9 1.2.3 TAB和空格键的使用 ........................................................................................................................................... 12 1.2.4 用户模式和配置模式show的区别 .................................................................................................................... 13 1.2.5 如何将配置转换成set命令 ............................................................................................................................... 16 1.2.6 commit和rollback ............................................................................................................................................... 16 2

操作指导 .................................................................................................................................................... 18 2.1 通过CONSOLE线连接交换机 ........................................................................................................................................ 18 2.2 配置交换机之前要知道 .............................................................................................................................................. 19 2.3 SYSTEM系统参数配置 ................................................................................................................................................... 20 2.3.1 设置root密码 ..................................................................................................................................................... 20 2.3.2 设置主机名 .......................................................................................................................................................... 21 2.3.3 设置DNS服务器 ................................................................................................................................................. 21 2.3.4 设置日期时间 ...................................................................................................................................................... 21 2.3.5 设置NTP服务器.................................................................................................................................................. 23 2.3.6 开启远程Telnet登陆服务 .................................................................................................................................. 23 2.3.7 开启远程Ftp服务 ............................................................................................................................................... 24 2.3.8 开启远程ssh登陆 ............................................................................................................................................... 25 2.3.9 开启远程WEB登陆服务..................................................................................................................................... 25 2.3.10 添加/删除用户 ................................................................................................................................................... 27

2.3.10.1 添加/修改用户............................................................................................................................................................... 28 2.3.10.2 删除用户 ........................................................................................................................................................................ 28

2.3.11 用户权限设置 .................................................................................................................................................... 28 2.4 设置ALARM告警 ........................................................................................................................................................... 30 2.5 VLAN配置 .................................................................................................................................................................... 30 2.5.1 添加/修改VLAN ................................................................................................................................................... 31 2.5.2 删除VLAN ............................................................................................................................................................ 32 2.6 TRUNK配置 .................................................................................................................................................................... 33 2.6.1 Trunk配置步骤 .................................................................................................................................................... 34 2.6.2 Trunk删除 ............................................................................................................................................................ 35 2.7 端口配置 ...................................................................................................................................................................... 35

第2页 共110页

2.7.1 打开/关闭端口 ..................................................................................................................................................... 35 2.7.2 配置带外管理口(网管口) .................................................................................................................................... 36 2.7.3 修改端口MTU等参数 ........................................................................................................................................ 36 2.7.4 修改端口为L2/L3模式 ....................................................................................................................................... 37 2.7.5 修改端口速率和工作模式 .................................................................................................................................. 37 2.8 POE设置 ...................................................................................................................................................................... 38 2.9 生成树配置 .................................................................................................................................................................. 39 2.9.1 STP配置实例 ....................................................................................................................................................... 39 2.9.2 RSTP配置实例 ..................................................................................................................................................... 40 2.9.3 MSTP配置 实例 ................................................................................................................................................... 43 2.10 端口捆绑 .................................................................................................................................................................... 46 2.10.1 什么是端口捆绑 ................................................................................................................................................ 46 2.10.2 端口捆绑步骤 .................................................................................................................................................... 47 2.10.3 设置负载均衡算法 ............................................................................................................................................ 48

2.10.3.1 指定L2算法 .................................................................................................................................................................. 49 2.10.3.2 指定L3/L4算法 ............................................................................................................................................................. 49

2.11 ECMP负载均衡配置.................................................................................................................................................. 49 2.11.1 EX交换机ECMP原理 ........................................................................................................................................ 50 2.11.2 ECMP配置实例 .................................................................................................................................................. 51 2.12 路由协议配置 ............................................................................................................................................................ 53 2.12.1 静态路由配置 .................................................................................................................................................... 53

2.12.1.1 添加静态路由 ................................................................................................................................................................ 53 2.12.1.2 删除静态路由 ................................................................................................................................................................ 54 2.12.1.3 调整静态路由优先值 .................................................................................................................................................... 54 2.12.1.4 设置备份静态路由 ........................................................................................................................................................ 54 2.12.1.5 指定静态路由下一跳端口 ............................................................................................................................................ 54

2.12.2 OSPF配置 ........................................................................................................................................................... 55

2.12.2.1 OSPF配置步骤 ............................................................................................................................................................... 55 2.12.2.2 OSPF配置实例 ............................................................................................................................................................... 58

2.13 MULTI-VRF配置 ............................................................................................................................................................ 61 2.14 MULTI-VRF OSPF实例 ................................................................................................................................................... 64 2.15 端口镜像 .................................................................................................................................................................... 70 2.15.1 端口输入输出流量镜像 .................................................................................................................................... 70 2.15.2 带过滤条件的端口镜像 .................................................................................................................................... 71 2.16 端口MAC限制和IP绑定 ......................................................................................................................................... 72 2.17 端口广播风暴控制 .................................................................................................................................................... 73

第3页 共110页

2.18 VRRP配置 .................................................................................................................................................................. 73 2.18.1 如何配置VRRP .................................................................................................................................................. 74 2.18.2 如何检查VRRP状态 ......................................................................................................................................... 76 2.18.3 如何切换VRRP .................................................................................................................................................. 76 2.19 BFD配置 .................................................................................................................................................................... 76 2.19.1 OSPF中配置BFD ............................................................................................................................................... 76 2.19.2 静态路由中配置BFD ......................................................................................................................................... 77 2.20 交换机FIREWALL限制功能 ......................................................................................................................................... 77 2.20.1 限制IP地 ........................................................................................................................................................... 77 2.20.2 限制MAC地址 .................................................................................................................................................. 78 2.21 VIRTUAL-CHASSIS设置 ................................................................................................................................................... 78 2.22 VC知识....................................................................................................................................................................... 78 2.22.1 如何建立VC组 .................................................................................................................................................. 79 2.22.2 如何扩充VC组交换机 ...................................................................................................................................... 81 2.22.3 如何利用uplink链路组成VC .......................................................................................................................... 82 2.22.4 如何对VC组进行切换 ...................................................................................................................................... 84 2.23 SNMP配置 ................................................................................................................................................................. 85 2.24 SYSLOG配置 ................................................................................................................................................................. 86 3

交换机维护操作 ......................................................................................................................................... 87 3.1 交换机启动和关闭 ...................................................................................................................................................... 87 3.1.1 重新启动 .............................................................................................................................................................. 87 3.1.2 关闭 ...................................................................................................................................................................... 87 3.2 配置备份和恢复 .......................................................................................................................................................... 87 3.2.1 配置备份 .............................................................................................................................................................. 88 3.2.2 配置恢复 .............................................................................................................................................................. 89 3.3 如何升级交换机OS ..................................................................................................................................................... 89 3.4 如何恢复出厂设置 ...................................................................................................................................................... 90 3.5 密码恢复 ...................................................................................................................................................................... 90 3.6 日常维护命令 .............................................................................................................................................................. 91 3.6.1 查看序列号show chassis hardware ................................................................................................................ 92 3.6.2 查看硬件show chassis hardware .................................................................................................................... 92 3.6.3 查看软件版本show version .............................................................................................................................. 92 3.6.4 查看CPU show chassis routing-engine .......................................................................................................... 92 3.6.5 ping命令 .............................................................................................................................................................. 92 3.6.6 查看设备告警信息 show chassis alarms ......................................................................................................... 92

第4页 共110页