高可用性网络:
一、服务器: 群集【LB(负载均衡)、HA(高可用性)、HP(高性能)】
二、路由设备 : 1.cisco(HSRP) 2.H3C(VRRP)
vrrp:http://5645432.blog.51cto.com/5635432/965540
vrrp接口跟踪:http://5645432.blog.51cto.com/5635432/967608
三、网络接口:(多网卡绑定)
http://5645432.blog.51cto.com/5635432/962950
四、链路备份 :
LAN: 1.STP 2.RSTP 3.MSTP 4. 链路聚合[通道】
stp:http://5645432.blog.51cto.com/5635432/961622
WAN: 1.浮动静态路由 2.standby按流量 3.链路捆绑
WAN:以下详细案例介绍:
案例一:浮动路由
(如果两条链路质量不等的情况下使用)
1.拓扑图
pc1:IP:192.168.1.100
MASK:255.255.255.0
网关:192.168.1.254
pc2:IP:192.168.2.100
MASK:255.255.255.0
网关:192.168.2.254
2.设备描述:
[Router]display version
Copyright Notice:
All rights reserved (Jul 31 2004).
Without the owner's prior written consent, no decompiling
or reverse-engineering shall be allowed.
Huawei Versatile Routing Platform Software
VRP (R) software, Version 1.74 Release 0108
Copyright (c) 1997-2003 HUAWEI TECH CO., LTD.
Quidway R2621 uptime is 0 days 0 hours 0 minutes 51 seconds
System returned to ROM by power-on.
Quidway R2621 with 1 MPC 8240 Processor
Router serial number is 8040C5ED0A394C6C
32M bytes SDRAM
8192K bytes Flash Memory
0K bytes NVRAM
Config Register points to FLASH
Hardware Version is MTR 1.1
CPLD Version is CPLD 3.0
Bootrom Version is 7.03
[AUX ] AUX Hardware Version is 1.0, Driver Version is 1.0
[LAN ] 2FE Hardware Version is 2.0, Driver Version is 2.0
[WAN ] SAB Hardware Version is 1.0, Driver Version is 1.0
[Slot 1] 16AS Hardware Version is 2.1, Driver Version is 1.0
3.设备配置:
路由器R1的配置:
[Router]sysname R1
[R1]interface e0 // 供telnet使用
[R1-Ethernet0]ip add 192.168.101.3 255.255.255.0
[R1-Ethernet0]int e1
[R1-Ethernet1]ip add 192.168.1.254 255.255.255.0
[R1-Ethernet1]int s0
[R1-Serial0]ip add 192.168.3.1 255.255.255.0
[R1-Serial0]int s1
[R1-Serial1]ip add 192.168.4.1 255.255.255.0
[R1-Serial1]quit
[R1]ospf enable
Start OSPF task...
OSPF enabled
[R1-ospf]int e1
[R1-Ethernet1]ospf enable area 0
[R1-Ethernet1]int s0
[R1-Serial0]ospf enable area 0
[R1-Serial0]quit
[R1]ip route-static 192.168.2.0 24 192.168.4.2 //静态路由
路由器R2的配置:
[Router]sysname R2
[R2]int e0
[R2-Ethernet0]ip add 192.168.101.9 255.255.255.0
[R2-Ethernet0]int e1
[R2-Ethernet1]ip add 192.168.2.254 255.255.255.0
[R2-Ethernet1]int s0
[R2-Serial0]ip add 192.168.3.2 255.255.255.0
[R2-Serial0]shutdown
% Interface Serial0 is down
[R2-Serial0]
%01:03:48: Interface Serial0 is DOWN
[R2-Serial0]undo shutdown
% Interface Serial0 is reset //串行口的另一端要复位
[R2-Serial0]int s1
[R2-Serial1]
%01:04:00: Line protocol ip on the interface Serial0 is UP
[R2-Serial1]ip add 192.168.4.2 255.255.255.0
[R2-Serial1]
%01:04:19: Line protocol ip on the interface Serial1 is UP
[R2-Serial1]shutdown
% Interface Serial1 is down
[R2-Serial1]
%01:04:23: Interface Serial1 is DOWN
[R2-Serial1]undo shutdown
% Interface Serial1 is reset
[R2]lang
Current Language : ENGLISH
Will you switch language mode ?(Y/N)y
You have changed the language mode
[R2]ospf enable //启用ospf协议
[R2-ospf]int s0
[R2-Serial0]ospf enable area 0 //在接口下启用ospf
[R2-Serial0]int e1
[R2-Ethernet1]ospf enable area 0
[R2-Ethernet1]quit
[R2]ip route-static 192.168.1.0 24 192.168.4.1
[R2]dis ip routing-table 查看路由表
Routing Tables:
Destination/Mask Proto Pref Metric Nexthop Interface
127.0.0.0/8 Direct 0 0 127.0.0.1 LoopBack0
127.0.0.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.1.0/24 OSPF 10 1572 192.168.3.1 Serial0
192.168.2.0/24 Direct 0 0 192.168.2.254 Ethernet1
192.168.2.254/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.3.0/24 Direct 0 0 192.168.3.1 Serial0
192.168.3.1/32 Direct 0 0 192.168.3.1 Serial0
192.168.3.2/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.4.0/24 Direct 0 0 192.168.4.1 Serial1
192.168.4.1/32 Direct 0 0 192.168.4.1 Serial1
192.168.4.2/32 Direct 0 0 127.0.0.1 LoopBack0
[R1]dis ip routing
Routing Tables:
Destination/Mask Proto Pref Metric Nexthop Interface
127.0.0.0/8 Direct 0 0 127.0.0.1 LoopBack0
127.0.0.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.1.0/24 Direct 0 0 192.168.1.254 Ethernet1
192.168.1.254/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.2.0/24 OSPF 10 1572 192.168.3.2 Serial0
192.168.3.0/24 Direct 0 0 192.168.3.2 Serial0
192.168.3.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.3.2/32 Direct 0 0 192.168.3.2 Serial0
192.168.4.0/24 Direct 0 0 192.168.4.2 Serial1
192.168.4.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.4.2/32 Direct 0 0 192.168.4.2 Serial1
4.基本测试:
分支机构客户机ip:
C:\Users\Administratort>ping 192.168.2.254
正在 Ping 192.168.2.254 具有 32 字节的数据:
来自 192.168.2.254 的回复: 字节=32 时间<1ms TTL=255
来自 192.168.2.254 的回复: 字节=32 时间<1ms TTL=255
来自 192.168.2.254 的回复: 字节=32 时间<1ms TTL=255
来自 192.168.2.254 的回复: 字节=32 时间<1ms TTL=255
192.168.2.254 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 0ms,最长 = 0ms,平均 = 0ms
C:\Users\Administrator>ping 192.168.1.254
正在 Ping 192.168.1.254 具有 32 字节的数据:
来自 192.168.1.2 的回复: 无法访问目标主机。
来自 192.168.1.254 的回复: 字节=32 时间=19ms TTL=254
来自 192.168.1.254 的回复: 字节=32 时间=18ms TTL=254
来自 192.168.1.254 的回复: 字节=32 时间=18ms TTL=254
192.168.1.254 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 18ms,最长 = 19ms,平均 = 18ms
C:\Users\Administrator>ping 192.168.1.100
正在 Ping 192.168.1.100 具有 32 字节的数据:
来自 192.168.1.2 的回复: 无法访问目标主机。
来自 192.168.1.100 的回复: 字节=32 时间=19ms TTL=62
来自 192.168.1.100 的回复: 字节=32 时间=18ms TTL=62
来自 192.168.1.100 的回复: 字节=32 时间=18ms TTL=62
192.168.1.100 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 18ms,最长 = 19ms,平均 = 18ms
C:\Users\Administrator>tracert 192.168.1.100
通过最多 30 个跃点跟踪
到 DELL-PC [192.168.1.100] 的路由:
1 <1 毫秒 <1 毫秒 2 ms 192.168.2.254
2 22 ms 22 ms 22 ms 192.168.3.1
3 27 ms 27 ms 26 ms DELL-PC [192.168.1.100]
跟踪完成。
5. 断开主链路测试
5.1把骨干链路s0断开,测试联通情况并检测走的是哪条链路:
[R2]int s0
[R2-Serial0]shutdown
% Interface Serial0 is down
[R2-Serial0]
%01:51:32: Interface Serial0 is DOWN
%01:51:32: Line protocol ip on the interface Serial0
5.2 把骨干链路so还原,看连通情况并检测走的是哪条链路:
[R2-Serial0]undo shutdown
% Interface Serial0 is reset
[R2-Serial0]
%01:53:54: Interface Serial0 is UP
%01:53:54: Line protocol ip on the interface Serial0 is UP!
没有丢包!
案例二、standby 节省流量
如果租用 的两条链路质量相等,则都使用静态路由【按流量,节省费用】
1.拓扑图:
2.设备配置:
基于案例一,做的改动:
R1的配置:
删除动态路由:
[R1]undo ospf enable
Terminate OSPF task...
OSPF disabled
创建静态路由:
[R1]ip route-static 192.168.2.0 24 192.168.3.2
[R1]display ip routing-table //看到负载均衡
Routing Tables:
Destination/Mask Proto Pref Metric Nexthop Interface
127.0.0.0/8 Direct 0 0 127.0.0.1 LoopBack0
127.0.0.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.1.0/24 Direct 0 0 192.168.1.254 Ethernet1
192.168.1.254/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.2.0/24 Static 60 0 192.168.3.2 Serial0
192.168.4.2 Serial1
192.168.3.0/24 Direct 0 0 192.168.3.2 Serial0
192.168.3.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.3.2/32 Direct 0 0 192.168.3.2 Serial0
192.168.4.0/24 Direct 0 0 192.168.4.2 Serial1
192.168.4.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.4.2/32 Direct 0 0 192.168.4.2 Serial1
[R1]int s0
[R1-Serial0]standby ?
interface Specify a standby interface
logic-channel Specify a standby logic-channel
state-down Define the down condition of logic-channel
state-up Define the up condition of the logic-channel
threshold Set traffic threshholds for line up or down
timer Config standby timer information
[R1-Serial0]standby interface s 1 //该接口会立即down掉,没有流量通过
[R1-Serial0]
%02:17:12: Interface Serial1 is DOWN
%02:17:12: Line protocol ip on the interface Serial1 is DOWN
[R1-Serial0]quit
[R1]dis ip routing-table
Routing Tables:
Destination/Mask Proto Pref Metric Nexthop Interface
127.0.0.0/8 Direct 0 0 127.0.0.1 LoopBack0
127.0.0.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.1.0/24 Direct 0 0 192.168.1.254 Ethernet1
192.168.1.254/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.2.0/24 Static 60 0 192.168.3.2 Serial0
192.168.3.0/24 Direct 0 0 192.168.3.2 Serial0
192.168.3.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.3.2/32 Direct 0 0 192.168.3.2 Serial0
R2的配置:
[R2]undo ospf enable
Terminate OSPF task...
OSPF disabled
[R2]ip route-static 192.168.1.0 24 192.168.3.1
[R2]dis ip routing
Routing Tables:
Destination/Mask Proto Pref Metric Nexthop Interface
127.0.0.0/8 Direct 0 0 127.0.0.1 LoopBack0
127.0.0.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.1.0/24 Static 60 0 192.168.3.1 Serial0
192.168.4.1 Serial1
192.168.2.0/24 Direct 0 0 192.168.2.254 Ethernet1
192.168.2.254/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.3.0/24 Direct 0 0 192.168.3.1 Serial0
192.168.3.1/32 Direct 0 0 192.168.3.1 Serial0
192.168.3.2/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.4.0/24 Direct 0 0 192.168.4.1 Serial1
192.168.4.1/32 Direct 0 0 192.168.4.1 Serial1
192.168.4.2/32 Direct 0 0 127.0.0.1 LoopBack0
[R1]logout
The connection was closed by the remote host !
[R2]
%02:08:49: Interface Serial1 is DOWN
%02:08:49: Line protocol ip on the interface Serial1 is DOWN
[R2]int s0
[R2-Serial0]standby interface s1
[R2-Serial0]quit
[R2]dis ip routing
Routing Tables:
Destination/Mask Proto Pref Metric Nexthop Interface
127.0.0.0/8 Direct 0 0 127.0.0.1 LoopBack0
127.0.0.1/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.1.0/24 Static 60 0 192.168.3.1 Serial0
192.168.2.0/24 Direct 0 0 192.168.2.254 Ethernet1
192.168.2.254/32 Direct 0 0 127.0.0.1 LoopBack0
192.168.3.0/24 Direct 0 0 192.168.3.1 Serial0
192.168.3.1/32 Direct 0 0 192.168.3.1 Serial0
192.168.3.2/32 Direct 0 0 127.0.0.1 LoopBack0
3.测试:
断开骨干链路
[R2]int s0
[R2-Serial0]shutdown
% Interface Serial0 is down
[R2-Serial0]
%02:20:24: Interface Serial0 is DOWN
%02:20:24: Line protocol ip on the interface Serial0 is DOWN
%02:20:34: Interface Serial1 is UP
%02:20:34: Line protocol ip on the interface Serial1 is UP
还原骨干链路:
[R2-Serial0]undo shutdown
% Interface Serial0 is reset
[R2-Serial0]
%02:23:49: Interface Serial0 is UP
%02:23:49: Line protocol ip on the interface Serial0 is UP
%02:23:50: Interface Serial1 is DOWN
%02:23:50: Line protocol ip on the interface Serial1 is DOWN
4.避免引起波动
为了以防波动的引起,可以加上以下命令:
[R2]int s0
[R2-Serial0]standby ?
interface Specify a standby interface
logic-channel Specify a standby logic-channel
state-down Define the down condition of logic-channel
state-up Define the up condition of the logic-channel
threshold Set traffic threshholds for line up or down
timer Config standby timer information
[R2-Serial0]standby timer ?
disable-delay delay timer(in seconds) to disable the standby interface
enable-delay delay timer(in seconds) to enable the standby interface
[R2-Serial0]standby timer enable-delay ?
INTEGER<0-65535> Enable delay-time value(seconds)
[R2-Serial0]standby timer enable-delay 10
[R2-Serial0]standby timer disable-delay 10
[R1]int s0
[R1-Serial0]standby timer enable-delay 10 //启用备份链路的延迟
[R1-Serial0]standby timer disable-delay 10 //启用骨干链路的延
[R1]int s0
[R1-Serial0]shutdown
[R1]dis int s0
Serial0 current state:manually down, line protocol current state:down
The Maximum Transmit Unit is 1500
Internet Address is 192.168.3.1(24)
[R1-Serial0]undo shutdown
[R1-Serial0]
%02:55:41: Interface Serial0 is UP
%02:55:41: Line protocol ip on the interface Serial0 is UP
%02:55:51: Interface Serial1 is DOWN
%02:55:51: Line protocol ip on the interface Serial1 is DOWN
案例三、链路捆绑
用在公司比较有资金的情况下,为了提高吞吐量而设计!
1.拓扑图:
2. 设备配置
删除物理接口ip :
[R1-Serial1]int s0
[R1-Serial0]undo ip add
[R1-Serial0]
%02:57:44: Line protocol ip on the interface Serial0 is DOWN
[R1-Serial0]undo standby int s1
[R1-Serial0]int s1
[R1-Serial1]undo ip add
[R1]undo ip route-static 192.168.2.0 24
[R2]int s0
[R2-Serial0]undo ip address
[R2-Serial0]
%02:55:08: Line protocol ip on the interface Serial0 is DOWN
[R2-Serial0]undo standby int s1
[R2-Serial0]
%02:55:19: Interface Serial1 is UP
[R2-Serial0]int s1
[R2-Serial1]undo ip address
[R2-Serial1]quit
[R2]undo ip route-static 192.168.1.0 24
创建虚拟模板接口:
路由器R2的配置:
[R2]interface ?
Async Async接口
Aux Aux接口
Bridge-Template 桥组虚接口
Dialer 拨号口
Ethernet 以太网口
Loopback 环回接口
Null 空接口
MFR 多链路帧中继捆绑接口
Serial 串口
Tunnel 隧道接口
Virtual-Template 虚拟模板接口
[R2]interface Virtual-Template ?
INTEGER<1-25> 虚拟模板接口索引
[R2]interface Virtual-Template 1 ?
<cr>
[R2]interface Virtual-Template 1
[R2-Virtual-Template1]ip add 192.168.8.2 24
[R2-Virtual-Template1]int s0
[R2-Serial0]ppp ?
accounting-mode 设置PPP计费方式
authentication-mode 设置PPP验证方式
authorization-mode 设置PPP授权方式
callback 设置回呼协商参数
chap 设置CHAP参数
compression 设置PPP报文压缩方式
dns 设置分配给客户端的DNS-SERVER地址参数
iphc 设置PPP的IPHC参数
lqr 设置链路质量监测的参数
mp 指定multilink配置信息
pap 设置PAP参数
timer 设置超时时间间隔
[R2-Serial0]ppp mp interface ?
Virtual-Template 虚拟模板接口
[R2-Serial0]ppp mp interface Virtual-Template 1
[R2-Serial0]int s1
[R2-Serial1]ppp mp interface Virtual-Template 1
[R2-Serial1]int s0
[R2-Serial0]ppp ?
accounting-mode 设置PPP计费方式
authentication-mode 设置PPP验证方式
authorization-mode 设置PPP授权方式
callback 设置回呼协商参数
chap 设置CHAP参数
compression 设置PPP报文压缩方式
dns 设置分配给客户端的DNS-SERVER地址参数
iphc 设置PPP的IPHC参数
lqr 设置链路质量监测的参数
mp 指定multilink配置信息
pap 设置PAP参数
timer 设置超时时间间隔
[R2-Serial0]ppp mp ?
<cr> 使能/禁用PPP多链路捆绑
interface 指定MP捆绑的链路
[R2-Serial0]ppp mp
[R2-Serial0]int s1
[R2-Serial1]ppp mp
[R2-Serial1]quit
[R2]ip route-static 192.168.1.0 24 192.168.8.1
路由器R1的配置:
[R1]lan
Current Language : ENGLISH
Will you switch language mode ?(Y/N)y
You have changed the language mode
[R1]interface Virtual-Template 1
[R1-Virtual-Template1]ip add 192.168.8.1 24
[R1-Virtual-Template1]int s0
[R1-Serial0]ppp mp interface ?
Virtual-Template 虚拟模板接口
[R1-Serial0]ppp mp interface Virtual-Template ?
INTEGER<1-25> 虚拟模板接口索引
[R1-Serial0]ppp mp interface Virtual-Template 1
[R1-Serial0]int s1
[R1-Serial1]ppp mp interface Virtual-Template 1
[R1-Serial1]ppp mp
[R1-Serial1]
%03:15:22: Line protocol ip on the interface Virtual-Template1(Virtual-Template1:0) is UP
[R1-Serial1]int s0
[R1-Serial0]ppp mp
[R1-Serial0]quit
[R1]ip route-static 192.168.2.0 24 192.168.8.2
[R1]dis int vir 1
Virtual-Template1当前状态:UP,链路层协议当前状态:UP
最大传输单元: 1500
Internet地址是 192.168.8.1(24)
接口类型: 虚拟模板接口
封装协议是PPP
先进先出队列: FIFO
(输出队列:当前/最大/丢弃)
FIFO: 0/75/0
上次清除统计信息的时间: 无
Virtual-Template1:0当前状态:UP,链路层协议当前状态:UP
接口类型: Virtual Access 接口
封装协议是PPP
LCP状态opened, IPCP状态opened, IPXCP状态initial, CCP状态initial, BRIDGECP状态 initial
收到: 报文: 301, 字节: 6672, 丢弃:0, 错误:0
发送: 报文: 317, 字节: 6347, 丢弃:0, 错误:0
5分钟输入速率为 0.96字节/秒, 0.06报文/秒
5分钟输出速率为 1.07字节/秒, 0.07报文/秒
先进先出队列: FIFO
(输出队列:当前/最大/丢弃)
FIFO: 0/75/0
[R1]dis int vir 1
Virtual-Template1当前状态:UP,链路层协议当前状态:UP
最大传输单元: 1500
Internet地址是 192.168.8.1(24)
接口类型: 虚拟模板接口
封装协议是PPP
先进先出队列: FIFO
(输出队列:当前/最大/丢弃)
FIFO: 0/75/0
上次清除统计信息的时间: 无
Virtual-Template1:0当前状态:UP,链路层协议当前状态:UP
接口类型: Virtual Access 接口
封装协议是PPP
LCP状态opened, IPCP状态opened, IPXCP状态initial, CCP状态initial, BRIDGECP状态 initial
收到: 报文: 403, 字节: 9484, 丢弃:0, 错误:0
发送: 报文: 412, 字节: 8867, 丢弃:0, 错误:0
5分钟输入速率为 23.12字节/秒, 0.64报文/秒
5分钟输出速率为 21.19字节/秒, 0.65报文/秒
先进先出队列: FIFO
(输出队列:当前/最大/丢弃)
FIFO: 0/75/0
3. 测试:
当前客户机ip为:192.168.2.100
[R1]int s0
[R1-Serial0]shutdown
% 接口Serial0当前状态变为shutdown
[R1-Serial0]
%03:23:09: 接口Serial0当前状态变为DOWN
[R1-Serial0]undo shutdown
% 接口Serial0当前状态变为reset
[R1-Serial0]
%03:24:21: Interface Serial0 is UP
只是存在延迟,并没有数据包丢失!