Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Multiple VLAN uses the same HSRP group

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

Multiple VLAN uses the same HSRP group

When configuring HSRP, the group number of HSRP is generally sufficient. What should I do if the group number of HSRP is not enough? At this point, multiple VLAN can be configured into the same HSRP group, and this HSRP group contains multiple virtual IP addresses. The following is illustrated by a configuration example.

As shown in figure 5.1, set up the network environment and configure HSRP and spanning tree to achieve load balancing.

Figure 5.1 HSRP network topology such as

The specific network planning is as follows:

1) HSRP parameter planning is shown in Table 5.1.

Table 5.1 HSRP parameter planning table

HSRP parameter

Active equipment

Backup equipment

Priority

one hundred and fifty

one hundred

Preemptive right

Yes

Yes

timer

Default

Default

Group number

two

Note:

L active router for VLAN2:SW1 and backup router for SW2

L backup router for VLAN3:SW1 and active router for SW2

2) the physical IP address of the VLAN virtual interface on the SW1 switch: VLAN 2vl 192.168.2.1Unip 24

VLAN 3:192.168.3.1/24

The physical IP address of the VLAN virtual interface on the SW2 switch: VLAN 2purl 192.168.2.2 Univer 24

VLAN 3:192.168.3.2/24

3) the IP address of PC1: 192.168.2.10 Universe 24, and the virtual gateway is 192.168.2.254 Universe 24.

The IP address of PC2 is 192.168.3.10 Universe 24, and the virtual gateway is 192.168.3.254 Universe 24.

4) the interconnection address between SW1 and R1 is 192.168.0.0Universe 30.

The interconnection address between SW2 and R1 is 192.168.1.0 Universe 30.

5) configure the Loopback interface address of R1 router 192.168.100.1 to 24 analog public network address

6) the links between the switches are all trunk links, and static routes are used to realize network interworking.

Configure the network according to the network plan.

1. Configure the basic information of the device (interface IP, VLAN, TRUNK, routing, etc.), omitting the configuration

When configuring, you need to pay attention to the configuration such as layer 3 switch enabling routing function, VLAN virtual port enabling layer 3 function, layer 3 switch port enabling layer 3 function, and the physical IP address of the interface configuration.

2. Configure HSRP

Configure HSRP on SW1 and SW2, respectively, as follows:

SW1 configuration

SW1 (config) # interface vlan 2

SW1 (config-if) # ip address 192.168.2.1 255.255.255.0

SW1 (config-if) # standby 2 ip 192.168.2.254 / / configure the virtual IP address

SW1 (config-if) # standby 2 priority 150 / / configure priority

SW1 (config-if) # standby 2 preempt / / configuration preemptive

SW1 (config-if) # standby 2 track fastEthernet 0swap 1 100 / / configure port tracking

SW1 (config) # interface vlan 3 / / priority uses the default configuration of 100and does not need to trace the port

SW1 (config-if) # ip address 192.168.3.1 255.255.255.0

SW1 (config-if) # standby 2 ip 192.168.3.254

SW1 (config-if) # standby 2 preempt

SW2 configuration

SW2 (config) # interface vlan 2

SW2 (config-if) ip address 192.168.2.2 255.255.255.0

SW2 (config-if) # standby 2 ip 192.168.2.254

SW2 (config-if) # standby 2 preempt

SW2 (config) # interface vlan 3

SW2 (config-if) # ip address 192.168.3.2

SW2 (config-if) # standby 2 ip 192.168.3.254

SW2 (config-if) # standby 2 priority 150

SW2 (config-if) # standby 2 preempt

SW2 (config-if) # standby 2 track fastEthernet 0lap 1 100

As you can see from the configuration, both VLAN2 and VLAN3 use a HSRP group number of 2.

3. Configure STP to realize VLAN load balancing.

The configuration information for SW1 is as follows:

SW1 (config) # spanning-tree vlan 2 root primary

SW1 (config) # spanning-tree vlan 3 root secondary

The configuration information for SW2 is as follows:

SW2 (config) # spanning-tree vlan 2 root secondary

SW2 (config) # spanning-tree vlan 3 root primary

This ensures that the port blocked by the STP instance of VLAN2 is one of the SW2 and SW3 connection ports, while the STP instance of VLAN3 is blocking one of the SW1 and SW3 connection ports. This ensures that the links from the SW3 to the active router of different VLAN are not blocked.

4. Verify HSRP

Use the show standby command to view HSRP details as follows:

SW1#show standby

Vlan2-Group 2 / / HSRP Group 2

State is Active

2 state changes, last state change 00:13:12

Virtual IP address is 192.168.2.254

Active virtual MAC address is 0000.0c07.ac02

Local virtual MAC address is 0000.0c07.ac02 (v1 default)

Hello time 3 sec, hold time 10 sec

Next hello sent in 2.400 secs

Preemption enabled

Active router is local

Standby router is 192.168.2.2, priority 100 (expires in 10.208 sec)

Priority 150 (configured 150)

Group name is "hsrp-Vl2-2" (default)

Vlan3-Group 2 / / HSRP Group 2

State is Standby

2 state changes, last state change 00:11:46

Virtual IP address is 192.168.3.254

Active virtual MAC address is 0000.0c07.ac02

Local virtual MAC address is 0000.0c07.ac02 (v1 default)

Hello time 3 sec, hold time 10 sec

Next hello sent in 0.656 secs

Preemption enabled

Active router is 192.168.3.2, priority 150 (expires in 9.024 sec)

Standby router is local

Priority 100 (default 100)

Group name is "hsrp-Vl3-2" (default)

You can also use the show standby brief command to view brief information about HSRP, as shown below:

SW1#show standby brief

P indicates configured to preempt.

| |

Interface Grp Pri P State Active Standby Virtual IP

Vl2 2 150 P Active local 192.168.2.2 192.168.2.254

Vl3 2 100 P Standby 192.168.3.2 local 192.168.3.254

Using the ping command on PC1 and PC2 (the gateway is the virtual IP address), you can communicate with R1 (192.168.100.1) normally.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report