Cisco HSRP Hot Standby Router Protocol Configuration

 

 

HSRP Hot Standby Router Protocol:

 

HSRP is the abbreviation of Hot Standby Routing Protocol (Hot Standby Routing Protocol), its role is when the core router cannot work normally,

The backup router can realize automatic and smooth replacement to ensure the normal use of the network. The protocol contains multiple routers, corresponding to an HSRP group.

Only one router in the group is responsible for forwarding user traffic, and this is the active router. When the active router fails, the backup router will

Take this responsibility and become the new active router. This is the principle of hot backup.

 

 

 

Design ideas:

 

1. C2911 set gi0/1 to configure an IP address as an external network address and configure VLAN10 VLAN 20 VLAN30 backhaul routing

2. The C2960_03 switch is only used as an expansion port

3. C3560A and C3560B create three VLANs (VLAN10 VLAN20 VLAN30) and configure HSRP

4. C2960_01 and C2960_02 configure VLAN and assign ports

5. PC0 assigns the IP address of VLAN10, and PC1 assigns the IP address of VLAN20

6. Laptop0 and Laptop1 assign the IP address of VLAN30

 

 

 

 

Network topology diagram:

 

 

 

 

 

The C3650A is configured as follows:

 

## Configure gi0/1 port IP address

C2911>enable

C2911#configure terminal

C2911 (config)#interface gigabitEthernet 0/1

C2911 (config-if)#ip address 172.16.1.1 255.255.255.0

C2911 (config-if)#no shutdown

C2911 (config-if)#exit

## Configure VLAN 10 VLAN20 VLAN30 backhaul route

C2911 (config)#ip route 192.168.10.0 255.255.255.0 172.16.1.254

C2911 (config)#ip route 192.168.20.0 255.255.255.0 172.16.1.254

C2911 (config)#ip route 192.168.30.0 255.255.255.0 172.16.1.254

 

 

 

C2960_03 is configured as follows:

 

C2960>enable

C2960#configure terminal

C2960(config)#interface range fastEthernet 0/1-3

C2960(config-if-range)#no shutdown

C2960(config-if-range)#exit

 

 

 

The C3650A is configured as follows:

 

## Create VLAN10 VLAN20 VLAN30

C3560A>enable

C3560A#vlan database

C3560A(vlan)#vlan 10 name VLAN10

C3560A(vlan)#vlan 20 name VLAN20

C3560A(vlan)#vlan 30 name VLAN30

C3560A(vlan)#exit

## Configure HSRP

C3560A#configure terminal

C3560A(config)#interface vlan 10

C3560A(config-if)#ip address 192.168.10.1 255.255.255.0

C3560A (config-if)#standby 10 ip 192.168.10.254 #Configure       HSRP virtual IP

C3560A (config-if)#standby 10 priority 150 #Configure           HSRP priority

C3560A(config-if)#standby 10 preempt #Configure                HSRP preemption

C3560A(config-if)#exit

C3560A(config)#interface vlan 20

C3560A(config-if)#ip address 192.168.20.1 255.255.255.0

C3560A(config-if)#standby 20 ip 192.168.20.254

C3560A(config-if)#standby 20 priority 150

C3560A(config-if)#standby 20 preempt

C3560A(config-if)#exit

C3560A(config)#interface vlan 30

C3560A(config-if)#ip address 192.168.30.1 255.255.255.0

C3560A(config-if)#standby 30 ip 192.168.30.254

C3560A(config-if)#standby 30 priority 150

C3560A(config-if)#standby 30 preempt

C3560A(config-if)#exit

## Configure fa0/20-21 port as trunk

C3560A(config)#interface range fastEthernet 0/20-21

C3560A(config-if-range)#switchport trunk encapsulation dot1q

C3560A(config-if-range)#switchport mode trunk

C3560A(config-if-range)#no shutdown

C3560A(config-if-range)#exit

## Configure fa0/24 as a Layer 3 interface to connect to the upper-level route (connect to the external network)

C3560A(config)#interface fastEthernet 0/24

C3560A(config-if)#no switchport

C3560A(config-if)#ip address 172.16.1.254 255.255.255.0

C3560A(config-if)#exit

## Enable routing

C3560A(config)#ip routing

## Set the default exit route of the Layer 3 switch

C3560A(config)#ip route 0.0.0.0 0.0.0.0 172.16.1.1

## Display and maintenance

C3560A#show standby brief

C3560A#show running-config

 

 

 

The C3650B is configured as follows:

 

## Create VLAN10 VLAN20 VLAN30

C3560B>enable

C3560B#vlan database

C3560B(vlan)#vlan 10 name VLAN10

C3560B(vlan)#vlan 20 name VLAN20

C3560B(vlan)#vlan 30 name VLAN30

C3560B(vlan)#exit

## Configure HSRP

C3560B#configure terminal

C3560B(config)#interface vlan 10

C3560B(config-if)#ip address 192.168.10.2 255.255.255.0

C3560B(config-if)#standby 10 ip 192.168.10.254

C3560B(config-if)#standby 10 priority 100

C3560B(config-if)#standby 10 preempt

C3560B(config-if)#exit

C3560B(config)#interface vlan 20

C3560B(config-if)#ip address 192.168.20.2 255.255.255.0

C3560B(config-if)#standby 20 ip 192.168.20.254

C3560B(config-if)#standby 20 priority 100

C3560B(config-if)#standby 20 preempt

C3560B(config-if)#exit

C3560B(config)#interface vlan 30

C3560B(config-if)#ip address 192.168.30.2 255.255.255.0

C3560B(config-if)#standby 30 ip 192.168.30.254

C3560B(config-if)#standby 30 priority 100

C3560B(config-if)#standby 30 preempt

C3560B(config-if)#exit

## Configure fa0/20-21 port as trunk

C3560B(config)#interface range fastEthernet 0/20-21

C3560B(config-if-range)#switchport trunk encapsulation dot1q

C3560B(config-if-range)#switchport mode trunk

C3560B(config-if-range)#no shutdown

C3560B(config-if-range)#exit

## Configure fa0/24 as a Layer 3 interface to connect to the upper-level route (connect to the external network)

C3560B(config)#interface fastEthernet 0/24

C3560B(config-if)#no switchport

C3560B(config-if)#ip address 172.16.1.254 255.255.255.0

C3560B(config-if)#exit

## Enable routing

C3560B(config)#ip routing

## Set the default exit route of the Layer 3 switch

C3560B(config)#ip route 0.0.0.0 0.0.0.0 172.16.1.1

## Display and maintenance

C3560B#show standby brief

C3560B#show running-config

 

 

 

C2960_01 is configured as follows:

C2960_01>enable

C2960_01#vlan database

C2960_01(vlan)#vlan 10 name VLAN10

C2960_01(vlan)#vlan 20 name VLAN20

C2960_01(vlan)#vlan 30 name VLAN30

C2960_01(vlan)#exit

C2960_01#configure terminal

C2960_01(config)#interface range fastEthernet 0/1-5

C2960_01(config-if-range)#switchport access vlan 10

C2960_01(config-if-range)#switchport mode access

C2960_01(config-if-range)#no shutdown

C2960_01(config-if-range)#exit

C2960_01(config)#interface range fastEthernet 0/6-10

C2960_01(config-if-range)#switchport access vlan 30

C2960_01(config-if-range)#switchport mode access

C2960_01(config-if-range)#no shutdown

C2960_01(config-if-range)#exit

C2960_01(config)#interface range fastEthernet 0/23-24

C2960_01(config-if-range)#switchport mode trunk

C2960_01(config-if-range)#no shutdown

C2960_01(config-if-range)#exit

 

 

C2960_02 is configured as follows:

C2960_02>enable

C2960_02#vlan database

C2960_02(vlan)#vlan 10 name VLAN10

C2960_02(vlan)#vlan 20 name VLAN20

C2960_02(vlan)#vlan 30 name VLAN30

C2960_02(vlan)#exit

C2960_02#configure terminal

C2960_02(config)#interface range fastEthernet 0/1-5

C2960_02(config-if-range)#switchport access vlan 20

C2960_02(config-if-range)#switchport mode access

C2960_02(config-if-range)#no shutdown

C2960_02(config-if-range)#exit

C2960_02(config)#interface range fastEthernet 0/6-10

C2960_02(config-if-range)#switchport access vlan 30

C2960_02(config-if-range)#switchport mode access

C2960_02(config-if-range)#no shutdown

C2960_02(config-if-range)#exit

C2960_02(config)#interface range fastEthernet 0/23-24

C2960_02(config-if-range)#switchport mode trunk

C2960_02(config-if-range)#no shutdown

C2960_02(config-if-range)#exit

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324519961&siteId=291194637