In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Case: HSRP configuration
1.1 question
In the connection scheme of the enterprise network to the outside, it can be a single exit if the requirement is not high. Once there is a problem with the exit line, the entire enterprise network cannot be connected to the external network. In order to make the enterprise network to the external network connection of high availability, you can set more than two exits, however, multiple exits for the intranet host means my gateway. The host cannot use multiple gateways at the same time, and when the gateway used by the host fails, it can not realize the automatic switching of the gateway.
Configure hot backup routing protocol
1.2 scenario
The hot backup routing protocol (HSRP) is configured on the egress devices to form a HSRP group. The two egress devices in the group share a virtual IP address, which is used as the gateway of the intranet host.
The HSRP group members are divided into active and standby, and the virtual IP address is attached to the master device. If the primary device line fails, the backup device becomes the primary device and the virtual IP address is migrated. In this way, no matter which exit device has a problem, no matter which exit device is providing external network access, the gateway of the internal network host does not need to be changed.
The network topology diagram is shown in figure-1:
Figure-1
1.3 steps
To implement this case, you need to follow these steps.
Step 1: configure port IP addresses on the three routers
Tarena-R1 (config) # interface f0/0tarena-R1 (config-if) # ip address 192.168.1.252 255.255.255.0tarena-R1 (config-if) # no shutdowntarena-R1 (config-if) # interface f0/1tarena-R1 (config-if) # ip address 192.168.2.1 255.255.255.0tarena-R1 (config-if) # no shutdowntarena-R2 (config) # interface f0/0tarena-R2 (config-if) # ip address 192.168.1.253 255 255.255.0tarena-R2 (config-if) # no shutdowntarena-R2 (config-if) # interface f0/1tarena-R2 (config-if) # ip address 192.168.3.1 255.255.255.0tarena-R2 (config-if) # no shutdowntarena-R3 (config) # interface f0/0tarena-R3 (config-if) # ip address 192.168.2.2 255.255.255.0tarena-R3 (config-if) # no shutdowntarena-R3 (config-if) # interface f0/1tarena-R3 ( Config-if) # ip address 192.168.3.2 255.255.255.0tarena-R3 (config-if) # no shutdowntarena-R3 (config-if) # interface f1/0tarena-R3 (config-if) # ip address 192.168.4.254 255.255.255.0tarena-R3 (config-if) # no shutdown
Step 2: configure a default route to the external network on R1 and R2
Tarena-R1 (config) # ip route 0.0.0.0 0.0.0.0 192.168.2.2tarena-R1 (config) # endtarena-R1#show ip routeCodes: C-connected, S-static, I-IGRP, R-RIP, M-mobile, B-BGP D-EIGRP, EX-EIGRP external, O-OSPF, IA-OSPF inter area N1-OSPF NSSA external type 1, N2-OSPF NSSA external type 2 E1-OSPF external type 1, E2-OSPF external type 2 E-EGP I-IS-IS, L1-IS-IS level-1, L2-IS-IS level-2, ia-IS-IS inter area *-candidate default, U-per-user static route, o-ODR P-periodic downloaded static routeGateway of last resort is 192.168.1.2 to network 0.0.0.0C 192.168.1.0 is directly connected, FastEthernet0/0C 192.168.2.0 and 24 is directly connected FastEthernet0/1S* 0.0.0.0 via 192.168.2.2tarena-R1#tarena-R2 (config) # ip route 0.0.0.0 0.0.0.0 192.168.3.2tarena-R2 (config) # exittarena-R2#show ip routeCodes: C-connected, S-static, I-IGRP, R-RIP, M-mobile, B-BGP D-EIGRP, EX-EIGRP external, O-OSPF, IA-OSPF inter area N1-OSPF NSSA external type 1 N2-OSPF NSSA external type 2 E1-OSPF external type 1, E2-OSPF external type 2, E-EGP I-IS-IS, L1-IS-IS level-1, L2-IS-IS level-2, ia-IS-IS inter area *-candidate default, U-per-user static route, o-ODR P-periodic downloaded static routeGateway of last resort is 192.168.2.2 to network 0.0.0.0C 192.168.1.0 and 24 is directly connected FastEthernet0/0C 192.168.3.0/24 is directly connected, FastEthernet0/1S* 0.0.0.0/0 [1/0] via 192.168.3.2
Step 3: configure a static route to the intranet on R3
Tarena-R3 (config) # ip route 192.168.1.0 255.255.255.0 192.168.2.1tarena-R3 (config) # ip route 192.168.1.0 255.255.255.0 192.168.3.1tarena-R3 (config) # endtarena-R3#show ip routeCodes: C-connected, S-static, I-IGRP, R-RIP, M-mobile, B-BGP D-EIGRP, EX-EIGRP external, O-OSPF, IA-OSPF inter area N1-OSPF NSSA external type 1 N2-OSPF NSSA external type 2 E1-OSPF external type 1, E2-OSPF external type 2, E-EGP I-IS-IS, L1-IS-IS level-1, L2-IS-IS level-2, ia-IS-IS inter area *-candidate default, U-per-user static route O-ODR P-periodic downloaded static routeGateway of last resort is not setS 192.168.1.0 via 192.168.2.1 [1FastEthernet1/0tarena-R3# 0] via 192.168.3.1C 192.168.2.0 is directly connected 24 is directly connected, FastEthernet0/0C 192.168.3.0 FastEthernet0/1C 192.168.4.0 FastEthernet0/1C 24 is directly connected, FastEthernet1/0tarena-R3#
Step 4: configure HSRP on R1 and specify a priority of 200
The default priority of HSRP is 100. after the router starts, it determines who can become the active router according to the priority, and the one with higher priority will win. If the router priority is the same, and then compare the port IP address, the larger IP address becomes a live router.
In addition, if the low-priority router starts first, it will become an active router. When a high-priority router starts, it is found that an active router already exists, it will accept the status quo, and it will not become an active role in the re-election until the active router fails.
Tarena-R1 (config) # interface f0/0tarena-R1 (config-if) # standby 1 ip 192.168.1.254tarena-R1 (config-if) # standby 1 priority 200%HSRP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Speak-> Standby%HSRP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Standby-> Active
After configuring HSRP, you can observe a change in the role of the router by outputting the log.
Step 5: configure HSRP on R2 and specify a priority of 195
Tarena-R2 (config) # interface f0/0tarena-R2 (config-if) # standby 1 ip 192.168.1.254tarena-R2 (config-if) # standby 1 priority 195%HSRP-6-STATECHANGE: FastEthernet0/0 Grp 1 state Speak-> Standby
Step 6: view HSRP information on R1 and R2, respectively
Tarena-R1#show standby brief P indicates configured to preempt. | Interface Grp Pri P State Active Standby Virtual IPFa0/0 1200 Active local 192.168.1.253 192.168.1.254tarena-R2#show standby brief P indicates configured to preempt. | | Interface Grp Pri P State Active Standby Virtual IPFa0/0 1 195 Standby 192.168.2.252 local 192.168.1.254 |
Step 7: test connectivity to external hosts on internal hosts
SERVER > ipconfigFastEthernet0 Connection: (default port) Link-local IPv6 Address.: FE80::207:ECFF:FE80:557DIP Address..: 192.168.1.1Subnet Mask.: 255.255.255.0Default Gateway.: 192.168.1.254PC > ping 192 .168.4.1 with 192.168.4.1 with 32 bytes of data:Reply from 192.168.4.1: bytes=32 time=0ms TTL=126Reply from 192.168.4.1: bytes=32 time=1ms TTL=126Ping statistics for 192.168.4.1 Packets: Sent = 4 Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 1ms, Average = 0ms
Step 8: configure port tracking on R1 and preemption on R2
Tarena-R1 (config) # interface fastEthernet 0/0tarena-R1 (config-if) # standby 1 track f0/1tarena-R2 (config) # interface fastEthernet 0/0tarena-R2 (config-if) # standby 1 preempt
Step 9: shut down the f0amp1 interface of R1, simulate the device failure, and view the HSRP information of R2.
Tarena-R1 (config) # interface fastEthernet 0/1tarena-R1 (config-if) # shutdowntarena-R2#show standby brief P indicates configured to preempt. | | Interface Grp Pri P State Active Standby Virtual IPFa0/0 1 195 Active local unknown 192.168.1.254 |
The results show that R2 has become an active router, while the status of the backup router is unknown. The IP address of the virtual router, 192.168.1.254Universe 24, has also been migrated to R2.
Step 10: configure the preemption on R1, activate R1's f0ax 1 interface and check the status
After the backup router becomes an active router, R1, the original active router, will not become active again even if the line is repaired.
In order for the router to determine its state entirely on the basis of priority, it is necessary to configure preemption. Preemption ensures that which device becomes active is determined strictly according to priority.
Tarena-R1 (config) # interface f0/0tarena-R1 (config-if) # standby 1 preempttarena-R1 (config) # interface f0/1tarena-R1 (config-if) # no shutdowntarena-R1#show standby brief P indicates configured to preempt. | | Interface Grp Pri P State Active Standby Virtual IPFa0/0 1200 Active local 192.168.1.253 192.168.1.254 |
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.