1、 项目一 中小企业双出口 【案例背景】 某中型企业现有的网络具有近 3000 各节点,随着企业经营规模的不断扩大,网络应用的增多,原有的网络已经越来越不适应新形式的发展。为加强企业信息建设水平,企业希望改造企业内部原来的企业网络,新改造的网络遵循“安全性、可管理性、稳定性”。首先需要保障企业网络的网络出口稳定可靠性,其次病毒侵入与非法攻击是目前企业网络最大的安全隐患,新网络要具有防止网络蠕虫病毒扩散、DDoS 攻击和恶意的 IP 扫描现象出现。此外在内部网络带宽资源利用率上,网络的可管理性上都应比目前有很大的改进。 某中型企业要求新的企业内部网络建设,需严格遵循“ 安全性;可管理性;稳定性”
2、的原则,具体如下: 1、为了保证网络出口稳定可靠性:企业向 ISP 申请了两条 Internet 线路,需要这两条线路做负载均衡和冗余备份。 2、为了保证网络安全可靠性:企业要求核心设备支持防 DDoS 攻击、防恶意的 IP 扫描。病毒侵入与非法攻击是企业网络很大的安全隐患。不发作则已,一发作就是大问题,因此,企业要求内部网络能实现在核心层、接入层防止网络蠕虫病毒扩散。要求核心和接入网络设备能支持 VLAN 的划分,降低网络内广播数据包的传播,提高带宽资源利用率,防止广播风暴的产生。 3、管理性:网络设备需能够支持灵活多样的管理方式,可以减轻管理、维护的难度。 【拓扑结构】 如图 1-1 所示
3、网络拓扑是某中型企业内部网络网络拓扑,为了保证网络出口稳定可靠性:企业向 ISP 申请了两条 Internet 线路,需要这两条线路做负载均衡和冗余备份,具体的地址和设备规划详见其上。 图 1-1 某中型企业内部网络拓扑规划 【实验设备】 模块化路由器设备(2 台)、三层交换机设备(1 台)、二层接入交换机设备(2 台)、测试计算机(6 台) 【技术需求分析】 企业要求新的企业内部网络建设,需严格遵循“安全性;可管理性;稳定性”的原则 : 需求 1:为了保证网络出口稳定可靠性:企业向 ISP 申请了两条 internet 线路,需要这两条线 路做负载均衡和冗余备份。 分析 1:出口两台设备连接
4、两条线路,可采用 VRRP 技术实现负载均衡,使得客户端连接外网透明化。 需求 2: 为了保证网络安全可靠性:企业要求核心设备支持防 DDoS 攻击、防恶意的 IP 扫描。因此,企业要求内部网络能实现在核心层、接入层防止网络蠕虫病毒扩散。要求核心和接入网络设备能支持 VLAN 的划分,降低网络内广播数据包的传播,提高带宽资源利用率,防止广播风暴的产生。 分析 2: 以上需求是对产品本身功能的需求,核心可采用 RG-S6800E 系列交换机,接入可采用安全接入交换机 RG-S2100 系列 需求 3: 网络具有可管理性,网络设备需能够支持灵活多样的管理方式,可以减轻管理、维护的难度。 分析 3:
5、 所有网络设备均配置远程管理功能,使得用户可以在本地登陆各个设备。 【地址规划】 设备 IP 地址 备注 R2624-A 192.168.0.254/24 R2624-A E0R2624-B 192.168.0.253/24 R2624-B E0虚拟备份组 10 192.168.0.1/24 虚拟备份组 10 虚拟备份组 20 192.168.0.2/24 虚拟备份组 20 【实验步骤】 本实验配置包括以下几个部分: 网络设备基本配置及基本测试; vrrp 功能配置及验证; vrrp 功能测试。 第一步 设备基本配置及网络测试。 (1 )S2126G-A 交换机基本配置。在实验中 S2126G
6、-A 交换机用作二层设备。 hostname S2126G-A vlan 1 end (2 )S2126G-B 交换机基本配置。在实验中 S2126G-A 交换机用作二层设备。 hostname S2126G-B vlan 1 end (3 )S3550-24-A 交换机基本配置。在实验中 S3550-24-A 交换机也用作二层设备。 hostname S3550-24-A vlan 1 end (4 )R2624-A 路由器基本配置。 conf t hostname R2624-A enable password star interface FastEthernet0 ip address
7、 192.168.0.254 255.255.255.0 no shut exit !为 R2624-A 的 F0 口分配 IP 地址 line vty 0 4 password star login (5 )R2624-B 路由器基本配置。 conf t hostname R2624-B ! enable password star ! interface FastEthernet0 ip address 192.168.0.253 255.255.255.0 no shut !为 R2624-B 的 F0 口分配 IP 地址 exit line vty 0 4 password star
8、login (6 )测试网络连通性。通过 ping 测试,网络通信正常。如果测试失败,请检查设备基本配置。 R2624-A#ping 192.168.0.253 Type escape sequence to abort. Sending 5, 100-byte ICMP Echoes to 192.168.0.253, timeout is 2 seconds: .! Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/4 ms !在 R2624-A 上,使用 ping 命令来测试到 R2624-B 的连通性。 R26
9、24-B#ping 192.168.0.254 Type escape sequence to abort. Sending 5, 100-byte ICMP Echoes to 192.168.0.254, timeout is 2 seconds: ! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms !在 R2624-A 上,使用 ping 命令来测试到 R2624-A 的连通性。 第二步 在路由器上配置 vrrp 功能。 VRRP 功能是通过配置两台 R2624 路由器来实现的。根据实验方案,我们实
10、现两个备份组,虚拟出两个 ip 地址:虚拟备份组 10 ip 地址为 192.168.0.1/24;虚拟备份组 20 ip 地址为192.168.0.2/24。 ( 1)在 R2624-A 上做以下配置: interface FastEthernet0 vrrp 10 priority 105 !设置虚拟组优先级为 105,默认为 100 vrrp 10 ip 192.168.0.1 !配置虚拟组地址 vrrp 20 ip 192.168.0.2 !配置虚拟组地址 exit ( 2)在 R2624-B 上做以下配置: interface FastEthernet0 vrrp 10 ip 192
11、.168.0.1 vrrp 20 priority 150 vrrp 20 ip 192.168.0.2 exit ( 3) VRRP 验证。 通过(1 )、( 2)的配置,虚拟组 10 以在 R2624-A 为主路由器, R2624-B 为备份路由器;虚拟组 20 以 R2624-A 为备份路由器,R2624-B 为主路由器。使用如下命令验证 VRRP 配置。 R2624-A#show vrrp brief Interface Grp Pri Time Own Pre State Master addr Group addr FastEthernet0 10 105 - - P Master
12、 192.168.0.254 192.168.0.1 FastEthernet0 20 100 - - P Backup 192.168.0.253 192.168.0.2 !对备份组 10 虚拟 IP 地址为 192.168.0.1,以 R2624-A 为主路由器 !对备份组 20 虚拟 IP 地址为 192.168.0.2,以 R2624-A 为备份路由器 R2624-B#show vrrp brief !显示当前 vrrp 状态 Interface Grp Pri Time Own Pre State Master addr Group addr FastEthernet0 10 100
13、 - - P Backup 192.168.0.254 192.168.0.1 FastEthernet0 20 150 - - P Master 192.168.0.253 192.168.0.2 !对备份组 10 虚拟 IP 地址为 192.168.0.1,以 R2624-B 为备份路由器 !对备份组 20 虚拟 IP 地址为 192.168.0.2,以 R2624-B 为主路由器 使用如下命令查看详细 VRRP 信息。 在 R2624-A 上查看 vrrp 信息: R2624-A#show vrrp !显示当前 vrrp 状态 FastEthernet0 - Group 10 !以太网接
14、口名称及接口上设置的 vrrp 备份组号 State is Master ! vrrp 备份组状态 Virtual IP address is 192.168.0.1 configured !备份组 10 虚拟 ip 地址 Virtual MAC address is 0000.5e00.010A !备份组 10 虚拟 mac 地址 Advertisement interval is 1 sec !vrrp 通告时间间隔 Preemption is enabled !设置了抢占模式 min delay is 0 sec Priority is 105 !优先级 Master Router is
15、 192.168.0.254 (local), priority is 105 !虚拟组 10 master 路由器 ip 地址及 master 路由器优先级 Master Advertisement interval is 1 sec ! master 路由器通告时间间隔 Master Down interval is 3 sec !master 路由器失效判断时间间隔 FastEthernet0 - Group 20 !以太网接口名称及接口上设置的 vrrp 备份组号 State is Backup ! vrrp 备份组状态 Virtual IP address is 192.168.0.
16、2 configured !备份组 20 虚拟 ip 地址 Virtual MAC address is 0000.5e00.0114 !备份组 20 虚拟 MAC 地址 Advertisement interval is 1 sec ! vrrp 通告时间间隔 Preemption is enabled min delay is 0 sec Priority is 100 !设置优先级 Master Router is 192.168.0.253 , pritority is 150 !虚拟组 20 master 路由器 ip 地址及 master 路由器优先级 Master Adverti
17、sement interval is 1 sec !master 路由器通告时间间隔 Master Down interval is 3 sec !master 路由器失效判断时间间隔 在 R2624-B 上查看 vrrp 信息: R2624-B#show vrrp FastEthernet0 - Group 10 State is Backup Virtual IP address is 192.168.0.1 configured Virtual MAC address is 0000.5e00.010A Advertisement interval is 1 sec Preemption
18、 is enabled min delay is 0 sec Priority is 100 Master Router is 192.168.0.254 , pritority is 105 Master Advertisement interval is 1 sec Master Down interval is 3 sec FastEthernet0 - Group 20 State is Master Virtual IP address is 192.168.0.2 configured Virtual MAC address is 0000.5e00.0114 Advertisem
19、ent interval is 1 sec Preemption is enabled min delay is 0 sec Priority is 150 Master Router is 192.168.0.253 (local), priority is 150 Master Advertisement interval is 1 sec Master Down interval is 3 sec ( 4)网络连通性测试 对于接在接入层设备 S2126G 上的用户,为其分配 ip 地址为 192.168.0.3/24192.168.0.252/24,网关可以指向 192.168.0.1
20、或者 192.168.0.2。由于在出口路由器上配置了 vrrp, vrrp 功能可以为网络提供冗余备份和负载均衡功能。 D:ipconfig Windows 2000 IP Configuration Ethernet adapter 本地连接: Connection-specific DNS Suffix . : IP Address. . . . . . . . . . . . : 192.168.0.234 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.
21、168.0.1 !终端用户以虚拟组 10 为网关 D:ping 192.168.0.1 Pinging 192.168.0.1 with 32 bytes of data: Reply from 192.168.0.1: bytes=32 timeipconfig Windows 2000 IP Configuration Ethernet adapter 本地连接: Connection-specific DNS Suffix . : IP Address. . . . . . . . . . . . : 192.168.0.234 Subnet Mask . . . . . . . . .
22、 . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.0.2 !终端用户以虚拟组 20 为网关 D:ping 192.168.0.2 Pinging 192.168.0.2 with 32 bytes of data: Reply from 192.168.0.2: bytes=32 timeipconfig Windows 2000 IP Configuration Ethernet adapter 本地连接: Connection-specific DNS Suffix . : IP Address. . . .
23、. . . . . . . . : 192.168.0.234 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.0.1 !以虚拟组 10 为默认网关的终端用户 D:ping 192.168.0.1 Pinging 192.168.0.1 with 32 bytes of data: Reply from 192.168.0.1: bytes=32 timeipconfig Windows 2000 IP Configuration Ethernet ada
24、pter 本地连接: Connection-specific DNS Suffix . : IP Address. . . . . . . . . . . . : 192.168.0.234 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.0.2 D:ping 192.168.0.2 Pinging 192.168.0.2 with 32 bytes of data: Reply from 192.168.0.2: bytes=32 timeipconfi
25、g Windows 2000 IP Configuration Ethernet adapter 本地连接: Connection-specific DNS Suffix . : IP Address. . . . . . . . . . . . : 192.168.0.234 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.0.1 D:ping 192.168.0.1 -t Pinging 192.168.0.1 with 32 bytes of dat
26、a: Reply from 192.168.0.1: bytes=32 timeipconfig Windows 2000 IP Configuration Ethernet adapter 本地连接: Connection-specific DNS Suffix . : IP Address. . . . . . . . . . . . : 192.168.0.234 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.0.1 D:ping 192.168.
27、0.1 -t Pinging 192.168.0.1 with 32 bytes of data: Reply from 192.168.0.1: bytes=32 timeipconfig Windows 2000 IP Configuration Ethernet adapter 本地连接: Connection-specific DNS Suffix . : IP Address. . . . . . . . . . . . : 192.168.0.234 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway
28、. . . . . . . . . : 192.168.0.1 D:ping 192.168.0.1 -t Pinging 192.168.0.1 with 32 bytes of data: Reply from 192.168.0.1: bytes=32 time10ms TTL=255 Reply from 192.168.0.1: bytes=32 time10ms TTL=255 !R2624-A 出现故障 Request timed out. Request timed out. Reply from 192.168.0.1: bytes=32 time10ms TTL=255 R
29、eply from 192.168.0.1: bytes=32 time10ms TTL=255 Reply from 192.168.0.1: bytes=32 time10ms TTL=255 Reply from 192.168.0.1: bytes=32 time10ms TTL=255 !R2624-A 恢复正常时刻 Reply from 192.168.0.1: bytes=32 time10ms TTL=255 Reply from 192.168.0.1: bytes=32 time10ms TTL=255 !当 R2624-A 出现故障,到当 R2624-A 恢复正常的过程中
30、,网络在出现暂时中断之后恢复正常,在路由器 R2624-A 恢复正常后,网络切换回来,通信正常,不会发生中断。 E) 当 R2624-A 出现故障,到 R2624-A 恢复正常,VRRP 状态变化。 R2624-B#show vrrp brief Interface Grp Pri Time Own Pre State Master addr Group addr FastEthernet0 10 100 - - P Master 192.168.0.253 192.168.0.1 FastEthernet0 20 150 - - P Master 192.168.0.253 192.168.
31、0.2 !R2624-A 发生故障,R2624-B 路由器 vrrp 状态,备份组状态发生变化 R2624-B#show vrrp brief Interface Grp Pri Time Own Pre State Master addr Group addr FastEthernet0 10 100 - - P Backup 192.168.0.254 192.168.0.1 FastEthernet0 20 150 - - P Master 192.168.0.253 192.168.0.2 !当 R2624-A 恢复正常,R2624-B 路由器 vrrp 状态 R2624-A#show
32、 vrrp brief Interface Grp Pri Time Own Pre State Master addr Group addr FastEthernet0 10 105 - - P Master 192.168.0.254 192.168.0.1 FastEthernet0 20 100 - - P Backup 192.168.0.253 192.168.0.2 !当 R2624-A 恢复正常,R2624-A 路由器 vrrp 状态变化 【问题与思考】 掌握 VRRP 原理,理解负载均衡和冗余备份概念和原理。 【参考配置】 参考配置包括: (1 )R2624-A 参考配置;
33、(2 )R2624-B 参考配置; (3 )S3550-24-A 参考配置; (4 )S2126G-A 参考配置; (5 )S2126G-B 参考配置; ( 1) R2624-A 参考配置 R2624-A#show run Building configuration. Current configuration: ! version 6.14(2) ! hostname “R2624-A“ ! enable password star ! ip subnet-zero ! interface FastEthernet0 ip address 192.168.0.254 255.255.255
34、.0 vrrp 10 priority 105 vrrp 10 ip 192.168.0.1 vrrp 20 ip 192.168.0.2 ! interface FastEthernet1 no ip address shutdown ! interface FastEthernet2 no ip address shutdown ! interface FastEthernet3 no ip address shutdown ! interface Serial0 no ip address shutdown ! interface Serial1 no ip address shutdo
35、wn ! ip classless ! line con 0 line aux 0 line vty 0 4 password star login ! end R2624-A# ( 2) R2624-B 参考配置 R2624-B#show run Building configuration. Current configuration: ! hostname “R2624-B“ ! enable password star ! ip subnet-zero ! interface FastEthernet0 ip address 192.168.0.253 255.255.255.0 vr
36、rp 10 ip 192.168.0.1 vrrp 20 priority 150 vrrp 20 ip 192.168.0.2 ! interface FastEthernet1 no ip address shutdown ! interface FastEthernet2 no ip address shutdown ! interface FastEthernet3 no ip address shutdown ! interface Serial0 no ip address shutdown ! interface Serial1 no ip address shutdown !
37、ip classless ! line con 0 line 1 8 line aux 0 line vty 0 4 password star login ! end R2624-B# ( 3) S3550-24-A 参考配置 S3550-24-A#show run Building configuration. Current configuration : 58 bytes ! version 1.0 ! hostname S3550-24-A vlan 1 ! end S3550-24-A# ( 4) S2126G-A 参考配置 S2126G-A#SHOW RUN Building configuration. Current configuration : 56 bytes ! version 1.0 ! hostname S2126G-A vlan 1 ! End ( 5) S2126G-B 参考配置 S2126G-B#SHOW RUN Building configuration. Current configuration : 56 bytes ! version 1.0 ! hostname S2126G-B vlan 1 ! End