Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1393706
  • 博文数量: 254
  • 博客积分: 4173
  • 博客等级: 中校
  • 技术积分: 3400
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-03 21:24
个人简介

不为失败找借口,只为成功找方法!

文章分类

全部博文(254)

文章存档

2021年(3)

2020年(1)

2019年(2)

2017年(10)

2016年(6)

2015年(19)

2014年(24)

2013年(19)

2012年(52)

2011年(118)

分类: 系统运维

2011-11-05 20:56:41

实验要求:
本拓扑按中型企业网布局而设计,对企业园区网进行全面考察。
设备基本配置:
◆CME 作为语音 VLAN100 的 DHCP 和应用服务器(思科2811代替)
◆通过 console 连接 思科AP1231,清空所有配置后重启设备
◆所有设备配置主机名,端口描述,并通过 CDP 协议确保物理连接正常
◆配置关掉域名解析,连接超时,开启日志同步
数据链路层配置:
◆实现链路层冗余,最大程度保证数据转发的可靠性
◆对冗余网络存在的隐患进行相关防护
网络层配置:
◆保证网络核心冗余
网络应用配置:
◆执行接入安全,内部 VOIP 通信,流量监控,设备安全管理,无线移动安全接入
AP 之间二层漫游:
◆打开 AP 路由桥接功能,打开 BVI 接口,保证管理终端可以访问 AP;
◆确保 SW2 与 AP 连接的接口为 trunk 接口
◆通过页面方式分别在 AP1 和 AP2 上配置两组 SSID,SSID1 与 VLAN10 绑定,SSID2
与 VLAN20 绑定,管理 VLAN 为 VLAN1,SSID 均为广播模式
◆保证 AP1 和 AP2 上配置的 SSID 名称,SSID 所绑定的 VLAN 以及基于 VLAN 的密码是 完全相同的
◆再次检查每个 AP 的 dot11radio0 接口是双 up 的
实验拓扑:
clip_image002
实验步骤:
1、 配置 PAGP 和 VTP 协议
SW1:
SW1(config)#vlan 10
SW1(config-vlan)#vlan 20
SW1(config-vlan)#vlan 100
SW1(config-vlan)#exit
SW1(config)#int F0/5
SW1(config-if)#switchport mode access
SW1(config-if)#switchport access vlan 100    //将 CME 划入 VLAN100
SW1(config)#int range f0/1 - 2
SW1(config-if)#switchport trunk encapsulation dot1q    //在三层接口上封装 802.1Q 协议
SW1(config-if)#switchport mode trunk
SW1(config)#int range f0/19 – 20
SW1(config-if)#switchport trunk encapsulation dot1q
SW1(config-if)#switchport mode trunk
SW1(config-if-range)channel-protocal pagp    //使用 pagp 协议
SW1(config-if-range)#channel-group 1 mode desirable    //设置为自动协商模式
SW1(config)#vtp domain sovand    //配置 VTP 域名为 sovand
SW1(config)#vtp mode server    //设置 VTP 服务器模式
SW2:
SW2(config)#int range f0/1 - 2
SW2(config-if)#switchport trunk encapsulation dot1q
SW2(config-if)#switchport mode trunk
SW2(config)#int range f0/23 – 24
SW2(config-if)#switchport trunk encapsulation dot1q
SW2(config-if)#switchport mode trunk
SW2(config-if-range)channel-protocal pagp
SW2(config-if-range)#channel-group 1 mode desirable
SW2(config)#vtp domain sovand
SW2(config)#vtp mode client
SW3:
SW3(config)#int f0/1
SW3(config-if)#switchport mode trunk
SW3(config)#int f0/2
SW3(config-if)#switchport mode trunk
SW3(config)#vtp domain sovand
SW3(config)#vtp mode client
SW4:
SW4(config)#int f0/1
SW4(config-if)#switchport mode trunk
SW4(config)#int f0/2
SW4(config-if)#switchport mode trunk
SW4(config)#vtp domain sovand
SW4(config)#vtp mode client
查看链路汇聚状态:
SW2#show etherchannel summary
Number of channel-groups in use: 1
Number of aggregators:    1

Group     Port-channel     Protocol     Ports
------+-------------+-----------+-----------------------------------------------
1     Po1(SU)     PAgP     Fa0/23(P)     Fa0/24(P)

SW1#show etherchannel summary
Number of channel-groups in use: 1
Number of aggregators:    1

Group     Port-channel     Protocol     Ports
------+-------------+-----------+-----------------------------------------------
1     Po1(SU)     PAgP     Fa0/19(P)     Fa0/20(P)

2、配置 MSTP
SW1

SW1(config)#spanning-tree mode mst    //将生成树改为 MST 模式
SW1(config)#spanning-tree mst configuration    //进入 MST 配置模式
SW1(config-mst)#name sovand    //设置名字为 sovand
SW1(config-mst)#revision 1    //修订号设为 1
SW1(config-mst)#instance 1 vlan 10,100    //在第一组里包含 VLAN3
SW1(config-mst)#instance 2 vlan 20    //在第二组里包含 VLAN2
SW1(config)#spanning-tree mst 1 root primary    //将 SW1 设为第一组的主根桥
SW1(config)# spanning-tree mst 2 root secondery        //将 SW1 设为第二组的辅助根桥
SW2:
SW2(config)#spanning-tree mode mst
SW2(config)#spanning-tree mst configuration
SW2(config-mst)#name sovand
SW2(config-mst)#revision 1
SW2(config-mst)#instance 1 vlan 10,100
SW2(config-mst)#instance 2 vlan 20
SW2(config)#spanning-tree mst 1 root secondery        //将 SW2 设为第一组的辅助根桥
SW2(config)#spanning-tree mst 2 root primary    //将 SW2 设为第二组的主根桥
SW3:
SW3(config)#spanning-tree mode mst
SW3(config)#spanning-tree mst configuration
SW3(config-mst)#name sovand
SW3(config-mst)#revision 1
SW3(config-mst)#instance 1 vlan 10,100
SW3(config-mst)#instance 2 vlan 20
SW4:
SW4(config)#spanning-tree mode mst SW4(config)#spanning-tree mst configuration SW4(config-mst)#name sovand
SW4(config-mst)#revision 1
SW4(config-mst)#instance 1 vlan 10,100
SW4(config-mst)#instance 2 vlan 20
查看 MSTP 情况
SW1#show spanning-tree mst 2
##### MST2     vlans mapped:     20
Bridge    address 0022.9062.7380    priority        28674 (28672 sysid 2)   
Root    address 0012.8077.3200 port    Po1    priority   

cost    24578 (24576 sysid 2)
100000   

rem hops 19

Interface     Role Sts Cost     Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/2     Desg FWD 200000     128.4     P2p Pre-STD-Rx Po1         Root FWD 100000         128.56      P2p SW2#show spanning-tree mst 2
##### MST2     vlans mapped:     20
Bridge     address 0012.8077.3200     priority    24578 (24576 sysid 2) Root        this switch for MST2         //SW2 为第二组的主根桥

Interface     Role Sts Cost     Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------

Fa0/1    Desg FWD 200000    128.1     P2p Pre-STD-Rx
Po1    Desg FWD 100000    128.66     P2p

3、将 VLAN1 配置为管理 VLAN
SW1:
SW1(config)#ip routing
SW1(config)#int vlan 1
SW1(config-if)#ip add 10.1.5.1 255.255.255.0    //VLAN1 的网关
SW1(config)#line vty 0 4
SW1(config-line)#password cisco
SW1(config-line)#login
SW2:
SW2(config)#ip routing
SW2(config)#int vlan 1
SW2(config-if)#ip add 10.1.5.2 255.255.255.0
SW2(config)#ip default-gateway 10.1.5.1    //网关指向 SW1
SW2(config)#line vty 0 4
SW2(config-line)#password cisco
SW2(config-line)#login
SW3:
SW3(config)#int vlan 1
SW3(config-if)#ip add 10.1.5.3 255.255.255.0
SW3(config)#ip default-gateway 10.1.5.1    //网关指向 SW1
SW3(config)#line vty 0 4
SW3(config-line)#password cisco
SW3(config-line)#login
SW4:
SW4(config)#int vlan 1
SW4(config-if)#ip add 10.1.5.4 255.255.255.0
SW4(config)#ip default-gateway 10.1.5.1    //网关指向 SW1
SW4(config)#line vty 0 4
SW4(config-line)#password cisco
SW4(config-line)#login
4、外部启用 EIGRP 协议
SW1:
SW1(config)#int f0/3
SW1(config-if)#no switchport    //开启三层端口功能
SW1(config-if)#ip address 172.16.1.2 255.255.255.0
SW1(config-if)#no shut
SW1(config)#router eigrp 1
SW1(config-router)#net 10.0.0.0    //将内网通告进去
SW1(config-router)#net 172.16.0.0
SW1(config-router)#no auto-summary
SW2:
SW2(config)#int f0/2
SW2(config-if)#no switchport
SW2(config-if)#ip address 172.16.2.2 255.255.255.0
SW2(config-if)#no shut
SW2(config)#router eigrp 1
SW2(config-router)#net 10.0.0.0
SW2(config-router)#net 172.16.0.0
SW2(config-router)#no auto-summary
GW:
GW(config)#int l0
GW(config)#ip add 200.1.1.0 255.255.255.0
GW(config)#router eigrp 1
GW(config-router)#net 200.1.1.0
GW(config-router)#net 172.16.0.0
GW(config-router)#no auto-summary
5、使用 HSRP 进行汇聚交换机的冗余
SW1:
SW1(config)#int vlan 10
SW1(config-if)#ip add 10.1.1.100 255.255.255.0    //配置 VLAN10 的 IP
SW1(config-if)#standby 1 priority 100    //设置优先级为 100,作为 VLAN10 的备份交换机
SW1(config-if)#standby 1 ip 10.1.1.1    //配置 VLAN10 的虚拟网关
SW1(config-if)#standby 1 preempt    //启用抢占模式
SW1(config-if)#standby 1 timers 1 3    //设置 hello 时间 1 秒,保持时间 3 秒
SW1(config)#int vlan 20
SW1(config-if)#ip add 10.1.2.100 255.255.255.0    //配置 VLAN20 的 IP
SW1(config-if)#standby 1 priority 200    //设置优先级为 200,作为 VLAN20 的活动交换机
SW1(config-if)#standby 1 ip 10.1.2.1    //配置 VLAN20 的虚拟网关
SW1(config-if)#standby 1 preempt    //启用抢占模式
SW1(config-if)#standby 1 timers 1 3
SW1(config)#Int Vlan100
SW1(config-if)#ip address 10.1.100.100 255.255.255.0
SW1(config-if)#standby 1 ip 10.1.100.1
SW1(config-if)#standby 1 priority 200
SW1(config-if)#standby 1 preempt
SW2:
SW2(config)#int vlan 10
SW2(config-if)#ip add 10.1.1.101 255.255.255.0    //配置 VLAN10 的 IP
SW2(config-if)#standby 1 priority 200    //设置优先级为 200,作为 VLAN10 的活动交换机
SW2(config-if)#standby 1 ip 10.1.1.1    /配置 VLAN10 的虚拟网关
SW2(config-if)#standby 1 preempt    //启用抢占模式
SW2(config-if)#standby 1 timers 1 3
SW2(config)#int vlan 20
SW2(config-if)#ip add 10.1.2.101 255.255.255.0    //配置 VLAN20 的 IP
SW2(config-if)#standby 1 priority 100    //设置优先级为 100,作为 VLAN20 的备份交换机
SW2(config-if)#standby 1 ip 10.1.2.1    //配置 VLAN20 的虚拟网关
SW2(config-if)#standby 1 preempt    //启用抢占模式
SW2(config-if)#standby 1 timers 1 3
SW2(config)#Int Vlan100
SW2(config-if)#ip address 10.1.100.101 255.255.255.0
SW2(config-if)#standby 1 ip 10.1.100.1
SW2(config-if)#standby 1 priority 200
SW2(config-if)#standby 1 preempt
查看 standby:
SW2#show standby vlan 10 br
P indicates configured to preempt.
|

Interface    Grp Prio P State     Active        Standby        Virtual IP
Vl2    1    200    P Active    local        10.1.2.101    10.1.2.1
由上面可见 SW2 为 VLAN10 的 Active 交换机,虚拟网关为 10.1.2.1
SW2#show standby vlan 20 br
P indicates configured to preempt.
|

Interface    Grp Prio P State    Active    Standby    Virtual IP
Vl3    1    100    Standby     10.1.3.101    local    10.1.3.1
由上面可见 SW1 为 VLAN20 的 Active 交换机,虚拟网关为 10.1.3.1
6、在 3560 交换机上配置 SLA 端口跟踪
在 SW1 的出口 F0/3 调用 SLA 进行跟踪,如果 F0/3 的出口链路出现问题,则将 VLAN3 的 active 交换机(SW1)的优先级减少 105(95),比 standby 交换机(SW2)中的优先级(100) 要低。这时 SW2 的抢占功能开始发挥作用,VLAN3 将 SW2 作为新的 active 交换机。
SW1:
SW1(config)# track 1 rtr 1 reachability    //创建一个 track 对 SLA 1 进行跟踪
SW1(config)#ip sla 1    //创建 SLA
SW1(config-sla)#icmp-echo 172.16.1.2 source-ip 172.16.1.1    //使用 ICMP 报文测试两端的联通性
SW1(config-sla)#timeout 2000    //最大 dead 时间为 2000ms
SW1(config-sla)#frequency 3    //频率设为 3 秒
SW1(config-sla)#ip sla schedule 1 life forever start-time now    //起始时间为从现在到永久
SW1(config)#int vlan 20
SW1(config-if)#standby 1 track 1 decrement 105    //在 VLAN20 中调用 truck,如果链路出现问题,则 将 VLAN20 的优先级减少 105
测试备份链路的冗余功能:
首先在设备运行正常的时候,用 PC 对远端的服务器进行一个长 ping,然后再 ping 包 的过程中将 F0/3 shut 掉,查看交换机的冗余情况。
SW1#SHOW standby vlan 20 br
P indicates configured to preempt.
|

Interface    Grp Prio P State     Active    Standby    Virtual IP
Vl3    1     95     P Standby     10.1.3.100    local    10.1.3.1
可见 VLAN20 的 active 交换机优先级已经从 200 减少到了 95
SW2
03:49:02: %HSRP-6-STATECHANGE: Vlan3 Grp 1 state Active -> Speak
04:02:28: %HSRP-6-STATECHANGE: Vlan3 Grp 1 state Standby -> Act
ive     //VLAN3 的备用交换机 SW2 开始发挥作用
SW1
*Mar     1 03:49:13.340: %HSRP-5-STATECHANGE: Vlan3 Grp 1 state Active -> Speak
*Mar     1 03:49:16.343: %HSRP-5-STATECHANGE: Vlan3 Grp 1 state Speak -> Standby
// 原 active 交换机转变为 standby

PC2#ping 200.1.1.1 repeat 5000
Type escape sequence to abort.
Sending 5000, 100-byte ICMP Echos to 200.1.1.1, timeout is 2 seconds:
……
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!....!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
…….
Success rate is 99 percent (4996/5000), round-trip min/avg/max = 1/2/20 ms
我们可以发现在 ping 包的过程中,如果中间出现了故障,HSRP 的冗余可以在极短的时 间内对设备进行切换,使传输过程中丢失包的数量减到最少。可以通过修改 hello 和保持 时间来控制,本实验设为 1 秒和 3 秒。

7、配置 SNMP 服务器管理所有设备
在所有主要设备上输入以下命令:
snmp-server community sovand ro     //设置 SNMP 服务器为可读
snmp-server community cisco rw    //设置 SNMP 服务器为可写
snmp-server    enable traps    //允许 SNMP 服务器的所有功能
snmp-server    host 10.1.2.200 traps cisco    //指定服务器 IP
将 PC 接入 SW2,在 SW2 将 PC 所在的端口划入 VLAN20,PC 上安装 SNMP 软件。打开后可以发 现所有设备均可在软件中管理(截图时设备已拔线,仅供参考)。
启用日志管理功能,在所有主要设备上输入以下命令:
logging on    //开启日志功能
logging trap 7    //设置日志权限为最高(0-7)
logging host 10.1.2.200    //指定服务器 IP

8、VOIP 配置(CME 使用 2811 路由器模拟)
CME:
CME(config)#int F0/0
CME(config-if)#ip address 10.1.100.9 255.255.255.0
CME(config)#telephony-service    //开启语音服务
CME(config-telephony)#max-dn 30
CME(config-telephony)#max-ephones 30
CME(config-telephony)#auto-reg-ephone
CME(config-telephony)#ip source-add 10.1.100.9 port 200
CME(config-telephony)#creat cnf-files
CME(config)#ephone-dn 1
CME(config-ephone-dn)#number 1001    //终端电话号码
CME(config)#ephone-dn 2
CME(config-ephone-dn)#number 1002
CME(config)#ephone 1
CME(config-ephone)#mac-address 90E6.BAE9.AFB6    //终端 MAC 地址
CME(config-ephone)#button    1:1
CME(config)#ephone 2
CME(config-ephone)#mac-address 0024.54B3.79DB CME(config-ephone)#button    1:2
CME(config)#ip dhcp pool voip    //语音 DHCP 服务器
CME(dhcp-config)#network 10.1.100.0 255.255.255.0
CME(dhcp-config)#default-router 10.1.100.1
CME(config)#iip dhcp excluded-address 10.1.100.1 10.1.100.50
SW3(config)#int range F0/5 - 6
SW3(config)#switchport mode access
SW3(config)#switchport access vlan 100
SW3(config)#switchport voice vlan 100    //接入语音 VLAN
SW3(config)#mls qos trust cos
SW3(config)#mls qos trust device cisco-phone    //只相信思科电话
配置成功后,可通过两台终端电脑上安装的 Cisco 语音软件进行通话。
9、AP 配置
将AP 加入对应VLAN:
SW4(config)#int f0/3
SW4(config-if)#switchport mode access
SW4(config-if)#switchport access vlan 10
SW4(config)#int f0/2
SW4(config-if)#switchport mode access
SW4(config-if)#switchport access vlan 20
AP 配置
进入 Radio-802.11G 接口:
clip_image002[6]
将 AP1 设为接入点:
clip_image002[8]
加入邻接 AP 的 MAC 地址(实际环境为三台):
clip_image002[10]
在 AP 上创建 VLAN,VLAN1 为管理 VLAN,VLAN10,20 为接入 VLAN:
clip_image002[12]
查看 VLAN:
Current  VLAN List   
EOI:IY    
VLAN 1
VLAN 10
VLAN 20
……-

阅读(2225) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~