网关冗余实验(22/3/11)(修订2)

一、网关冗余
1、解决什么?
为了提高网络的稳定性,当一个网关断开后,可以很稳定的继续使用另一个网关,至此,配置多个网关,并使用虚拟网关。
2、配置如下所示:
网关冗余实验(22/3/11)(修订2)_第1张图片

(1)

SW1:
int range f0/1,f0/2,f0/3
switchport trunk encapsulation dot1q
swithcport mode trunk

vlan database
vlan 10
vlan 20
exit

int vlan 10
no sh
ip add 192.168.10.254 255.255.255.0
int vlan 20
no sh
ip add 192.168.20.253 255.255.255.0

int range f0/1 , f0/2
channel-group 1 mode on
SW2:
int range f0/1,f0/2,f0/3
switchport trunk encapsulation dot1q
swithcport mode trunk

vlan database
vlan 10
vlan 20
exit

int vlan 10
no sh
ip add 192.168.10.253 255.255.255.0
int vlan 20
no sh
ip add 192.168.20.254 255.255.255.0

int range f0/1 , f0/2
channel-group 1 mode on
SW3:
int range f0/1,f0/2
switchport trunk encapsulation dot1q
swithcport mode trunk

vlan database
vlan 10
vlan 20
exit

(2) 将R4的f0/3放入vlan 10

R3:
int f0/3
switchport mode access
switchport access vlan 10
int f0/4
switchport mode access
switchport access vlan 20

(3)对SW1,SW2配置网关冗余

(以SW1为主网关)
SW1:
int vlan 10
standby 10 ip 192.168.10.252//此处就是虚拟网关地址
standby 10 preempt //配置强占
standby 10 priority 200 //优先级,值越大越优先

int vlan 20
standby 20 ip 192.168.20.252//此处就是虚拟网关地址
standby 20 preempt //配置强占
standby 20 priority 100 //优先级,值越大越优先
(以SW2为主网关)
SW2:
int vlan 10
standby 10 ip 192.168.10.251//此处就是虚拟网关地址
standby 10 preempt //配置强占
standby 10 priority 120 //优先级,值越大越优先
//standby 10 priority 100 是默认的,用show run/show run | section standby,没有显示

int vlan 20
standby 20 ip 192.168.20.252//此处就是虚拟网关地址
standby 20 preempt //配置强占
standby 20 priority 200 //优先级,值越大越优先
//standby 10 priority 100 是默认的,用show run/show run | section standby,没有显示

(4)对PC1和PC2

PC1:
int f0/0
no sh
ip add 192.168.10.1 255.255.255.0
exit
ip route 0.0.0.0 0.0.0.0 192.168.10.252 //指向的就是虚拟vlan 10的虚拟网关

PC2:
int f0/0
no sh
ip add 192.168.20.1 255.255.255.0
exit
ip route 0.0.0.0 0.0.0.0 192.168.20.252 //指向的就是虚拟vlan 10的虚拟网关

验证:(1)用R5 ping R2的虚拟网关192.168.10.252网关冗余实验(22/3/11)(修订2)_第2张图片 (2)用R5 ping R2的虚拟网关192.168.10.252

网关冗余实验(22/3/11)(修订2)_第3张图片(3)验证关闭SW2,PC2是否能ping通192.168.20.252

网关冗余实验(22/3/11)(修订2)_第4张图片

你可能感兴趣的:(网关冗余实验基础配置,网络)