
在不改变核心路由区域中路由器数量,并且不改变用户区域接入方式的前
提下(即保持只有一台 R1),对服务器区域的网络拓扑进行修改(可增加或删除
设备,设备类型和数量自定),使得服务器区域的网络有容灾性,即当 RS-1 故障
(例如关闭 RS-1)时,用户区域主机仍然可以通过路由器 R1 访问所有服务器。

关注让【道友老李】来帮你解答,本回答参考通义千问qwen-plus编写,并整理提供,如果还有疑问可以点击头像关注,评论或留言### 问题描述 在给定的网络拓扑中,服务器区域(包含 RS-1)需要具备容灾能力,即当 RS-1 故障时,用户区域的主机仍然可以通过路由器 R1 访问所有服务器。在不改变核心路由区域中路由器数量和用户区域接入方式的前提下,对服务器区域的网络拓扑进行修改。
为了实现服务器区域的容灾性,可以采用以下方法:
增加备用服务器 RS-2:
配置负载均衡器:
用户区域
|
R1
|
LB
/ \
RS-1 RS-2
# /etc/haproxy/haproxy.cfg
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
stats timeout 30s
user haproxy
group haproxy
daemon
defaults
log global
mode http
option httplog
option dontlognull
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http
frontend http_front
bind *:80
default_backend http_back
backend http_back
balance roundrobin
server RS-1 192.168.1.101:80 check
server RS-2 192.168.1.102:80 check
确保 R1 的路由表正确配置,使流量能够通过 LB 访问服务器区域。
# 配置静态路由
ip route add 192.168.1.0/24 via <LB_IP> dev <interface>
假设用户区域的主机 IP 地址为 192.168.0.10,R1 的 IP 地址为 192.168.0.1,LB 的 IP 地址为 192.168.1.1,RS-1 的 IP 地址为 192.168.1.101,RS-2 的 IP 地址为 192.168.1.102。
正常情况下:
http://192.168.1.1,LB 将请求分发到 RS-1 或 RS-2。RS-1 故障时:
http://192.168.1.1 访问服务,不会受到影响。通过增加备用服务器 RS-2 和配置负载均衡器 LB,可以在不改变核心路由区域中路由器数量和用户区域接入方式的前提下,实现服务器区域的容灾性。当 RS-1 故障时,用户区域的主机仍然可以通过路由器 R1 访问所有服务器。