文档库 最新最全的文档下载
当前位置:文档库 › 锐捷交换机基本配置

锐捷交换机基本配置

enable 进入特权模式
configure terminal 进入全局模式
interface fa0/1 进入端口模式
exit 退出端口模式
exit 退出全局模式
锐捷交换机基础配置
2009-5-12 来源:ruijie 作者:ruijie 【大 中 小】 点击:2205 次
2.1 交换机vlan 和trunk 的配置
提问:如何在交换机上划分vlan,配置trunk 接口?
回答:
步骤一:给交换机配置IP 地址
S2724G#conf
S2724G(config)#int vlan 1
S2724G(config-if)#ip addess 192.168.0.100 255.255.255.0
锐捷RGNOS CookBook
6
----给VLAN 1 配置IP 地址
S2724G(config-if)#no shutdown ----激活该VLAN 接口
S2724G(config-if)#exit
S2724G(config)#ip default-gateway 192.168.0.1 ----指定交换机的网关地址
步骤二:创建VLAN
S2724G#conf
S2724G(config)#vlan 10 ----创建VLAN 10
S2724G(config-vlan)#exit
S2724G(config)# vlan 20 ----创建VLAN 20
S2724G(config-vlan)#exit
步骤三:把相应接口指定到相应的VLAN 中
S2724G(config)#int gi 0/10
S2724G(config-if)#switch access vlan 10
----把交换机的第10 端口划到VLAN 10 中
S2724G(config-if)#exit
S2724G(config)#int gi 0/20
S2724G(config-if)#switch access vlan 20
----把交换机的第20 端口划到VLAN 20 中
S2724G(config-if)#exit
S2724G(config)#int gi 0/24
S2724G(config-if)#switch mode trunk
----设置24 口为Trunk 模式(与三层交换机的连接口
S2724G(config-if)#
步骤四:保存配置
S2724G(config-if)#end
S2724G#write
———————————————————————————————————————
2.2 turnk 接口修剪配置
提问:如何让trunk 接口只允许部分vlan 通过?
锐捷RGNOS CookBook
7
回答:
Switch(config)#int fa 0/24
Switch (config-if)#switch mode trunk
Switch (config-if)#switchport trunk allowed vlan remove 10,20,30-40
----不允许VLAN10,20,30-40 通过Trunk 口
———————————————————————————————————————
2.3 PVLAN 配置
提问:如何实现几组用户之间的隔离,但同时又都能访问公用服务?
回答:
步骤一:创建隔离VLAN
S2724G#conf
S2724G(config)#vlan 3 ----创建VLAN3
S2724G(config-vlan)#private-vlan community ----将VLAN3 设为隔离VLAN
S2724G(config)#vlan 4 ----创建VLAN4
S2724G(config-vlan)#private-vlan community ----将VLAN4 设为隔离VLAN
S2724G(config-vlan)#exit ----退回到特权模式
步骤二:创建主VLAN
S2724G(config)#vlan 2 ----进入VLAN2
S2724G(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
----进入接口1,该接口连接服务器或者上联设备
S2724G(config-if)#switchport mode private-vlan p

romiscuous
----接口模式为混杂模式
S2724G(config-if)#switchport private-vlan mapping 2 add 3-4
锐捷RGNOS CookBook
8
----将VLAN3 和VLAN4 映射到VLAN2 上
S2724G(config)#int gi 0/10 ----进入接口10
S2724G(config-if)#switchport mode private-vlan host
S2724G(config-if)#switchport private-vlan host-association 2 3
----该接口划分入VLAN3
S2724G(config)#int gi 0/20 ----进入接口20
S2724G(config-if)#switchport mode private-vlan host
S2724G(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 同时支持保护端口和私有VLAN
3. S3760 不支持私有VLAN 和保护端口
———————————————————————————————————————
2.4 端口汇聚配置
提问:如何将交换机的端口捆绑起来使用?
回答:
S5750#conf
S5750(config)#interface range gigabitEthernet 0/1 – 4 ----同时进入1 到4 号接口
S5750(config-if)#port-group 1 ----设置为聚合口1
S5750(config)#interface aggregateport 1 ----进入聚合端口1
注意:配置为AP 口的接口将丢失之前所有的属性,以后关于接口的操作只能在AP1 口上面
锐捷RGNOS CookBook
9
进行
———————————————————————————————————————
2.5 生成树配置
提问:如何配置交换机的生成树?
回答:
步骤一:根桥的设置
switch_A#conf t
switch_A(config)#spanning-tree ---默认模式为MSTP
switch_A(config)#spanning-tree mst configuration
switch_A(config)#spanning-tree mst 10 priority 4096 ---设置为根桥
步骤二:非根桥的设置
switch_B#conf t
switch_B(config)#spanning-tree ---默认模式为MSTP
switch_B(config)#spanning-tree mst configuration
switch_B(config)#int f0/1 ---PC 的接入端口
switch_B(config)#spanning-tree bpduguard enable
switch_B(config)#spanning-tree portfast
———————————————————————————————————————
2.6 端口镜像配置
提问:如何配置交换机的端口镜像?
回答:
switch#conf t
switch#(config)#
switch (config)# monitor session 1 source interface gigabitEthernet 3/1 both
---监控源口为g3/1
switch (config)# monitor session 1 destination interface gigabitEthernet 3/8 switch
---监控目的口为g3/8,并开启交换功能
注意:S2026 交换机镜像目的端口无法当做普通接口使用


disable 退出特权模式
end 从端口退到特权模式













某端口的接口配置模式

下进行
(config)#interface vlan 10 进入VLAN 10的虚拟端口配置模式
(config-if)# ip address 192.168.1.1 255.255.255.0 为VLAN10的虚拟端口配置IP及掩码,二层交换机只能配置一个IP,此IP是作为管理IP使用,例如,使用Telnet的方式登录的IP地址
(config-if)# no shutdown 启用该端口


相关文档