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

Today, I finally figured out the operation command and principle of HSRP.

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This was supposed to be yesterday's homework, although it was basically successful last night, but I didn't fully understand why it was operated like that, which led to the imperfect completion. I would like to thank our dear teacher for reviewing us all morning. When the class was just over, on the basis of adding today's new content, we solved this problem easily.

The following steps will be shared for understanding:

1. IP address planning

VLAN2: 192.168.2.0Universe 24, GW-192.168.2.254

VLAN3: 192.168.3.0Universe 24, GW-192.168.3.254

VLAN 4: 192.168.4.0 take 24, GW-192.168.4.254

2. PC configuration

Configure the ip, subnet mask and gateway of each PC

3. Configure VLAN and member ports on the switch.

SW1:

Create VLAN 2\ 3\ 4

SW1 (config) # vlan 2

SW1 (config) # vlan 3

SW1 (config) # vlan 4

Planning member ports:

SW1:

SW1 (config) # interface fas0/2

SW1 (config-if) # switchport mode access

SW1 (config-if) # switchport access vlan 2

SW1 (config) # interface fas0/3

SW1 (config-if) # switchport mode access

SW1 (config-if) # switchport access vlan 3

SW1 (config) # interface fas0/ 4

SW1 (config-if) # witchport mode access

SW1 (config-if) # switchport access vlan 4

4. Configure the core switch

Create a VLAN on SW2 and SW3 respectively

SW2:

SW2 (config) # vlan 2

SW2 (config) # vlan 3

SW2 (config) # vlan 4

SW3:

SW3 (config) # vlan 2

SW3 (config) # vlan 3

SW3 (config) # vlan 4

5. Configure the cascade links between switches

SW1:

SW1 (config) # interface fas0/12

SW1 (config-if) # switchport mode trunk

SW1 (config) # interface fas0/13

SW1 (config-if) # switchport mode trunk

SW2:

SW2 (config) # interface fas0/12

SW2 (config-if) # switchport mode trunk

SW2 (config) # interface fas0/23

SW2 (config-if) # switchport trunk encapsulation dotlq

SW2 (config-if) # switchport mode trunk

SW3:

SW3 (config) # interface fas0/13

SW3 (config-if) # switchport mode trunk

SW3 (config-if) # interface fas0/23

SW3 (config-if) # switchport trunk encapsulation dotlq

SW3 (config-if) # switchport mode trunk

6. Configure STP:

SW2 is the STP root switch of VLAN2\ 3

SW3 is the STP root switch of VLAN 4

SW2 (config) # spanning-tree vlan 2 priority 4096

SW2 (config) # spanning-tree vlan 3 priority 4096

SW3 (config) # spanning-tree vlan 4 priority 4096

7. Configure communication between different network segments (routing)

Determine the gateway

Gateway device-Core switch

Achieve:

Enable routing function

Configure gateway interfac

SW2:

SW2 (config) # ip routing

SW2 (config) # interface vlan 2-SVI

SW2 (config-vlan) # no shutdown

SW2 (config-vlan) # ip address 192.168.2.254 255.255.255.0

SW2 (config) # interface vlan 3-SVI

SW2 (config-vlan) # no shutdown

SW2 (config-vlan) # ip address 192.168.3.254 255.255.255.0

SW2 (config) # interface vlan 4-SVI

SW2 (config-vlan) # no shutdown

SW2 (config-vlan) # ip address 192.168.4.254 255.255.255.0

Ensure routin

First, interconnect with the peer router to ensure the interconnection of directly connected links.

SW2:

SW2 (config) # interface vlan 12

SW2 (config-if) # no shutdown

SW2 (config-if) # ip address 192.168.12.1 255.255.255.0

GW:

GW (config) # interface gi0/0

GW (config-if) # no shutdown

GW (config-if) # ip address 192.168.12.2 255.255.255.0

Second, make sure that both GW and SW2 have routes to each other

SW2:

SW2 (config) # ip routing

SW2 (config) # ip route 10.10.10.0 255.255.255.0 192.168.12.2

GW:

GW (config) # ip route 192.168.0.0 255.255.0.0 192.168.12.1

At this point, PC-1/2/3 can successfully access the test host.

8. Consider redundant design

Introduce and configure the core switch SW3:

Enable routing function

Configure each VLAN gateway

Configure the interconnection link between SW3 and GW

Make sure SW2 and GW have a route to each other.

Enable HSRP for each VLAN and configure a virtual gateway

SW3:

SW3 (config) # ip routing

SW3 (config) # interface vlan 10-SVI

SW3 (config-vlan) # no shutdown

SW3 (config-vlan) # ip address 192.168.10.253 255.255.255.0

SW3 (config) # interface vlan 20-SVI

SW3 (config-vlan) # no shutdown

SW3 (config-vlan) # ip address 192.168.20.253 255.255.255.0

SW3 (config) # interface vlan 30-SVI

SW3 (config-vlan) # no shutdown

SW3 (config-vlan) # ip address 192.168.30.253 255.255.255.0

SW3:

SW3 (config) # interface vlan 13

SW3 (config) # no shutdown

SW3 (config-vlan) # ip address 192.168.13.1 255.255.255.0

GW:

GW (config) # interface gi0/1

GW (config-if) # no shutdown

GW (config-if) # ip address 192.168.13.2 255.255.255.0

SW3:

SW3 (config) # ip route 10.10.10.0 255.255.255.0 192.168.13.2

GW:

GW (config) # ip route 192.168.0.0 255.255.0.0 192.168.13.1

SW2:

SW2 (config) # interface vlan 10

SW2 (config-vlan) # standby 10 ip 192.168.10.250

SW2 (config-vlan) # standby 10 priority 200,105

SW2 (config-vlan) # standby 10 preempt

SW2 (config) # interface vlan 20

SW2 (config-vlan) # standby 20 ip 192.168.20.250

SW2 (config-vlan) # standby 20 priority 200,105

SW2 (config-vlan) # standby 20 preempt

SW2 (config) # interface vlan 30

SW2 (config-vlan) # standby 30 ip 192.168.30.250

SW2 (config-vlan) # standby 30 preempt

SW3:

SW3 (config) # interface vlan 10

SW3 (config-vlan) # standby 10 ip 192.168.10.250SS

SW3 (config-vlan) # standby 10 preempt

SW3 (config) # interface vlan 20

SW3 (config-vlan) # standby 20 ip 192.168.20.250

SW3 (config-vlan) # standby 20 preempt

SW3 (config) # interface vlan 30

SW3 (config-vlan) # standby 30 ip 192.168.30.250

SW3 (config-vlan) # standby 30 priority

SW3 (config-vlan) # standby 30 preempt

9. Configure HSRP link tracking on SW2 and SW3 (must be done)

SW2:

SW2 (config) # iinterface vlan 10

SW2 (config-vlan) # istandby 10 track fas0/1

SW2:

SW2 (config) # interface vlan 20

SW2 (config-vlan) # standby 20 track fas0/1

SW3:

SW3 (config) # interface vlan 30

SW3 (config-vlan) # standby 30 track fas0/1

For real machine operation, the default priority of the system is 100. Enter the above command and the priority will automatically be reduced by 10 to 95)

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

Servers

Wechat

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

12
Report