【案例背景】
   某中型企业要求新的企业内部网络建设,需严格遵循“安全性;可管理性;稳定性”的原则,具体如下:
1、为了保证网络出口稳定可靠性:企业向ISP申请了两条Internet线路,需要这两条线路做负载均衡和冗余备份。
2、为了保证网络安全可靠性:企业要求核心设备支持防DDoS***、防恶意的IP扫描。病毒侵入与非法***是企业网络很大的安全隐患。不发作则已,一发作就是大问题,因此,企业要求内部网络能实现在核心层、接入层防止网络蠕虫病毒扩散。要求核心和接入网络设备能支持VLAN的划分,降低网络内广播数据包的传播,提高带宽资源利用率,防止广播风暴的产生。
3、管理性:网络设备需能够支持灵活多样的管理方式,可以减轻管理、维护的难度。
【需求分析】
    企业要求新的企业内部网络建设,需严格遵循“安全性;可管理性;稳定性”的原则 :
    需求1:为了保证网络出口稳定可靠性:企业向ISP申请了两条internet线路,需要这两条线路做负载均衡和冗余备份。
    分析1:出口两台设备连接两条线路,可采用VRRP技术实现负载均衡,使得客户端连接外网透明化。
    需求2:为了保证网络安全可靠性:企业要求核心设备支持防DDoS***、防恶意的IP扫描。因此,企业要求内部网络能实现在核心层、接入层防止网络蠕虫病毒扩散。要求核心和接入网络设备能支持VLAN的划分,降低网络内广播数据包的传播,提高带宽资源利用率,防止广播风暴的产生。
    分析2:以上需求是对产品本身功能的需求,核心可采用RG-S6800E系列交换机,接入可采用安全接入交换机RG-S2100系列
    需求3:网络具有可管理性,网络设备需能够支持灵活多样的管理方式,可以减轻管理、维护的难度。
分析3:所有网络设备均配置远程管理功能,使得用户可以在本地登陆各个设备。
【实验拓扑】
见附件
【地址规划】
  设备                      IP地址                备注
R2624-A                192.168.0.254/24        R2624-A E0
R2624-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-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 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
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的连通性。
R2624-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路由器来实现的。根据实验方案,我们实现两个备份组,虚拟出两个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.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  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   -    -   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
!以太网接口名称及接口上设置的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 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.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 Advertisement 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 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
  Advertisement 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/24—192.168.0.252/24,网关可以指向192.168.0.1或者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.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 time<10ms TTL=255
!测试pc 192.168.0.234到网关192.168.0.1通信正常。
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.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 time<10ms TTL=255
!测试pc 192.168.0.234到网关192.168.0.1通信正常。
第三步 VRRP功能测试。测试vrrp冗余备份与负载均衡功能。
    根据vrrp功能,在主路由器失效的情况下,备份路由器会在一定的时间里切换为主路由器;在使能了抢占模式后,在路由器故障恢复后,vrrp会重新计算,主路由器切换到备份状态,故障路由器为主状态。
(1)网络正常运行情况下,vrrp状态及网络连通性。
R2624-A#show 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 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-B 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.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 time<10ms TTL=255
!测试终端用户pc 192.168.0.234到网关192.168.0.1通信正常。
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.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 time<10ms TTL=255
!测试终端用户pc 192.168.0.234到网关192.168.0.1通信正常。
(2)在R2624-A路由器出现故障,vrrp状态及网络的连通性。
在终端用户我们使用ping命令加 –t参数,来观察当路由器出现故障后网络连通性的变化,我们通过将S3550-24-A与R2624-A之间的线缆人为down掉来模拟R2624-A路由器故障。
A)在网络正常运行时网络通信正常
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.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 time<10ms TTL=255
……
!…… 表示Reply from 192.168.0.1: bytes=32 time<10ms TTL=255
!)在网络正常运行时网络通信正常
B)当R2624-A出现故障时,网络连通性变化。
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.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 time<10ms TTL=255
Reply from 192.168.0.1: bytes=32 time<10ms TTL=255
!R2624-A路由器出现故障时刻
Request timed out.
Request timed out.
Reply from 192.168.0.1: bytes=32 time<10ms TTL=255
Reply from 192.168.0.1: bytes=32 time<10ms TTL=255
……
!……表示Reply from 192.168.0.1: bytes=32 time<10ms TTL=255
!R2624-A路由器出现故障后,网络出现中断,之后很快网络恢复网络连通性。
C)当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.0.2
D) 当R2624-A出现故障,到当R2624-A恢复正常的过程,网络连通性变化。
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.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 time<10ms TTL=255
Reply from 192.168.0.1: bytes=32 time<10ms TTL=255
!R2624-A出现故障
Request timed out.
Request timed out.
Reply from 192.168.0.1: bytes=32 time<10ms TTL=255
Reply from 192.168.0.1: bytes=32 time<10ms TTL=255
……
Reply from 192.168.0.1: bytes=32 time<10ms TTL=255
Reply from 192.168.0.1: bytes=32 time<10ms TTL=255
!R2624-A恢复正常时刻
Reply from 192.168.0.1: bytes=32 time<10ms TTL=255
Reply from 192.168.0.1: bytes=32 time<10ms TTL=255
……
!当R2624-A出现故障,到当R2624-A恢复正常的过程中,网络在出现暂时中断之后恢复正常,在路由器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.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 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参考配置;
(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.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
shutdown
!
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
vrrp 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
!
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