锐捷交换机基本配置
1.1 通过TELNET方式来配置设备
提问:如何通过telnet方式来配置设备?
回答:
1、 配置VLAN1的IP地址
S5750>en ----进入特权模式
S5750#conf ----进入全局配置模式
S5750(config)#int vlan 1 ----进入vlan 1接口
S5750(config-if)#ipaddress 192.168.0.230 255.255.255.0 ----为vlan 1接口上设置管理ip
S5750(config-if)#exit ----退回到全局配置模式
2、 配置telnet密码
S5750(config)#linevty 0 4 ----进入telnet密码配置模式
S5750(config-line)#login ---启用需输入密码才能telnet成功
S5750(config-line)#passwordrscstar ----将telnet密码设置为rscstar
S5750(config-line)#exit ----回到全局配置模式
S5750(config)#enablesecret 0 rscstar ----配置进入特权模式的密码为rscstar
———————————————————————————————————————
1.2 通过SSH的方式管理交换机
提问:如何通过SSH的方式管理交换机
回答:
1、全局开启SSH服务,并制定SSH的版本
Ruijie#conf t
Ruijie(config)#enable service ssh-server ---开启SSH服务,默认关闭
Ruijie(config)#ip ssh version 2 ----默认1.99版本,设置为版本2
2、添加登陆的用户名和密码
Ruijie(config)#username ruijie password ruijie
3、生成加密密钥:
Ruijie(config)#crypto key generate ? ---加密方式有两种:DSA和RSA
dsa Generate DSA keys
rsa Generate RSA keys
Ruijie(config)#crypto key generate rsa
Choose the size of the key modulus in the range of 360 to2048 for your
Signature Keys. Choosing a key modulus greater than 512may take
a few minutes.
How many bits in the modulus [512]: ---指定加密的位数即加密强度,默认是512位
% Generating 512 bit RSA1 keys ...[ok]
% Generating 512 bit RSA keys ...[ok]
第四步:在VTY线程下条用
Ruijie(config)#lin vty 0 4
Ruijie(config-line)#login
Ruijie(config-line)#password ruijie ----设置登陆密码为ruijie
Ruijie(config-line)#transport input ssh ---设置传输模式是SSH
调试命令:
Ruijie#show ip ssh ---查看SSH的参数信息(版本信息,重认证次数等参数)
SSH Enable - version 2.0
Authentication timeout: 120 secs; Authentication retries:3
Ruijie#show ssh ---查看SSH的在线用户信息(加密算法,状态,用户名等消息)
Connection Version Encryption Hmac State Username
0 2.0 aes256-cbc hmac-sha1 Session started ruijie
——————————————————————————————————————
1.3 更改IOS命令的特权等级
提问:如何只允许dixy这个用户使用与ARP相关的命令?
回答:
S5750(config)#usernamedixy password dixy ----设置dixy用户名和密码
S5750(config)#usernamedixy privilege 10 ----dixy帐户的权限为10
S5750(config)#privilegeexec level 10 show arp ----权限10可以使用show arp命令
S5750(config)#privilegeconfig all level 10 arp ----权限10可以使用所有arp打头的命令
S5750(config)#linevty 0 4 ----配置telnet登陆用户
S5750(config-line)#nopassword
S5750(config-line)#loginlocal
注释:15级密码为enable特权密码,无法更改,0级密码只能支持disable,enable,exit和help,1级密码无法进行配置。
———————————————————————————————————————
1.4 设备时钟设置
提问:如何设置设备时钟?
回答:
S5750#clock set12:45:55 11 25 2008
----设置时间为2008年11月25日12点45分55秒
S5750#clockupdate-calendar ----设置日历更新
S5750(config)#clocktimezone CN 8 22 ----时间名字为中国,东8区22分
———————————————————————————————————————
1.5 动态时钟设置(NTP)
提问:如何为交换机设置NTP?
回答:
1、在设备上设置DNS地址。
ruijie(config)# ip name-server202.98.96.68 ---设置当地DNS地址
2、 为 NTP 客户端指定一个 NTP 服务器:
ruijie(config)#ntpserver 192.168.210.222 ---指定服务器IP地址,本例假设时间服务器地址为192.168.210.222
ruijie(config)#ntpserver ntp server time.nist.gov ---或者直接设置网络上的时间服务器地址
3、进行 NTP 实时同步(可选):
ruijie(config)#ntpsynchronize
4、将一个 ID对应的密钥配置为全局信任密钥:
ruijie(config)#ntpauthentication-key 6 md5 ruijie
ruijie(config)#ntptrusted-key 6
ruijie(config)#ntpserver 192.168.210.222 key 6
SNTP设置:
ruijie(config)#sntp enable ---打开SNTP
ruijie(config)#sntpserver 192.168.210.222 ---设置服务器地址,sntp不支持用域名做服务。
> 注释:NTP用户设置设备时间与时间服务器的时间同步,NTP 服务缺省是关闭的。目前我们的设备暂不支持做时钟服务器。
———————————————————————————
2.1 交换机vlan和trunk的配置
提问:如何在交换机上划分vlan,配置trunk接口?
回答:
1、给交换机配置IP地址
S2724G#conf
S2724G(config)#int vlan 1
S2724G(config-if)#ip addess 192.168.0.100255.255.255.0 ----给VLAN 1配置IP地址
S2724G(config-if)#no shutdown ----激活该VLAN接口
S2724G(config-if)#exit
S2724G(config)#ip default-gateway 192.168.0.1 ----指定交换机的网关地址
2、 创建VLAN
S2724G#conf
S2724G(config)#vlan 10 ----创建VLAN 10
S2724G(config-vlan)#exit
S2724G(config)# vlan 20 ----创建VLAN 20
S2724G(config-vlan)#exit
3、 把相应接口指定到相应的VLAN中
S2724G(config)#int gi 0/10
S2724G(config-if)#switch access vlan10 ----把交换机的第10端口划到VLAN 10中
S2724G(config-if)#exit
S2724G(config)#int gi 0/20
S2724G(config-if)#switch access vlan20 ----把交换机的第20端口划到VLAN 20中
S2724G(config-if)#exit
S2724G(config)#int gi 0/24
S2724G(config-if)#switch mode trunk ----设置24口为Trunk模式(与三层交换机的连接口
S2724G(config-if)#
4、 保存配置
S2724G(config-if)#end
S2724G# write
———————————————————————————————————————
2.2turnk接口修剪配置
提问:如何让trunk接口只允许部分vlan通过?
回答:
Switch(config)#int fa0/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配置
提问:如何实现几组用户之间的隔离,但同时又都能访问公用服务?
回答:
1、创建隔离VLAN
S2724G#conf
S2724G(config)#vlan 3 ----创建VLAN3
S2724G(config-vlan)#private-vlancommunity ----将VLAN3设为隔离VLAN
S2724G(config)#vlan 4 ----创建VLAN4
S2724G(config-vlan)#private-vlancommunity ----将VLAN4设为隔离VLAN
S2724G(config-vlan)#exit ----退回到特权模式
2、创建主VLAN
S2724G(config)#vlan 2 ----进入VLAN2
S2724G(config-vlan)#private-vlan primary ----VLAN2为主VLAN
3、 将隔离VLAN加到到主VLAN中
VLANS2724G(config-vlan)#private-vlanassociation add 3-4 ----将VLAN3和VLAN4加入到公用VLAN中,VLAN3和VLAN4的用户可以访问公用接口
4、 将实际的物理接口与VLAN相对应
S2724G(config)#interfaceGigabitEthernet 0/1 ----进入接口1,该接口连接服务器或者上联设备
S2724G(config-if)#switchportmode private-vlan promiscuous ----接口模式为混杂模式
S2724G(config-if)#switchportprivate-vlan mapping 2 add 3-4 ----将VLAN3和VLAN4映射到VLAN2上
S2724G(config)#int gi 0/10 ----进入接口10
S2724G(config-if)#switchportmode private-vlan host
S2724G(config-if)#switchportprivate-vlan host-association 2 3 ----该接口划分入VLAN3
S2724G(config)#int gi 0/20 ----进入接口20
S2724G(config-if)#switchportmode private-vlan host
S2724G(config-if)#switchportprivate-vlan host-association 2 4 ----该接口划分入VLAN4
5、 完成VLAN的映射
S2724G(config)#int vlan 2 ----进入VLAN2的SVI接口
S2724G(config-if)#ipaddress 192.168.2.1 255.255.255.0 ----配置VLAN2的ip地址
S2724G(config-if)#private-vlanmapping add 3-4 ----将VLAN3和VLAN4加入到VLAN2中
注释:
- 隔离 VLAN的端口不能进行二层通讯,一个私有VLAN域中只有一个隔离VLAN;同一群体VLAN的端口可以互相进行二层通信,但不能与其它群体 VLAN 中的端口进行二层通信,一个私有VLAN域中可以有多个群体 VLAN;混杂端口(PromiscuousPort)可以与任意端口通讯。
- S21不支持私有VLAN,可以通过保护端口实现类似功能
- 目前支持Private Vlan的交换机系列有S20、S23、S26、S27、S29、S3750、S5750。
———————————————————————————————————————
2.4 端口汇聚配置
提问:如何将交换机的端口捆绑起来使用?
回答:
S5750#conf
S5750(config)#interfacerange gigabitEthernet 0/1 – 4 ----同时进入1到4号接口
S5750(config-if)#port-group1 ----设置为聚合口1
S5750(config)#interfaceaggregateport 1 ----进入聚合端口1
注意:配置为AP口的接口将丢失之前所有的属性,以后关于接口的操作只能在AP1口上面进行
———————————————————————————————————————
2.5 生成树配置
提问:如何配置交换机的生成树?
回答:
拓扑概况:双核心交换机A、B,A为VLAN1-4的根桥,B为VLAN5-8的根桥,利用多生成树协议实现负载均衡。
1、 VLAN1-4根桥的设置
switch_A#conf t switch_A(config)#spanning-tree --开启生成树协议,默认模式为MSTP switch_A(config)#spanning-treemst configuration switch_A(config-mst)# instance1 vlan 1,2,3,4 --创建实例1,并关联VLAN1-4
switch_A(config-mst)# instance2 vlan 5,6,7,8 --创建实例2,并关联VLAN5-8
switch_A(config)# spanning-treemst 1 priority 4096--创设置A为实例1的根桥,即VLAN1-4的根桥
2、 VLAN5-8根桥的设置
switch_B#conf t
switch_B(config)#spanning-tree --开启生成树协议,默认模式为MSTP
switch_B(config)#spanning-treemst configuration
switch_B(config-mst)# instance1 vlan 1,2,3,4 --创建实例1,并关联VLAN1-4
switch_B(config-mst)# instance2 vlan 5,6,7,8 --创建实例2,并关联VLAN5-8
switch_B(config)# spanning-treemst 2 priority 4096 --创设置B为实例2的根桥,即VLAN5-8的根桥
3、 其他分根桥交换机的设置
switch_C#conf t
switch_C(config)#spanning-tree --开启生成树协议,默认模式为MSTP
switch_C(config)#spanning-treemst configuration
switch_C(config-mst)# instance1 vlan 1,2,3,4 --创建实例1,并关联VLAN1-4
switch_C(config-mst)# instance2 vlan 5,6,7,8 --创建实例2,并关联VLAN5-8
switch_C(config)# intg0/1 --在接入终端PC的端口上配置
switch_C(config-if)# spanning-treebpduguard enable
switch_C(config-if)# spanning-treeportfast
注释:
- 配置完成后,可用命令showspanning-tree interface g0/24 ,showspanning-tree summary等查看生成树的相关状态。
———————————————————————————————————————
2.6 端口镜像配置
提问:如何配置交换机的端口镜像?
回答:
switch#conf t
switch#(config)#
switch (config)#monitor session 1 source interface gigabitEthernet 3/1 both ---监控源口为g3/1
switch (config)# monitor session 1destination interface gigabitEthernet 3/8 switch ---监控目的口为g3/8,并开启交换功能
注意:S2026交换机镜像目的端口无法当做普通接口使用
———————————————————————————————————————
2.7 交换机上配置CPU保护
提问:如何开启交换机的CPU保护功能?
回答:
1、 带宽的配置过程:
Ruijie(config)#cpu-protecttype bpdu pps 200 --设置BPDU报文的转发速率为200pps
2、 优先级的配置过程:
Ruijie(config)#cpu-protect type bpdu pri 7 --设置BPDU报文转发优先级为7
注释:
可配置的报文类型有:arp,bpdu , dhcp , ipv6mc , igmp , rip , ospf ,vrrp , pim,err-ttl , unknown-ipmc; 通过执行no cpu-protecttype命令,可以把报文的最大带宽和优先级设置恢复为默认值。
———————————————————————————————————————
2.8 交换机上配置防攻击的系统保护(System Guard功能)
提问:如何开启交换机的System Guard功能?
回答:
Ruijie#conft
Enterconfiguration commands, one per line. End with CNTL/Z.
Ruijie(config)#intg0/1 ----进入需要配置SystemGuard功能的接口
Ruijie(config-if-GigabitEthernet0/1)#system-guard enable ---开启SystemGuard功能
Ruijie(config-if-GigabitEthernet0/1)#system-guard isolate-time 600 ----配置非法用户的隔离时间。取值范围为30 秒到3600 秒,缺省值为120 秒
Ruijie(config-if-GigabitEthernet0/1)# system-guard same-dest-ip-attack-packets 100 ----配置对某个不存在的IP 不断的发IP 报文进行攻击的最大阈值
Ruijie(config-if-GigabitEthernet0/1)# system-guard scan-dest-ip-attack-packets 100 ----配置对一批 IP 网段进行扫描攻击的最大阈值
Ruijie(config-if-GigabitEthernet0/1)#exit ----退出到全局模式
Ruijie(config)#system-guarddetect-maxnum 200 ----设置监控主机的最大数
Ruijie(config)#system-guardexception-ip 192.168.1.1/24 ----添加防攻击功能的特例IP地址
Ruijie(config)#exit ----退出到特权模式
Ruijie#clearsystem-guard ----清除所有已被隔离用户
Ruijie#clearsystem-guard interface g0/1 ----清除该端口下被隔离的所有用户
Ruijie#clearsystem-guard interface g0/1 192.168.1.1 ---清除该接口下被隔离的指定IP用户
注意:
设置设备监控攻击主机的最大数。一般来说,这个数目保持在“实际运行的主机数的%20”左右即可。但是,如果您发现被隔离的主机数已经达到或接近监控的主机数最大数,那可以扩大监控主机的数目,以达到更好的保护系统的要求。
对于已经被隔离的IP,即使该IP 在配置的特例IP范围内,在该IP 被老化之前仍会处于被隔离状态,如果您想要允许该IP的报文发往CPU,可以用clearsystem-guard 命令来解除对该IP 的隔离。 可以用show system-guardisolated-ip 来查看系统保护被隔离的IP 的信息
———————————————————————————————————————
2.9 交换机上启用IP Source Guard
提问:如何开启交换机的IP Source Guard 功能功能?
回答:
1、 开启DHCP Snooping 功能。
Ruijie#configureterminal ---进入全局配置模式
Ruijie(config)#ipdhcp snooping ---打开dhcp-snooping功能
2、 将上链口设置为DHCP SNOOPING 信任口。
Ruijie(config)#interfacegigabitEthernet 0/1 ---进入接口配置模式
Ruijie(config-if-GigabitEthernet0/1)#ip dhcp snooping trust ---设置dhcp-snooping可信端口
Ruijie(config-if-GigabitEthernet0/1)#exit
3、 在直连PC 的端口上开启IP Source Guard 功能
Ruijie(config)#interfacegigabitEthernet 0/2 ---进入接口配置模式
Ruijie(config-if-range)#ipverify source port-security ----打开端口上的IPSource Guard功能,port-security将配置IP报文为基于IP +MAC 的过滤
Ruijie(config-if-range)#exit
4、配置静态绑定用户(网络中存在合法的使用静态IP地址的用户时需对此用户手动绑定)
Ruijie(config)#ipsource binding 0000.0000.0001 vlan 1 192.168.216.4 interface gigabitEthernet0/2 ---静态绑定一个用户
注意:
IP Source Guard 功能基于DHCPSnooping 功能,也就是说基于端口的IPSourceGuard 仅在DHCP
Snooping 控制范围内的非信任口上生效。 IP Source Guard 功能必须与DHCP Snooping 功能结合使用。
———————————————————————————————————————
2.10交换机上启用IPV6
提
问:如何开启交换机的IPV6协议栈?
回答:
S3760(config)#interface giga 0/1
S3760(config-if-GigabitEthernet0/1)#no switchport ---切换为三层口
S3760(config-if-GigabitEthernet0/1)#ipv6 enable ---开启IPV6功能
S3760(config-if-GigabitEthernet0/1)# ipv6 address 2001::1/64
S3760(config-if-GigabitEthernet0/1)# no ipv6 suppress-ra ---允许RA报文发送
注意:
- 缺省在接口上不主动发送路由器公告报文,如果想允许路由器公告报文的发送可以在接口配置模式下使用命令no ipv6 nd
suppress-ra 。 - 为了能够使节点无状态地址自动配置能够正常工作,路由器公告报文中公告的前缀的长度必须为 64比特。
2.11 IPV6静态路由配置
提问:IPV6静态路由怎么配置?
回答:
S3760(config) # ipv6route 2001:20::/642001::2 ---格式:ipv6 route 子网/掩码 下一跳
———————————————————————————————————————
2.12 IPV6隧道配置
提问:IPV6手工隧道如何配置?
回答:
S3760(config)#interface Tunnel 1
S3760(config-if-Tunnel1)#ipv6 enable ---使能IPV6协议栈
S3760(config-if-Tunnel1)#tunnel source 10.1.1.1 ---指定隧道源IPV4地址
S3760(config-if-Tunnel1)#tunnel destination 10.1.1.2 ---指定隧道目的IPV4地址
S3760(config-if-Tunnel 1)#tunnel mode ipv6ip ---使能手工隧道
提问:6to4隧道如何配置?
回答:
S3760 (config)#interface Tunnel 1
S3760(config-if-Tunnel 1)#ipv6 enable
S3760(config-if-Tunnel 1)# ipv6 address 2002:1414:1401::1/64 ---配置6to4地址
S3760 (config-if-Tunnel1)# tunnel source 20.20.20.1 ---指定隧道源IPV4地址
S3760(config-if-Tunnel 1)# tunnel mode ipv6ip 6to4 ---使能6to4隧道
注意:6to4地址内嵌的IPV4地址不能为私有的IPV地址(如10.0.0.0/8、172.16.0.0/12、192.168.0.0/16网段地址)必须是全局的IPV4地址
提问:ISATAP隧道如何配置?
回答:
S3760 (config)#interface Tunnel 1
S3760(config-if-Tunnel 1)#ip address 192.168.30.254 255.255.255.0
S3760(config-if-Tunnel 1)# ipv6 address 2001:30::1/64
S3760(config-if-Tunnel 1)#ipv6 enable ---使能IPV6协议栈
S3760(config-if-Tunnel 1)# no ipv6 nd suppress-ra ---允许发送RA报文
S3760(config-if-Tunnel 1)# tunnel source 192.168.30.254 ---指定隧道源IPV4地址
S3760(config-if-Tunnel 1)# tunnel mode ipv6ip isatap ---使能isatap隧道
注意:设备上允许同时配置多个ISATAP隧道,但是每个ISATAP隧道的suorceipv4地址必须不同
———————————————————————————————————————
2.13交换机上启用RLDP防环检测配置
提问:如何开启交换机的RLDP功能?
回答:
1、 开启功能
S3760 #conf t
S3760(config) # rldpenable --开启全局RLDP功能
S3760(config)#interface f 0/1
2、 配置处理方式。四种处理方式只能选其一
S3760(config-if)#rldp port loop-detect shutdown-port --检测到后将端口关闭
S3760(config-if)#rldp port loop-detect warning --检测到后,输出警告信息
S3760(config-if)#rldp port loop-detect block --检测到后将关闭端口学习转发功能
S3760(config-if)#rldp port loop-detect shutdown-svi --检测到后关闭端口所在的VLAN
3、 保存配置
S3760(config-if)# end
S3760# wr ---保存
注意:
- 可网管型交换机防环一般使用STP即可,若交换机下连的是傻瓜交换机,或者PC,可以在所连接的接口上启用RLDP功能。
- 检测到环路后接口会进行处理,重新打开接口的命令: S3760(config)#errdisable recovery
- 路由口不支持shutdown-svi的错误处理方法,因此该方法在路由口发生检测错误时将不被执行。
- 配置环路检测时要求端口下连的邻居设备不能开启RLDP检测,否则该端口将无法做出正确的检测。
- 如果在aggregateport 上配置了block方法并且端口发生了链路检测错误,则在端口重新恢复检测前不需要变更该aggregate port的成员口关系,否则成员口的转发状态将会和实际的设备效果不一致。
- 如果RLDP检测出链路错误,则会发出警告信息。用户可以通过配置log功能将这些警告信息发到log服务器,记录log的级别至少要保证可以记录3级日志。
———————————————————————————————————————
2.14交换机上配置VRRP
提问:怎么配置VRRP
回答:
1、 步骤一:
Master:
ruijie(config)#track1 interface f0/0 ---端口追踪
ruijie(config)#interfaceVlan 10
ruijie(config-if)#ipaddr 10.10.10.1 255.255.255.0
ruijie(config-if)#vrrp1 priority 120 ---设置优先级,默认100,优先级高的成为主
ruijie(config-if)#vrrp1 ip 10.10.10.10 ---配置虚拟网关
ruijie(config-if)#vrrp1 timer advertise 3 ---调定时器,可选
ruijie(config-if)#vrrp1 preempt ---配抢占
ruijie(config-if)#vrrp1 track 1 100 ---追踪端口优先级降低值
2、 步骤二:
Backup:
ruijie(config)#interfaceVlan 10
ruijie(config-if)#ipaddr 10.10.10.2 255.255.255.0
ruijie(config-if)#vrrp1 priority 100 ---设置优先级,默认100
ruijie(config-if)#vrrp1 ip 10.10.10.10
ruijie(config-if)#vrrp1 timer advertise 3 ---调定时器,可选
ruijie(config-if)#vrrp1 preempt ---配抢占
3、 验证:验证结果
show vrrp [brief]
show vrrp interface 接口
show track
小结:
简单来说 VRRP是一种容错协议它为具有组播或广播能力的局域网 如以太网 设计它保证当局域网内主机的下一跳路由器出现故障时可以及时的由另一台路由器来代替从而保持通讯的连续性和可靠性为了使VRRP工作要在路由器上配置虚拟路由器号和虚拟IP地址同时产生一个虚拟MAC地址这样在这个网络中就加入了一个虚拟路由器而网络上的主机与虚拟路由器通信无需了解这个网络上物理路由器的任何信息
一个虚拟路由器由一个主路由器和若干个备份路由器组成主路由器实现真正的转发功能 当主路由器出现故障时一个备份路由器将成为新的主路由器接替它的工作。
———————————————————————————————————————
2.15交换机上保护端口的配置
提问:如何配置交换机的保护端口功能?
回答:
S2126G>en
S2126G#con
S2126G(config)#intf0/1 ----进入接口FastEthernet 0/0口
S2126G(config-if)#switchportprotected ----开启保护端口功能
S2126G(config-if)#end
S2126G#wr
注意:保护端口之间互相隔离,不能通信,保护端口和非保护端口之间可以通信。目前支持保护端口的接入/汇聚交换机系列有S20、S21、S23、S26、S32、S3750、S5750。
———————————————————————————————————————
2.16 交换机Super VLAN配置
1、 创建VLAN
S5750A>en
Password:
S5750A#configure
S5750A(config)#vlan 2
S5750A(config-vlan)#exit
S5750A(config)#vlan 3
S5750A(config-vlan)#exit
S5750A(config)#vlan 4
S5750A(config-vlan)#exit
S5750A(config)# ----创建三个VLAN
2、 配置supervlan
S5750A(config)#vlan 3
S5750A(config-vlan)#supervlan ----配置VLAN3为supervlan
S5750A(config-vlan)#subvlan2,4 ----配置VLA2,VLAN4为subvlan
3、 把相应接口指定到相应的subVLAN中
S5750A(config)#interfacegigabitEthernet 0/4
S5750A(config-if-GigabitEthernet0/4)#switchport access vlan 2 ----把交换机的第4端口划到subVLAN 2中
S5750A(config-if-GigabitEthernet0/4)#exit
S5750A(config)#interfacegigabitEthernet 0/5
S5750A(config-if-GigabitEthernet0/5)#switchport access vlan 4 ----把交换机的第5端口划到subVLAN 4中
S5750A(config-if-GigabitEthernet0/5)#
S5750A(config-if-GigabitEthernet0/5)#exit
4、 设置SubVLAN 2的IP 地址空间
S5750A(config)#vlan2
S5750A(config-vlan)#subvlan-address-range192.168.1.1 192.168.1.100 ----设置SubVLAN 2 下的IP 地址空间
S5750A(config-vlan)#exit
S5750A(config)#vlan4
S5750A(config-vlan)#subvlan-address-rang192.168.1.101 192.168.1.253 ----设置SubVLAN 4 下的IP 地址空间
S5750A(config-vlan)#exit
5、创建SuperVLAN 对应虚拟三层接口
S5750A(config)#interfacevlan 3
S5750A(config-if-VLAN3)#ip address 192.168.1.254 255.255.255.0 ----为SUBVLAN的用户配置网关
6、 保存配置
S5750A(config)#end
S5750A#wr
———————————————————————————————————————
2.17交换机上启用WEB管理功能
提问:如何使用WEB管理?
回答:
s27>en
s27#con
s27(config)#enableservice web-server --全局开启web功能
s27(config)# int vlan1
s27(config-if)# ipadd 192.168.1.254 255.255.255.0 --配置管理地址,假设管理vlan为1,管理地址为192.168.1.254
s27(config-if)#noshut
s27(config-if)#exit
s27(config)#enablesecret level 15 0 ruijie --配置特权密码,假设密码为ruijie
s27(config)#end
s27# wr
设备登录:
- 浏览器中输入管理地址,提示如下界面:
- 输入特权密码,用户名任意。
- Web界面显示
注意: 目前支持web管理的交换机包括S23系列,S26系列,S27系列,S29系列; 支持版本为10.2(4)及以上版本。
———————————————————————————————————————
2.18 锐捷交换机日志服务器配置
提问:如何配置设备的syslog功能
回答:
1、 开启log服务器功能,并制定log服务器的地址
ruijie(config)#loggingon ---开启log功能
ruijie(config)#logging192.168.1.1 ---指定log服务器的地址,可以填写多个
2、 指定snmp-server地址,并制定发送trap消息的源地址(可选)
ruijie(config)#servicetimestamps log datetime ---发送记录事件的时候包含时间标记
ruijie(config)#servicetimestamps debug datetime --- syslog信息包含时间戳
3、 设置设备的时间(或者设置SNTP服务器)
ruijie#clock set8:45:00 10 13 2009 ---设置设备当前时间为2009-10-13
ruijie#showclock ---查看当前设备的系统时间
4、 指定发送的时间戳:
ruijie(config)#loggingfacility local7 ---定义facility级别,缺省为local7,可以设置从local0到local7
ruijie(config)#loggingtrap warnings ---定义severity级别缺省为infor级别
5、 保存设备配置
ruijie#write
———————————————————————————————————————
2.19交换机上配置Hybrid接口
提问:怎么配置Hybrid接口
回答:
Hybrid接口能够控制哪些些VLAN ID能够被上传,哪些VLAN ID禁止上传.下面举一个例子,主VLAN50,从VLAN是51-54,要实现51-54不能上传VLAN ID,只允许上传VLAN ID 50。具体配置如下:
vlan 50 ---配置主VLAN
private-vlan primary
private-vlan association add 51-54 ---配置关联从VLAN
!
vlan 51
private-vlan isolated ---配置隔离VLAN
!
vlan 52
private-vlan community ---配置团体VLAN
!
vlan 53
private-vlan community
!
vlan 54
private-vlan community
!
interfaceFastEthernet 0/1
switchport mode private-vlan host ---宣告主机端口
switchport private-vlan host-association 5051 ---设置端口属于的VLAN
!
interfaceFastEthernet 0/2
switchport mode private-vlan host
switchport private-vlan host-association 50 52
!
interface FastEthernet0/3
switchport mode private-vlan host
switchport private-vlan host-association 50 53
!
interfaceGigabitEthernet 0/26
switchport mode hybrid ---配置端口属于Hybrid模式
switchport hybrid native vlan 50 ---native VLAN为50
switchport hybrid allowed vlan add untagged51-54 ---禁止VLAN ID 51-54上传VID
!
interface VLAN 1 ---管理VLAN
ip address 10.10.100.100 255.255.255.0
no shutdown
注释: S21不支持Hybrid端口,S2010.2(5)版本支持,其他S20以上版本均支持。