Lab purposes: understand GLBP load balancing
Basic config:+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
R1:
int lo 0
ip add 1.1.1.1 255.255.255.255
int f0/0
no sh
int f0/0.12
en do 12
ip add 12.1.1.1 255.255.255.0
int f0/0.13
en do 13
ip add 13.1.1.1 255.255.255.0
router ospf 100
net 0.0.0.0 0.0.0.0 a 0
R2:
int f0/0
no sh
int f0/0.12
en do 12
ip add 12.1.1.2 255.255.255.0
int f0/0.100
en do 100
ip add 192.168.1.2 255.255.255.0
router ospf 100
net 0.0.0.0 0.0.0.0 a 0
R3:
int f0/0
no sh
int f0/0.13
en do 13
ip add 13.1.1.3 255.255.255.0
int f0/0.100
en do 100
ip add 192.168.1.3 255.255.255.0
router ospf 100
net 0.0.0.0 0.0.0.0 a 0
R4:
int f0/0
no sh
int f0/0.100
en do 100
ip add 192.168.1.4 255.255.255.0
no ip routing
R5:
int f0/0
no sh
int f0/0.100
en do 100
ip add 192.168.1.5 255.255.255.0
no ip routing
R6:
int f0/0
no sh
int f0/0.100
en do 100
ip add 192.168.1.6 255.255.255.0
no ip routing
R7:
int f0/0
no sh
int f0/0.100
en do 100
ip add 192.168.1.7 255.255.255.0
no ip routing
Basic config+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Step 2:Default-Gateway on the R4,R5,R6,R7
ip default-gateway 192.168.1.1
Step 3:config basic glbp
R2/R3:
int f0/0.100
glbp 1 ip 192.168.1.1
step 4:verify
R2#sh glbp
FastEthernet0/0.100 - Group 1
State is Active
2 state changes, last state change 00:00:24
Virtual IP address is 192.168.1.1
Hello time 3 sec, hold time 10 sec
Next hello sent in 2.920 secs
Redirect time 600 sec, forwarder time-out 14400 sec
Preemption disabled
Active is local
Standby is 192.168.1.3, priority 100 (expires in 7.936 sec)
Priority 100 (default)
Weighting 100 (default 100), thresholds: lower 1, upper 100
Load balancing: round-robin
There are 2 forwarders (1 active)
Forwarder 1
State is Active
1 state change, last state change 00:00:14
MAC address is 0007.b400.0101 (default)
Owner ID is cc04.0ec0.0000
Redirection enabled
Preemption enabled, min delay 30 sec
Active is local, weighting 100
Arp replies sent: 1
Forwarder 2
State is Listen
MAC address is 0007.b400.0102 (learnt)
Owner ID is cc05.0ec0.0000
Redirection enabled, 597.060 sec remaining (maximum 600 sec)
Time to live: 14397.056 sec (maximum 14400 sec)
Preemption enabled, min delay 30 sec
Active is 192.168.1.3 (primary), weighting 100 (expires in 7.052 sec)
R2#
R2#
R2#
R2#
R2#
R2#sh glb
R2#sh glbp br
R2#sh glbp brief
Interface Grp Fwd Pri State Address Active router Standby router
Fa0/0.100 1 - 100 Active 192.168.1.1 local 192.168.1.3
Fa0/0.100 1 1 - Active 0007.b400.0101 local -
Fa0/0.100 1 2 - Listen 0007.b400.0102 192.168.1.3 -
R3#sh glbp
FastEthernet0/0.100 - Group 1
State is Standby
1 state change, last state change 00:32:55
Virtual IP address is 192.168.1.1
Hello time 3 sec, hold time 10 sec
Next hello sent in 1.112 secs
Redirect time 600 sec, forwarder time-out 14400 sec
Preemption disabled
Active is 192.168.1.2, priority 100 (expires in 7.184 sec)
Standby is local
Priority 100 (default)
Weighting 100 (default 100), thresholds: lower 1, upper 100
Load balancing: round-robin
There are 2 forwarders (1 active)
Forwarder 1
State is Listen
MAC address is 0007.b400.0101 (learnt)
Owner ID is cc04.0ec0.0000
Time to live: 14397.184 sec (maximum 14400 sec)
Preemption enabled, min delay 30 sec
Active is 192.168.1.2 (primary), weighting 100 (expires in 7.184 sec)
Forwarder 2
State is Active
1 state change, last state change 00:32:53
MAC address is 0007.b400.0102 (default)
Owner ID is cc05.0ec0.0000
Preemption enabled, min delay 30 sec
Active is local, weighting 100
R3#
R3#
R3#sh glb bri
Interface Grp Fwd Pri State Address Active router Standby router
Fa0/0.100 1 - 100 Standby 192.168.1.1 192.168.1.2 local
Fa0/0.100 1 1 - Listen 0007.b400.0101 192.168.1.2 -
Fa0/0.100 1 2 - Active 0007.b400.0102 local -
R3#
Step 5:test
R4#traceroute 1.1.1.1
Type escape sequence to abort.
Tracing the route to 1.1.1.1
1 *
192.168.1.3 56 msec 36 msec
2 13.1.1.1 80 msec * 76 msec
R4#
R5#traceroute 1.1.1.1
Type escape sequence to abort.
Tracing the route to 1.1.1.1
1 192.168.1.2 1008 msec 36 msec 64 msec
2 12.1.1.1 60 msec * 100 msec
R5#
R6#traceroute 1.1.1.1
Type escape sequence to abort.
Tracing the route to 1.1.1.1
1 192.168.1.2 28 msec 44 msec 16 msec
2 12.1.1.1 24 msec * 44 msec
R7#traceroute 1.1.1.1
Type escape sequence to abort.
Tracing the route to 1.1.1.1
1 *
192.168.1.3 24 msec 12 msec
2 13.1.1.1 56 msec * 56 msec
Step 6:modify load-balance...
R2(config)#int f0/0.100
R2(config-if)#glbp 1 load weight
R2(config-if)#glbp 1 track 1
R2(config)#track 1 interface f0/0.12 ip routing
R2#sh glbp
FastEthernet0/0.100 - Group 1
State is Active
2 state changes, last state change 00:57:17
Virtual IP address is 192.168.1.1
Hello time 3 sec, hold time 10 sec
Next hello sent in 0.292 secs
Redirect time 600 sec, forwarder time-out 14400 sec
Preemption disabled
Active is local
Standby is 192.168.1.3, priority 100 (expires in 8.264 sec)
Priority 100 (default)
Weighting 10 (configured 20), thresholds: lower 1, upper 20
Track object 1 state Down decrement 10
Load balancing: weighted
There are 3 forwarders (1 active)
Forwarder 1
State is Active
1 state change, last state change 00:57:07
MAC address is 0007.b400.0101 (default)
Owner ID is cc04.0ec0.0000
Redirection enabled
Preemption enabled, min delay 30 sec
Active is local, weighting 10
Arp replies sent: 2
Forwarder 2
State is Listen
MAC address is 0007.b400.0102 (learnt)
Owner ID is cc05.0ec0.0000
Redirection enabled, 599.568 sec remaining (maximum 600 sec)
注:
选举使用priority,weight用于负载分担,因为不同的路由器性能不同,各路由器负担的流量和weight成正比;同时可设置upper和lower,当所track的端口down掉以后,就减少weight值,当weight低于lower时路由器停止转发数据,当weight高于upper是恢复转发数据。
可同时track多个端口,各个端口down掉后减少的weight值可以设置不一样的,当weight最大值减掉所有down的端口weight低于lower时,路由器停止转发数据,当端口恢复,权重值加起来高于upper是路由器又开始恢复转发数据。