8、 VTP(visual trunk protocol)。VTP使用户可集中改变vlan 的配置,并通过VTP更新报文把信息发布到整个网络。
9、 创建VLAN,在6509上创建整个网络的vlan. xiao> (enable) set vlan 82 name shifuban Vlan 82 configuration successful
10、 将交换机端口划分到对应VLAN中。(默认所有端口在vlan1中) xiao> (enable) set vlan 82 4/1-4 VLAN 82 modified. VLAN 1 modified. VLAN Mod/Ports
11、配置VLAN主干(VLAN TRUNK),以支持在一个交换机接口上传输多个vlan通信(如 要取消此端口trunk设置,用set trunk 1/1 off) xiao> (enable) set trunk 2/1 on dot1q Port(s) 2/1 trunk mode set to on. xiao> (enable) 12/17/2001,10:16:58
12/17/2001,10:16:58:PAGP-5:Port 2/1 left bridge port 2/1. 12/17/2001,10:17:09:PAGP-5:Port 2/1 joined bridge port 2/1.
12、 置端口特性,如端口速度、双工模式等。(gigabit ethernet应配置为1000m速度,全双工,ethernet应配置为100m速度,全双工)可选用(默认值为AUTO) xiao> (enable)set port speed 4/45 100 xiao> (enable)set port duplex half
13、 启用CDP(cisco discover protocol),获取邻近交换机、路由器的信息。(默认已启动) xiao> (enable) set cdp enable CDP enabled for all ports.
CDP message interval set to 100 seconds for all ports. xiao> (enable) show cdp port Port CDP Status Message-Interval -------- ---------- ---------------- 1/1 enabled 100 1/2 enabled 100 2/1 enabled 100
14、 配置syslog server,保存记录交换机状态信息的日志文件。交换机出现问题时,可参考此文件查看交换机的历史状态。(最多可配置3个syslog server) 在交换机上:
xiao> (enable) set logging server x.x.x.x
1x.x.x.x added to the System logging server table. xiao> (enable) set logging server enable
System logging messages will be sent to the configured syslog servers. xiao> (enable) set logging server facility local5 System logging server facility set to <local5> xiao> (enable) set logging server severity 3 System logging server severity set to <3>
15、配置SNMP,使交换机可通过网管软件管理。(默认read community 为pub_zs_ro,read-write community 为pri_zs_isc)
xiao> (enable) set snmp community read-only pub_zs_ro SNMP read-only community string set to 'pub_zs_ro'. xiao> (enable) set snmp community read-write pri_zs_isc SNMP read-write community string set to 'pri_zs_isc’ xiao> (enable) set snmp trap enable all All SNMP traps enabled.
16、检查配置并保存在BOOTFLASH,FLASH PCMCIA卡或TFTP 服务器上 xiao> (enable) show config 保存在BOOTFLASH:
xiao> (enable) copy config bootflash 保存在FLASH PCMCIA:
xiao> (enable) copy config slot0: 保存在TFTP SERVER:
xiao> (enable) copy config tftp
IP address or name of remote host []? x.x.x.x Name of file to copy to []? cat6509_config.cfg
Upload configuration to tftp:cat6509_config.cfg, (y/n) [n]? y ..... /
Configuration has been copied successfully.
现我们采用NT 或Windows 2000作TFTP服务器,安装好TFTP软件后启动之即可。
17、切换到配置MSFC模式,并进入全局配置模式。设置如名称、密码等。 Console>(enable)session 15 Route>enable Enter password:
Route#configure terminal Route(config)# hostname xiao xiao (config )# enable password cisco
18、 syslog server,保存记录交换机状态信息的日志文件。交换机出现问题时,可参考此文件查看交换机的历史状态。(最多可配置3个syslog server) 在交换机上:
xiao (config )#logging on xiao (config )#logging 1x.x.x.x
xiao (config )#logging monitor information xiao (config )#logging trap information
19、配置SNMP,使交换机可通过网管软件管理。(默认read community 为pub_zs_ro,read-write community 为pri_zs_isc) xiao (config )#snmp community pub_zs_ro ro xiao (config )#snmp community pri_zs_isc rw 20、 访问控制列表
xiao (config )#access-list 11 permit x.x.x.x
xiao (config )#access-list 11 permit x.x.x.0 0.0.0.255 xiao (config )#access-list 11 deny x.x.0.0 0.0.255.255 xiao (config )#access-list 11 permit any
创建标准访问控制表11,允许x.x.x.0网段和x.x.x.x的主机访问,x.x.0.0的其余网段不允许访问,其余网段均可访问。
xiao (config )#access-list 108 deny tcp 19.16.0.0 0.0.255.255 19.16.0.254 0.0.255.0 eq telnet
xiao (config )#access-list 108 deny tcp 19.16.0.0 0.0.255.255 12.18.83.0 0.0.0.255 eq telnet
xiao (config )#access-list 108 deny tcp 19.16.0.0 0.0.255.255 19.18.8.0 0.0.0.255 eq telnet
xiao (config )#access-list 108 permit ip any any
创建扩展访问控制列表108,禁止12.168.0.0网段主机TELNET该网段的网关
192.168.XX.254(即活动路由器)、12.18.83.0、192.168.83.0网段主机(此网段为外网交换机管理地址),其余IP协议均可通过。 21、 将访问列表捆绑到VLAN子网 xiao (config )#interface vlan 82
xiao (config-vlan )#ip access-group 11 out
将前面所创建的标准访问列表11绑定在流出路由器的数据流中检测。 xiao (config-vlan)#ip access-group 108 in
将前面所创建的扩展访问列表108绑定在流入路由器的数据流中检测。
22、在MSFC上配置缺省路由、VLAN路由,使各VLAN间可访问(这里只举例2个vlan) xiao(config)# ip route 0.0.0.0 0.0.0.0 12.18.83.34
xiao(config)# ip routing xiao(config)# xiao ospf 172
xiao(config-xiao)# network 1.18.83.0 255.255.255.0 xiao(config-xiao)# network 1.168.0.0 255.255.0.0 xiao(config-xiao)# interface vlan 1
xiao(config-if)# ip address 1.1.3.10 255.255.255.0 xiao(config-if)#no shutdown xiao(config-xiao)# interface vlan 82
xiao(config-if)# ip address 12.18.2.254 255.255.255.0 xiao(config-if)#no shutdown 23、配置telnet到交换机的密码 xiao(config)#line vty 0 4 xiao (config-line)#password cisco xiao(config-line)#login
24、 配置保存在NVRAM,否则交换机重启后所做的配置丢失。同时还可保存在BOOTFLASH,FLASH PCMCIA,TFTP SERVER,以后如果配置丢失可恢复。 保存在NVARAM:
xiao#copy running-config startup-config 保存在TFTP SERVER:
xiao#copy running-config tftp