Native IOS 65xx系列交换机配置(下)( 三 )


删除配置好的vlan
Router# vlan database
Router(vlan)# no vlan x
Deleting VLAN 3...
Router(vlan)# exit
5.4. 给vlan分配端口
Router(config)# interface fastethernet x/y
Router(config-if)# shutdown
Router(config-if)# switchport
Router(config-if)# switchport mode access
Router(config-if)# switchport access vlan x
Router(config-if)# no shutdown
Router(config-if)# end
Router# exit
5.5. 配置vlan地址
Router(config)# interface vlan x
Router(config)# ip add x.x.x.x x.x.x.x
6. 配置HSRP
不同网段之间的通信都是通过在终端工作站上设定缺省网关来实现的,为了实现冗
余,每台交换机上必然要配置相同的网段,那么就会在一个网段中出现2个不同地址
的路由 。
接口(对于工作站就是缺省网关),当1条上联链路失效时,数据必然会从另
外1条链路传输到另外一台交换机上进行处理,这时就存在缺省网关变更的问题 。
为了消除当一条链路失效导致的工作站缺省网关重新定义的问题,我们使用Cisco公
司专有HSRP(Hot Standby Redundant Protocol)技术来解决这个问题 。
HSRP技术就是将分布在2台交换机上相同网段的不同路由接口IP地址映射为一个虚
拟IP地址来消除工作站缺省网关重新定义的问题 。配置如下:
在其中一台65xx上按下面模版进行配置
interface Vlan x
 ip address x.x.x.x x.x.x.x
 no ip redirects
 no ip directed-broadcast
 standby 1 ip y.y.y.y
 standby 1 priority 100
 standby 1 preempt
standby 1 authentication secret
在另一台65xx上按下面模版进行配置
interface Vlan x
 ip address x.x.x.x x.x.x.x
 no ip redirects
 no ip directed-broadcast
standby 1 ip y.y.y.y
 standby 1 priority 110 ;这个优先级高,成为Master
 standby 1 preempt
standby 1 authentication secret
7. 配置NTP
NTP (Network Time Protocol) 为路由器、交换机和工作站之间提供了一种时间同步
的机制 。时间同步了,多台网络设备上的相关事件记录可以放在一起看,更为清楚,
方便了分析较复杂的故障和安全事件等 。
(1)本地时钟设置:
clock timezone Peking8 ;定义时区
clock calendar-valid ;答应使用硬件calendar作为时钟源
clock set hh:mm:ss month year ;如clock set 14:02:30 10 December 2003
clock update-calendar ;更新硬件时钟
(2)ntp server
ntp calendar-update ;答应NTP定期更新calendar
ntp master 3 ;答应本机作为NTP协议的主时钟,精度级别3,供其它对等体同步用 。

ntp source int vlan 7 ;设置ntp时钟原的端口或IP地址
(3)常用的调试命令有:
show ntp status
show ntp associations
8. 配置镜像端口
在交换机上配置镜像端口(Mirroring Port)用于建立内部网络的监控端口,以便收
集相关被监测端口的数据流量,进行数据流监控及分析 。我们这里配置镜像端口用于
配置入侵检测设备(镜像端口)的检测口检测一级防火墙和二级防火墙的内网接口,
以探测是否有入侵行为发生 。
#monitor session 1 source interface Fa7/14 - 19 rx
#monitor session 1 destination interface Fa7/22
#monitor session 2 source interface Fa7/24
#monitor session 2 destination interface Fa7/25
9. 升级配置
9.1. 交换机IOS保存和升级
交换机的IOS保存和升级是采用TFTP协议完成,所以首先你必须要下载一个TFTP软
件,然后按照下面的步骤来进行:
1.在你的机器上启动TFTP。
2.登陆到交换机,然后在enable状态下输入如下命令来完成IOS的保存:

推荐阅读