HSRP
试验拓扑图如下:
好了,我们的试验拓扑图已经搭建好了,那么接下来我们来配置我们的接口的 IP 地址:
R1
R1#sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
Serial0/0                  15.15.15.1      YES manual up                    up     
Serial0/1                  13.13.13.1      YES manual up                    up     
Loopback0                  1.1.1.1         YES manual up                    up 
R5
   R5#sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
Serial0/0                  15.15.15.5      YES manual up                    up     
FastEthernet1/0            100.1.1.1       YES manual up                    up
 
R3
  R3#sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
Serial0/0                  13.13.13.3      YES manual up                    up     
FastEthernet1/0            100.1.1.2       YES manual up                    up
 
R4
  R4#sh ip int b
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            100.1.1.3       YES manual up                    up
 
好了,我们的各个接口的 IP 地址已经配置好了,并且他们的接口状态也已经都 UP 了,那么接下来我们在 R1 R3 R5 之间运行一个 IGP 协议,我们这里以 eigrp 为例:
R1
router eigrp 100
  network 1.1.1.1 0.0.0.0
  network 13.13.13.0 0.0.0.255
  network 15.15.15.0 0.0.0.255
  auto-summary
R3
router eigrp 100
 network 13.13.13.0 0.0.0.255
 network 100.1.1.0 0.0.0.255
auto-summary
R5
router eigrp 100
 network 15.15.15.0 0.0.0.255
 network 100.1.1.0 0.0.0.255
 auto-summary
好了,我们的 EIGRP 也运行起来了,那么接下来我们就要开始配置我们的 HSRP 了,那么来看下我们的配置:
R3
interface FastEthernet1/0
 ip address 100.1.1.2 255.255.255.0
 duplex auto
 speed auto
standby 1 ip 100.1.1.100
 standby 1 preempt
 standby 1 authentication md5 key-string cisco
 standby 2 ip 100.1.1.200
 standby 2 priority 103
 standby 2 preemp
R5
interface FastEthernet1/0
 ip address 100.1.1.1 255.255.255.0
 duplex auto
 speed auto
 standby 1 ip 100.1.1.100
 standby 1 priority 103
 standby 1 preempt
 standby 1 authentication md5 key-string cisco
 standby 1 track Serial0/0
 standby 2 ip 100.1.1.200
 standby 2 preempt
好了,我们的 HSRP 也配置成功了,那么我们来看一下他们的状态,首先我们来看一下 R3 路由器上的状态:
R3
  R3#sh standby b
                     P indicates configured to preempt.
                     |
Interface   Grp Prio P State    Active          Standby         Virtual IP    
Fa1/0       1   100  P Standby  100.1.1.1       local           100.1.1.100   
Fa1/0       2   103  P Active   local           100.1.1.1       100.1.1.200
 
R5
R5#SH STANDBY B
                     P indicates configured to preempt.
                     |
Interface   Grp Prio P State    Active          Standby         Virtual IP    
Fa1/0       1   103  P Active   local           100.1.1.2       100.1.1.100   
Fa1/0       2   100  P Standby  100.1.1.2       local           100.1.1.200
 
其实我们的试验的配置是配置了组 HSRP 的,因为在我们的平常的 HSRP 中有一台路由器是 actice 的,但是有一台是 standby 的,那么就造成了我们的浪费了,那么现在我们来配置组 HSRP 让我们的一个组通过一个路由器走,让另外的一个组通过另一个路由器走,那么这样的话我们的路由器就都利用起来了,这样的话如果其中有一台路由器 down 了之后他会自动的去走其他的路由器的。
看一下连通性:
R4#ping 1.1.1.1
 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 52/80/124 ms