1、实验拓扑

wKiom1aA-0qC6a-wAABMvjFbuac466.png

Gateway Load Balancing Protocol


AVF(Active virtual forwarder)

所有运行GLBP的路由器,交换机都成为AVF

AVG(Active virtual gateway)

从所有AVF中选取出一个AVG(高优先级,高IP)


GLBP一个虚拟网关IP,多个虚拟MAC(AVG为每台AVF分配一个虚拟MAC地址)


当PC发送ARP Request时,AVG进行响应,回应一个虚拟MAC地址,该虚拟MAC地址可能是AVG本身的虚拟MAC地址,也可能是其中AVF中任一个的虚拟MAC地址。


2、基础配置

R1配置

interface Serial0/0

 ip address 12.1.1.1 255.255.255.0

interface Serial0/1

 ip address 13.1.1.1 255.255.255.0

interface Serial0/2

 ip address 15.1.1.1 255.255.255.0


router ospf 110

 router-id 1.1.1.1

 log-adjacency-changes

 network 12.1.1.0 0.0.0.255 area 0

 network 13.1.1.0 0.0.0.255 area 0

 network 15.1.1.0 0.0.0.255 area 0


R2配置

interface Serial0/0

 ip address 12.1.1.2 255.255.255.0

interface FastEthernet1/0

 ip address 100.1.1.2 255.255.255.0

router ospf 110

 router-id 2.2.2.2

 network 12.1.1.0 0.0.0.255 area 0

 network 100.1.1.0 0.0.0.255 area 0


R3配置

interface Serial0/1

 ip address 13.1.1.3 255.255.255.0

interface FastEthernet1/0

 ip address 100.1.1.3 255.255.255.0

router ospf 110

 router-id 3.3.3.3

 network 13.1.1.0 0.0.0.255 area 0

 network 100.1.1.0 0.0.0.255 area 0


R4配置

no ip routing

interface FastEthernet1/0

 ip address 100.1.1.4 255.255.255.0

ip default-gateway 100.1.1.254


R5配置

interface Serial0/2

 ip address 15.1.1.5 255.255.255.0

router ospf 110

 router-id 5.5.5.5

 network 15.1.1.0 0.0.0.255 area 0


R6配置

no ip routing

interface FastEthernet1/0

 ip address 100.1.1.6 255.255.255.0

ip default-gateway 100.1.1.254


3、配置GLBP

R2配置

interface FastEthernet1/0

 glbp 1 ip 100.1.1.254


R3配置

interface FastEthernet1/0

 glbp 1 ip 100.1.1.254


3、测试GLBP

wKiom1aA_MOD00wRAAAqcPA9A-Q935.png

wKiom1aA_MTg_sjqAAAqbgCWQNw960.png

两台不同的PC分别从不同的路由器出去了,证明确实起到了负载均衡。