2022年锐捷基本配置 .pdf
1.1 通过 TELNET方式来配置设备提问:如何通过 telnet 方式来配置设备?回答:步骤一:配置 VLAN1 的 IP 地址S5750en - 进入特权模式S5750#conf - 进入全局配置模式 S5750(config)#int vlan 1 - 进入 vlan 1 接口S5750(config-if)#ip address 192.168.0.230 255.255.255.0 -为 vlan 1 接口上设置管理 ipS5750(config-if)#exit -退回到全局配置模式步骤二:配置 telnet 密码S5750(config)#line vty 0 4 - 进入 telnet 密码配置模式S5750(config-line)#login -启用需输入密码才能telnet 成功S5750(config-line)#password rscstar - 将 telnet 密码设置为 rscstarS5750(config-line)#exit -回到全局配置模式enable secret level 15 0 rscstar-配置进入特权模式的密码为rscstar1.2 更改 IOS 命令的特权等级提问:如何只允许dixy 这个用户使用与 ARP 相关的命令?回答:S5750(config)#username dixy password dixy - 设置 dixy 用户名和密码S5750(config)#username dixy privilege 10 -dixy 帐户的权限为 10S5750(config)#privilege exec level 10 show arp-权限 10 可以使用 show arp 命令名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 1 页,共 7 页 - - - - - - - - - S5750(config)#privilege config all level 10 arp -权限 10 可以使用所有 arp 打头的命令S5750(config)#line vty 0 4 - 配置 telnet 登陆用户S5750(config-line)#no passwordS5750(config-line)#login local1.3 设备时钟设置提问:如何设置设备时钟?回答:S5750#clock set 12:45:55 11 25 2008 -设置时间为 2008 年 11 月 25 日 12 点 45 分 55 秒S5750#clock update-calendar - 设置日历更新 S5750(config)#clock timezone CN 8 22 - 时间名字为中国,东8 区 22 分2.1 交换机 vlan 和 trunk 的配置提问:如何在交换机上划分vlan,配置 trunk 接口?回答:步骤一:给交换机配置IP 地址S2724G#confS2724G(config)#int vlan 1S2724G(config-if)#ip addess 192.168.0.100 255.255.255.0-给 VLAN 1 配置IP 地址S2724G(config-if)#no shutdown -激活该 VLAN 接口S2724G(config-if)#exitS2724G(config)#ip default-gateway 192.168.0.1 -指定交换机的网关地址名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 2 页,共 7 页 - - - - - - - - - 步骤二:创建 VLANS2724G#confS2724G(config)#vlan 10 -创建 VLAN 10S2724G(config-vlan)#exitS2724G(config)# vlan 20 -创建 VLAN 20S2724G(config-vlan)#exit步骤三:把相应接口指定到相应的VLAN 中S2724G(config)#int gi 0/10S2724G(config-if)#switch access vlan 10 -把交换机的第 10 端口划到 VLAN 10 中S2724G(config-if)#exitS2724G(config)#int gi 0/20S2724G(config-if)#switch access vlan 20 -把交换机的第 20 端口划到 VLAN 20 中S2724G(config-if)#exitS2724G(config)#int gi 0/24S2724G(config-if)#switch mode trunk -设置 24 口为 Trunk 模式(与三层交换机的连接口S2724G(config-if)#步骤四:保存配置S2724G(config-if)#endS2724G#write2.2 turnk接口修剪配置提问:如何让 trunk 接口只允许部分 vlan 通过?回答:名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 3 页,共 7 页 - - - - - - - - - Switch(config)#int fa 0/24Switch (config-if)#switch mode trunkSwitch (config-if)#switchport trunk allowed vlan remove 10,20,30-40-不允许 VLAN10,20,30-40通过 Trunk 口2.3 PVLAN 配置提问:如何实现几组用户之间的隔离,但同时又都能访问公用服务?回答:步骤一:创建隔离VLANS2724G#confS2724G(config)#vlan 3 -创建 VLAN3S2724G(config-vlan)#private-vlan community -将 VLAN3 设为隔离 VLANS2724G(config)#vlan 4 -创建 VLAN4S2724G(config-vlan)#private-vlan community -将 VLAN4 设为隔离 VLANS2724G(config-vlan)#exit -退回到特权模式步骤二:创建主 VLANS2724G(config)#vlan 2 -进入 VLAN2S2724G(config-vlan)#private-vlan primary -VLAN2为主 VLAN步骤三:将隔离 VLAN 加到到主 VLAN 中VLANS2724G(config-vlan)#private-vlan association add 3-4 -将 VLAN3 和 VLAN4 加入到公用 VLAN 中,VLAN3 和 VLAN4 的用户可以访问公用接口步骤四:将实际的物理接口与VLAN 相对应S2724G(config)#interface GigabitEthernet 0/1 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 4 页,共 7 页 - - - - - - - - - -进入接口 1,该接口连接服务器或者上联设备S2724G(config-if)#switchport mode private-vlan promiscuous -接口模式为混杂模式S2724G(config-if)#switchport private-vlan mapping 2 add 3-4 -将 VLAN3 和 VLAN4 映射到 VLAN2 上S2724G(config)#int gi 0/10 -进入接口 10S2724G(config-if)#switchport mode private-vlan hostS2724G(config-if)#switchport private-vlan host-association 2 3 -该接口划分入 VLAN3S2724G(config)#int gi 0/20 -进入接口 20S2724G(config-if)#switchport mode private-vlan hostS2724G(config-if)#switchport private-vlan host-association 2 4 -该接口划分入 VLAN4步骤五:完成 VLAN 的映射S2724G(config)#int vlan 2 -进入 VLAN2 的 SVI 接口S2724G(config-if)#ip address 192.168.2.1 255.255.255.0 -配置 VLAN2 的 ip 地址S2724G(config-if)#private-vlan mapping add 3-4 -将 VLAN3 和 VLAN4 加入到 VLAN2 中注释:1. S20、S21 不支持私有 VLAN,可以通过保护端口实现类似功能2. S3250 、S3750 和 S5750 同时支持保护端口和私有VLAN3. S3760 不支持私有 VLAN 和保护端口名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 5 页,共 7 页 - - - - - - - - - 2.4 端口汇聚配置提问:如何将交换机的端口捆绑起来使用?回答:S5750#confS5750(config)#interface range gigabitEthernet 0/1 4 - 同时进入 1 到 4 号接口S5750(config-if)#port-group 1 -设置为聚合口 1S5750(config)#interface aggregateport 1 -进入聚合端口 1注意:配置为 AP 口的接口将丢失之前所有的属性,以后关于接口的操作只能在AP1 口上面进行2.5 生成树配置提问:如何配置交换机的生成树?回答:步骤一:根桥的设置switch_A#conf tswitch_A(config)#spanning-tree - 默认模式为 MSTPswitch_A(config)#spanning-tree mst configurationswitch_A(config)#spanning-tree mst 10 priority 4096 -设置为根桥步骤二:非根桥的设置switch_B#conf tswitch_B(config)#spanning-tree - 默认模式为 MSTPswitch_B(config)#spanning-tree mst configurationswitch_B(config)#int f0/1 -PC的接入端口switch_B(config)#spanning-tree bpduguard enable 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 6 页,共 7 页 - - - - - - - - - switch_B(config)#spanning-tree portfast2.6 端口镜像设置提问:如何配置交换机的端口镜像?回答:switch#conf tswitch#(config)#switch (config)# monitor session 1 source interface gigabitEthernet 3/1 both -监控源口为 g3/1switch (config)# monitor session 1 destination interface gigabitEthernet 3/8 switch - 监控目的口为 g3/8,并开启交换功能注意: S2026 交换机镜像目的端口无法当做普通接口使用名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 7 页,共 7 页 - - - - - - - - -