路由网关冗余备份_第1张图片

要求:

vlan 10 20通过LS1访问Server,vlan 30 40通过LS2访问Server,三层交换负载均衡,访问Server有冗余链路

架构:

PC机ip为vlanX.1 所有网关为.254 LS1真实IP:vlanX.251 LS2真实IP:vlanX.252

配置思路

1、 配置PC的IP
2、 交换机创建vlan并将PC加入相应vlan,交换间链路用trunk,PC与交换链路用access
3、 LS1创建vlan10 20 30 40 100 LS2创建vlan10 20 30 40 200
4、 LS1、LS2与二层相连链路用trunk,与路由相连链路用access
5、 为每个vlan svi创建IP,注意ls1的vlan100 ls2的vlan200是为了设置IP与路由通信
6、 LS1创建vrrp vrid 10 20 30 40虚拟ip为vlsn x.254
7、 LS1 vrid 10 20设置优先级高于默认值,使LS1成为vlan 10 20的master
8、 LS1 vrid 10 20设置G0/0/24端口追踪,此端口断开优先级自降100,LS2抢占为master
9、 LS2创建vrrp vrid 10 20 30 40虚拟ip为vlsn x.254
10、 LS2 vrid 30 40设置优先级高于默认值,使LS1成为vlan 10 20的master
11、 LS2 vrid 30 40设置G0/0/24端口追踪,此端口断开优先级自降100,LS1抢占为master
12、 LS1、LS2相同vlan的vrid必须一致,否则无法通信,会出现两个master
13、 LS1、LS2设置默认路由
14、 ISP基本设置
15、 ISP静态路由
16、 设置通过100.1可以跳转到vlan10 20,同时设置200.1可以跳转到vlan10 20但要设置优先级低于默认值,使其成为浮动路由
17、 设置通过200.1可以跳转到vlan30 40,同时设置100.1可以跳转到vlan30 40但要设置优先级低于默认值,使其成为浮动路由

配置步骤:

1、配置PC机,IP、网关

2、交换机配置
1)划分VLAN10、VLAN20、VLAN30、VLAN40,将PC机加入VLAN
vlan batch 10 20 30 40//创建VLAN
int e 0/0/11
port link-type access
port default vlan 10
int e 0/0/12
port link-type access
port default vlan 20
int e 0/0/13
port link-type access
port default vlan 30
int e 0/0/14
port link-type access
port default vlan 40

2)PC交换机设为access链路,二层交换与三层交换设为Trunk链路
int e 0/0/1
port link-type trunk
port trunk allow-pass vlan all
int e 0/0/2
port link-type trunk
port trunk allow-pass vlan all

3、LS1配置
1)创建vlan,连二层链路trunk,连路由链路access
vlan batch 10 20 30 40 100
int g 0/0/1
port link-type trunk
port trunk allow-pass vlan all
int g 0/0/24
port link-type access
port default vlan 100
2)设置vlanif ip,vrrp
int Vlanif 100
ip add 192.168.100.1 24
int Vlanif 10
ip add 192.168.10.251 24
vrrp vrid 10 virtual-ip 192.168.10.254
vrrp vrid 10 priority 150
vrrp vrid 10 track interface g 0/0/24 reduced 100
int Vlanif 20
ip add 192.168.20.251 24
vrrp vrid 20 virtual-ip 192.168.20.254
vrrp vrid 20 priority 150
vrrp vrid 20 track interface g 0/0/24 reduced 100
int Vlanif 30
ip add 192.168.30.251 24
vrrp vrid 30 virtual-ip 192.168.30.254
int Vlanif 40
ip add 192.168.40.251 24
vrrp vrid 30 virtual-ip 192.168.40.254
3)设置通往外网的静态路由
4、LS2配置
1)创建vlan,连二层链路trunk,连路由链路access
vlan batch 10 20 30 40 200
int g 0/0/2
port link-type trunk
port trunk allow-pass vlan all
int g 0/0/24
port link-type access
port default vlan 200
2)设置vlanif ip,vrrp
int Vlanif 200
ip add 192.168.200.1 24
int Vlanif 10
ip add 192.168.10.252 24
vrrp vrid 10 virtual-ip 192.168.10.254
int Vlanif 20
ip add 192.168.20.252 24
vrrp vrid 20 virtual-ip 192.168.20.254
int Vlanif 30
ip add 192.168.30.252 24
vrrp vrid 30 virtual-ip 192.168.30.254
vrrp vrid 30 priority 150
vrrp vrid 30 track interface g 0/0/24 reduced 100
int Vlanif 40
ip add 192.168.40.252 24
vrrp vrid 40 virtual-ip 192.168.40.254
vrrp vrid 40 priority 150
vrrp vrid 40 track interface g 0/0/24 reduced 100
3)设置通往外网的静态路由

5、ISP设置
1)设置IP地址
int g 2/0/1
ip add 192.168.100.254 24
int g 2/0/2
ip add 192.168.200.254 24
int g 0/0/0
ip add 200.10.10.254 24
2)设置浮动路由
ip route-static 192.168.10.0 24 192.168.100.1
ip route-static 192.168.10.0 24 192.168.200.1 preference 61
ip route-static 192.168.20.0 24 192.168.100.1
ip route-static 192.168.20.0 24 192.168.200.1 preference 61
ip route-static 192.168.30.0 24 192.168.200.1
ip route-static 192.168.30.0 24 192.168.100.1 preference 61
ip route-static 192.168.40.0 24 192.168.200.1
ip route-static 192.168.40.0 24 192.168.100.1 preference 61